Bug 1238753 - Make BasicCompositor respect changes to mInvalidRegion through StartRemoteDrawingWithRegion properly. r=mattwoodrow

This commit is contained in:
Markus Stange 2016-01-12 13:14:42 +01:00
parent cd0059027e
commit 19ea6087bc

View File

@ -530,9 +530,8 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
invalidRegionSafe.And(aInvalidRegion, intRect);
}
IntRect invalidRect = invalidRegionSafe.GetBounds();
mInvalidRect = IntRect(invalidRect.x, invalidRect.y, invalidRect.width, invalidRect.height);
mInvalidRegion = invalidRegionSafe;
mInvalidRect = mInvalidRegion.GetBounds();
if (aRenderBoundsOut) {
*aRenderBoundsOut = Rect();
@ -547,7 +546,9 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
// placeholder so that CreateRenderTarget() works.
mDrawTarget = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget();
} else {
// StartRemoteDrawingInRegion can mutate mInvalidRegion.
mDrawTarget = mWidget->StartRemoteDrawingInRegion(mInvalidRegion);
mInvalidRect = mInvalidRegion.GetBounds();
}
if (!mDrawTarget) {
return;
@ -566,10 +567,10 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
// We only allocate a surface sized to the invalidated region, so we need to
// translate future coordinates.
mRenderTarget->mDrawTarget->SetTransform(Matrix::Translation(-invalidRect.x,
-invalidRect.y));
mRenderTarget->mDrawTarget->SetTransform(Matrix::Translation(-mInvalidRect.x,
-mInvalidRect.y));
gfxUtils::ClipToRegion(mRenderTarget->mDrawTarget, invalidRegionSafe);
gfxUtils::ClipToRegion(mRenderTarget->mDrawTarget, mInvalidRegion);
if (aRenderBoundsOut) {
*aRenderBoundsOut = rect;