diff options
-rw-r--r-- | src/core/ozone/surface_factory_qt.cpp | 12 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp index 4a2006a2d..04e6ec28f 100644 --- a/src/core/ozone/surface_factory_qt.cpp +++ b/src/core/ozone/surface_factory_qt.cpp @@ -92,7 +92,8 @@ scoped_refptr<gfx::NativePixmap> SurfaceFactoryQt::CreateNativePixmap( gfx::BufferUsage usage, absl::optional<gfx::Size> framebuffer_size) { - Q_ASSERT(SupportsNativePixmaps()); + if (!SupportsNativePixmaps()) + return nullptr; #if QT_CONFIG(opengl) if (framebuffer_size && !gfx::Rect(size).Contains(gfx::Rect(*framebuffer_size))) @@ -141,7 +142,11 @@ void SurfaceFactoryQt::CreateNativePixmapAsync( gfx::BufferUsage usage, NativePixmapCallback callback) { - Q_ASSERT(SupportsNativePixmaps()); + if (!SupportsNativePixmaps()) { + std::move(callback).Run(nullptr); + return; + } + // CreateNativePixmap is non-blocking operation. Thus, it is safe to call it // and return the result with the provided callback. std::move(callback).Run(CreateNativePixmap(widget, device_queue, size, format, usage)); @@ -154,7 +159,8 @@ SurfaceFactoryQt::CreateNativePixmapFromHandle( gfx::BufferFormat format, gfx::NativePixmapHandle handle) { - Q_ASSERT(SupportsNativePixmaps()); + if (!SupportsNativePixmaps()) + return nullptr; #if QT_CONFIG(opengl) gfx::NativePixmapHandle bufferHandle; diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 2017fa80c..faf9bd542 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -927,8 +927,10 @@ WebEngineContext::WebEngineContext() } #if defined(USE_OZONE) - if (GPUInfo::instance()->vendor() == GPUInfo::Nvidia) + if (GPUInfo::instance()->vendor() == GPUInfo::Nvidia) { disableFeatures.push_back(media::kVaapiVideoDecodeLinux.name); + parsedCommandLine->AppendSwitch(switches::kDisableGpuMemoryBufferVideoFrames); + } #if QT_CONFIG(webengine_vulkan) if (QQuickWindow::graphicsApi() == QSGRendererInterface::Vulkan) { |