diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /gfx/layers/wr/WebRenderLayerManager.cpp | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/wr/WebRenderLayerManager.cpp')
-rw-r--r-- | gfx/layers/wr/WebRenderLayerManager.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/gfx/layers/wr/WebRenderLayerManager.cpp b/gfx/layers/wr/WebRenderLayerManager.cpp index 66b98a7db3..c29517c696 100644 --- a/gfx/layers/wr/WebRenderLayerManager.cpp +++ b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -96,6 +96,7 @@ bool WebRenderLayerManager::Initialize( } mWrChild = static_cast<WebRenderBridgeChild*>(bridge); + mHasFlushedThisChild = false; TextureFactoryIdentifier textureFactoryIdentifier; wr::MaybeIdNamespace idNamespace; @@ -694,24 +695,30 @@ void WebRenderLayerManager::FlushRendering(wr::RenderReasons aReasons) { } MOZ_ASSERT(mWidget); - // If value of IsResizingNativeWidget() is nothing, we assume that resizing - // might happen. - bool resizing = mWidget && mWidget->IsResizingNativeWidget().valueOr(true); + // If widget bounds size is different from the last flush, consider + // this to be a resize. It's important to use GetClientSize here, + // because that has extra plumbing to support initial display cases + // where the widget doesn't yet have real bounds. + LayoutDeviceIntSize widgetSize = mWidget->GetClientSize(); + bool resizing = widgetSize != mFlushWidgetSize; + mFlushWidgetSize = widgetSize; if (resizing) { aReasons = aReasons | wr::RenderReasons::RESIZE; } - // Limit async FlushRendering to !resizing and Win DComp. - // XXX relax the limitation - if (WrBridge()->GetCompositorUseDComp() && !resizing) { - cBridge->SendFlushRenderingAsync(aReasons); - } else if (mWidget->SynchronouslyRepaintOnResize() || - StaticPrefs::layers_force_synchronous_resize()) { + // Check for the conditions where we we force a sync flush. The first + // flush for this child should always be sync. Resizes should be + // sometimes be sync. Everything else can be async. + if (!mHasFlushedThisChild || + (resizing && (mWidget->SynchronouslyRepaintOnResize() || + StaticPrefs::layers_force_synchronous_resize()))) { cBridge->SendFlushRendering(aReasons); } else { cBridge->SendFlushRenderingAsync(aReasons); } + + mHasFlushedThisChild = true; } void WebRenderLayerManager::WaitOnTransactionProcessed() { |