diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /gfx/layers/wr/WebRenderLayerManager.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 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() { |