Bug 1239137 - Return early from BasicCompositor::DrawQuad if transformBounds is empty. r=mattwoodrow

This commit is contained in:
Markus Stange 2016-01-13 00:13:20 +01:00
parent ef6a3d9855
commit 1d0822d24b

View File

@ -352,7 +352,6 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
// |dest| is a temporary surface.
RefPtr<DrawTarget> dest = buffer;
buffer->PushClipRect(aClipRect);
AutoRestoreTransform autoRestoreTransform(dest);
Matrix newTransform;
@ -375,6 +374,10 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
transformBounds = aTransform.TransformAndClipBounds(aRect, Rect(offset.x, offset.y, buffer->GetSize().width, buffer->GetSize().height));
transformBounds.RoundOut();
if (transformBounds.IsEmpty()) {
return;
}
// Propagate the coordinate offset to our 2D draw target.
newTransform = Matrix::Translation(transformBounds.x, transformBounds.y);
@ -383,6 +386,8 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
new3DTransform = Matrix4x4::Translation(aRect.x, aRect.y, 0) * aTransform;
}
buffer->PushClipRect(aClipRect);
newTransform.PostTranslate(-offset.x, -offset.y);
buffer->SetTransform(newTransform);