зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1675665 - Don't draw surfaces if we're not currently presenting a frame. r=lsalzman
WR can run an update which outputs the compositor surfaces, but never calls Begin/EndFrame. Differential Revision: https://phabricator.services.mozilla.com/D96380
This commit is contained in:
Родитель
02b6bea865
Коммит
a289a86c53
|
@ -58,20 +58,31 @@ bool RenderCompositorD3D11SWGL::MakeCurrent() {
|
|||
}
|
||||
|
||||
bool RenderCompositorD3D11SWGL::BeginFrame() {
|
||||
MOZ_ASSERT(!mInFrame);
|
||||
MakeCurrent();
|
||||
IntRect rect = IntRect(IntPoint(0, 0), GetBufferSize().ToUnknownSize());
|
||||
mCompositor->BeginFrameForWindow(nsIntRegion(rect), Nothing(), rect,
|
||||
nsIntRegion());
|
||||
if (!mCompositor->BeginFrameForWindow(nsIntRegion(rect), Nothing(), rect,
|
||||
nsIntRegion())) {
|
||||
return false;
|
||||
}
|
||||
mInFrame = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void RenderCompositorD3D11SWGL::CancelFrame() {
|
||||
mFrameSurfaces.Clear();
|
||||
MOZ_ASSERT(mInFrame);
|
||||
mCompositor->CancelFrame();
|
||||
mInFrame = false;
|
||||
}
|
||||
|
||||
void RenderCompositorD3D11SWGL::CompositorEndFrame() {
|
||||
for (auto& frameSurface : mFrameSurfaces) {
|
||||
nsTArray<FrameSurface> frameSurfaces = std::move(mFrameSurfaces);
|
||||
|
||||
if (!mInFrame) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto& frameSurface : frameSurfaces) {
|
||||
auto surfaceCursor = mSurfaces.find(frameSurface.mId);
|
||||
MOZ_RELEASE_ASSERT(surfaceCursor != mSurfaces.end());
|
||||
Surface& surface = surfaceCursor->second;
|
||||
|
@ -161,11 +172,12 @@ void RenderCompositorD3D11SWGL::CompositorEndFrame() {
|
|||
}
|
||||
}
|
||||
}
|
||||
mFrameSurfaces.Clear();
|
||||
}
|
||||
|
||||
RenderedFrameId RenderCompositorD3D11SWGL::EndFrame(
|
||||
const nsTArray<DeviceIntRect>& aDirtyRects) {
|
||||
MOZ_ASSERT(mInFrame);
|
||||
mInFrame = false;
|
||||
mCompositor->EndFrame();
|
||||
return GetNextRenderFrameId();
|
||||
}
|
||||
|
|
|
@ -154,6 +154,7 @@ class RenderCompositorD3D11SWGL : public RenderCompositor {
|
|||
gfx::SamplingFilter mFilter;
|
||||
};
|
||||
nsTArray<FrameSurface> mFrameSurfaces;
|
||||
bool mInFrame = false;
|
||||
};
|
||||
|
||||
static inline bool operator==(const RenderCompositorD3D11SWGL::TileKey& a0,
|
||||
|
|
Загрузка…
Ссылка в новой задаче