Bug 1238753 - Don't skip the call to StartRemoteDrawing in from BasicCompositor::BeginFrame if the invalid region is empty. r=mattwoodrow

Sometimes we need a composition even if nothing has changed, for example for window resizes on Mac.
LayerManagerComposite::UpdateAndRender() already has a check that skips the call to BasicCompositor
if it's not necessary.

--HG--
extra : commitid : EFN68WKwWyp
extra : rebase_source : 00d8b063d23500b72a7f0c5fb03f5b726a3d5ac9
This commit is contained in:
Markus Stange 2016-01-12 13:27:14 +01:00
parent 4739df03c1
commit ebf52b3a75

View File

@ -537,10 +537,6 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
*aRenderBoundsOut = Rect();
}
if (mInvalidRect.width <= 0 || mInvalidRect.height <= 0) {
return;
}
if (mTarget) {
// If we have a copy target, then we don't have a widget-provided mDrawTarget (currently). Use a dummy
// placeholder so that CreateRenderTarget() works.
@ -549,8 +545,13 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
// StartRemoteDrawingInRegion can mutate mInvalidRegion.
mDrawTarget = mWidget->StartRemoteDrawingInRegion(mInvalidRegion);
mInvalidRect = mInvalidRegion.GetBounds();
if (mInvalidRect.IsEmpty()) {
mWidget->EndRemoteDrawingInRegion(mDrawTarget, mInvalidRegion);
return;
}
}
if (!mDrawTarget) {
if (!mDrawTarget || mInvalidRect.IsEmpty()) {
return;
}