Bug 1486958 - Sync FlushRendering() only during resizing on windows r=mattwoodrow

This commit is contained in:
sotaro 2018-09-14 17:13:55 +09:00
Родитель 82b98972c8
Коммит 24c5a93279
4 изменённых файлов: 21 добавлений и 2 удалений

Просмотреть файл

@ -637,8 +637,12 @@ WebRenderLayerManager::FlushRendering()
}
MOZ_ASSERT(mWidget);
// When DirectComposition and compositor window are used, we do not need to do sync FlushRendering.
if (WrBridge()->GetCompositorUseDComp()) {
// If value of IsResizingNativeWidget() is nothing, we assume that resizing might happen.
bool resizing = mWidget && mWidget->IsResizingNativeWidget().valueOr(true);
// Limit async FlushRendering to !resizing and Win DComp.
// XXX relax the limitation
if (WrBridge()->GetCompositorUseDComp() && !resizing) {
cBridge->SendFlushRenderingAsync();
} else if (mWidget->SynchronouslyRepaintOnResize() || gfxPrefs::LayersForceSynchronousResize()) {
cBridge->SendFlushRendering();

Просмотреть файл

@ -778,6 +778,11 @@ class nsIWidget : public nsISupports
double aHeight,
bool aRepaint) = 0;
virtual mozilla::Maybe<bool> IsResizingNativeWidget()
{
return mozilla::Nothing();
}
/**
* Resize the widget so that the inner client area has the given size.
*

Просмотреть файл

@ -1988,6 +1988,15 @@ nsWindow::Resize(double aX, double aY, double aWidth,
NotifyRollupGeometryChange();
}
mozilla::Maybe<bool>
nsWindow::IsResizingNativeWidget()
{
if (mResizeState == RESIZING) {
return Some(true);
}
return Some(false);
}
nsresult
nsWindow::BeginResizeDrag(WidgetGUIEvent* aEvent,
int32_t aHorizontal,

Просмотреть файл

@ -131,6 +131,7 @@ public:
virtual void Move(double aX, double aY) override;
virtual void Resize(double aWidth, double aHeight, bool aRepaint) override;
virtual void Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
virtual mozilla::Maybe<bool> IsResizingNativeWidget() override;
virtual MOZ_MUST_USE nsresult
BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent,
int32_t aHorizontal,