summaryrefslogtreecommitdiffstats
path: root/gfx/layers/wr/WebRenderLayerManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gfx/layers/wr/WebRenderLayerManager.cpp25
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() {