Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cmake/dependencies/crashpad.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ SET(_crashpad_handler
LIST(APPEND _configure_options "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
LIST(APPEND _configure_options "-DCRASHPAD_BUILD_TESTS=OFF")

# Pin the MSVC toolset to match the parent build. Without this, cmake auto-selects the newest installed toolset (e.g. 14.44) while the main build uses a pinned
# version (e.g. 14.40). The mismatch causes LNK2019 for __std_find_end_1 and similar CRT symbols added only in newer toolsets. Only applies to Visual Studio
# generators; the crashpad build dir must be clean.
IF(CMAKE_GENERATOR MATCHES "Visual Studio"
AND CMAKE_GENERATOR_TOOLSET
)
LIST(APPEND _configure_options "-T")
LIST(APPEND _configure_options "${CMAKE_GENERATOR_TOOLSET}")
ENDIF()

# Disable deprecation warnings on macOS — mini_chromium uses deprecated Security APIs
IF(RV_TARGET_DARWIN)
LIST(APPEND _configure_options "-DCMAKE_CXX_FLAGS=-Wno-error=deprecated-declarations -Wno-deprecated-declarations")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ import rv.qtutils
# Gets the current RV session windows as a PySide QMainWindow.
rvSessionWindow = rv.qtutils.sessionWindow()

# Gets the current RV session GL view as a PySide QGLWidget.
# Gets the current RV session view host as a PySide QWidget. Note: the GL
# viewport is now a native child window embedded in this host (via
# createWindowContainer), so this is a plain QWidget, not a QOpenGLWidget.
rvSessionGLView = rv.qtutils.sessionGLView()

# Gets the current RV session top tool bar as a PySide QToolBar.
Expand Down
17 changes: 16 additions & 1 deletion src/bin/apps/rv/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,14 @@ int utf8Main(int argc, char* argv[])
// Qt 5.12.1 specific
// Disable Qt Quick hardware rendering because QwebEngineView conflicts with
// QGLWidget
setEnvVar("QT_QUICK_BACKEND", "software");
//
// Direction C: the RV viewport is now a native GL window (GLWindow) hosted
// via createWindowContainer, not a QOpenGLWidget. The main window no longer
// forces the OpenGL RHI backend, so QtWebEngine's QQuickWidget can composite
// on the platform default backend at hardware speed. The old software Qt
// Quick workaround (which caused the ~77 ms per-frame web-view composite) is
// therefore no longer needed.
// setEnvVar("QT_QUICK_BACKEND", "software");

#if defined(PLATFORM_LINUX)
// Work around for Wacom Tablet issue on linux
Expand All @@ -369,6 +376,14 @@ int utf8Main(int argc, char* argv[])
// (RV Preferences/Rendering/Multithread GPU Upload)
QApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);

// Share GL resources across every QOpenGLContext in the process. This is a
// documented QtWebEngine requirement, and it lets RV's auxiliary GL
// surfaces -- the second-output ScreenView and the multithreaded-upload
// worker device -- share textures/FBOs with the main viewport context
// without an explicit, ordering-sensitive setShareContext() call. Must be
// set before the QApplication is constructed.
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

TwkUtil::MemPool::initialize();

string altPrefsPath;
Expand Down
1 change: 1 addition & 0 deletions src/lib/app/RvCommon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ SET(_sources
RvApplication.cpp
DiagnosticsView.cpp
GLView.cpp
GLWindow.cpp
TwkQTAction.cpp
MediaDirModel.cpp
RvNetworkDialog.cpp
Expand Down
12 changes: 6 additions & 6 deletions src/lib/app/RvCommon/DesktopVideoDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ namespace Rv
{
TWK_GLDEBUG;

QSurfaceFormat fmt = shareDevice()->widget()->format();
QSurfaceFormat fmt = shareDevice()->glSurfaceFormat();
fmt.setSwapInterval(m_vsync ? 1 : 0);

ScreenView* vw = new ScreenView(fmt, 0, shareDevice()->widget(), Qt::Window);
ScreenView* vw = new ScreenView(fmt, 0, shareDevice()->glShareContext(), Qt::Window);
setViewWidget(vw);

QTGLVideoDevice* vd = new QTGLVideoDevice(0, "local view", vw);
Expand Down Expand Up @@ -747,11 +747,11 @@ namespace Rv

void DesktopVideoDevice::sortVideoFormatsByWidth() { sort(m_videoFormats.begin(), m_videoFormats.end(), widthSort); }

DesktopVideoDevice::ScreenView::ScreenView(const QSurfaceFormat& fmt, QWidget* parent, QOpenGLWidget* glViewShare,
DesktopVideoDevice::ScreenView::ScreenView(const QSurfaceFormat& fmt, QWidget* parent, QOpenGLContext* glShareContext,
Qt::WindowFlags flags)
: QOpenGLWidget(parent, flags)
{
m_glViewShare = glViewShare;
m_glShareContext = glShareContext;
setFormat(fmt);

// Important: set PartialUpdate, because otherwise
Expand All @@ -764,9 +764,9 @@ namespace Rv
{
QOpenGLWidget::initializeGL();

if (m_glViewShare && context() && context()->isValid())
if (m_glShareContext && context() && context()->isValid())
{
context()->setShareContext(m_glViewShare->context());
context()->setShareContext(m_glShareContext);
}
}

Expand Down
Loading
Loading