Bug 1592026 - Move NativeLayerRoot::CommitToScreen call from PostRender into the compositors. r=jrmuizel

This makes it more similar to how SwapBuffers was used.
This patch also makes us call glFlush directly when using native layers, rather than going through the misleadingly-named GLContext::SwapBuffers method.

Differential Revision: https://phabricator.services.mozilla.com/D57062

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-12-29 12:41:04 +00:00
Родитель c96a136f94
Коммит 239125933c
3 изменённых файлов: 14 добавлений и 6 удалений

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

@ -1296,6 +1296,10 @@ bool LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion,
AUTO_PROFILER_LABEL("LayerManagerComposite::Render:EndFrame", GRAPHICS);
mCompositor->EndFrame();
if (usingNativeLayers) {
mNativeLayerRoot->CommitToScreen();
}
}
mCompositor->GetWidget()->PostRender(&widgetContext);

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

@ -119,10 +119,16 @@ RenderedFrameId RenderCompositorOGL::EndFrame(
const FfiVec<DeviceIntRect>& aDirtyRects) {
RenderedFrameId frameId = GetNextRenderFrameId();
InsertFrameDoneSync();
mGL->SwapBuffers();
if (!mNativeLayerRoot) {
mGL->SwapBuffers();
return frameId;
}
if (mNativeLayerForEntireWindow) {
mGL->fFlush();
mNativeLayerForEntireWindow->NotifySurfaceReady();
mNativeLayerRoot->CommitToScreen();
}
return frameId;
@ -208,6 +214,8 @@ void RenderCompositorOGL::CompositorEndFrame() {
mDrawnPixelCount = 0;
mNativeLayerRoot->SetLayers(mAddedLayers);
mGL->fFlush();
mNativeLayerRoot->CommitToScreen();
mSurfacePoolHandle->OnEndFrame();
}

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

@ -1708,11 +1708,7 @@ bool nsChildView::PreRender(WidgetRenderingContext* aContext) {
return true;
}
void nsChildView::PostRender(WidgetRenderingContext* aContext) {
mNativeLayerRoot->CommitToScreen();
mViewTearDownLock.Unlock();
}
void nsChildView::PostRender(WidgetRenderingContext* aContext) { mViewTearDownLock.Unlock(); }
RefPtr<layers::NativeLayerRoot> nsChildView::GetNativeLayerRoot() { return mNativeLayerRoot; }