@@ -97,7 +97,6 @@ bool WebRenderLayerManager::Initialize(
97
97
}
98
98
99
99
mWrChild = static_cast <WebRenderBridgeChild*>(bridge);
100
- mHasFlushedThisChild = false ;
101
100
102
101
TextureFactoryIdentifier textureFactoryIdentifier;
103
102
wr::MaybeIdNamespace idNamespace;
@@ -703,30 +702,24 @@ void WebRenderLayerManager::FlushRendering(wr::RenderReasons aReasons) {
703
702
}
704
703
MOZ_ASSERT (mWidget );
705
704
706
- // If widget bounds size is different from the last flush, consider
707
- // this to be a resize. It's important to use GetClientSize here,
708
- // because that has extra plumbing to support initial display cases
709
- // where the widget doesn't yet have real bounds.
710
- LayoutDeviceIntSize widgetSize = mWidget ->GetClientSize ();
711
- bool resizing = widgetSize != mFlushWidgetSize ;
712
- mFlushWidgetSize = widgetSize;
705
+ // If value of IsResizingNativeWidget() is nothing, we assume that resizing
706
+ // might happen.
707
+ bool resizing = mWidget && mWidget ->IsResizingNativeWidget ().valueOr (true );
713
708
714
709
if (resizing) {
715
710
aReasons = aReasons | wr::RenderReasons::RESIZE;
716
711
}
717
712
718
- // Check for the conditions where we we force a sync flush. The first
719
- // flush for this child should always be sync. Resizes should be
720
- // sometimes be sync. Everything else can be async.
721
- if (! mHasFlushedThisChild ||
722
- (resizing && (mWidget ->SynchronouslyRepaintOnResize () ||
723
- StaticPrefs::layers_force_synchronous_resize ()) )) {
713
+ // Limit async FlushRendering to !resizing and Win DComp.
714
+ // XXX relax the limitation
715
+ if ( WrBridge ()-> GetCompositorUseDComp () && !resizing) {
716
+ cBridge-> SendFlushRenderingAsync (aReasons);
717
+ } else if (mWidget ->SynchronouslyRepaintOnResize () ||
718
+ StaticPrefs::layers_force_synchronous_resize ()) {
724
719
cBridge->SendFlushRendering (aReasons);
725
720
} else {
726
721
cBridge->SendFlushRenderingAsync (aReasons);
727
722
}
728
-
729
- mHasFlushedThisChild = true ;
730
723
}
731
724
732
725
void WebRenderLayerManager::WaitOnTransactionProcessed () {
0 commit comments