Bug 1469528 - Flush the clip push/pop draw commands so they don't end up in the wrong entry. r?jrmuizel
MozReview-Commit-ID: 7PVPxaF2RnK
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -748,29 +748,31 @@ Grouper::PaintContainerItem(DIGroup* aGr
switch (aItem->GetType()) {
case DisplayItemType::TYPE_TRANSFORM: {
DisplayItemClip currentClip = aItem->GetClip();
gfx::Matrix matrix;
if (currentClip.HasClip()) {
aContext->Save();
currentClip.ApplyTo(aContext, this->mAppUnitsPerDevPixel);
+ aContext->GetDrawTarget()->FlushItem(aItemBounds);
} else {
matrix = aContext->CurrentMatrix();
}
auto transformItem = static_cast<nsDisplayTransform*>(aItem);
Matrix4x4Flagged trans = transformItem->GetTransform();
Matrix trans2d;
MOZ_RELEASE_ASSERT(trans.Is2D(&trans2d));
aContext->Multiply(ThebesMatrix(trans2d));
aGroup->PaintItemRange(this, aChildren->GetBottom(), nullptr, aContext, aRecorder);
if (currentClip.HasClip()) {
aContext->Restore();
+ aContext->GetDrawTarget()->FlushItem(aItemBounds);
} else {
aContext->SetMatrix(matrix);
}
break;
}
case DisplayItemType::TYPE_OPACITY: {
auto opacityItem = static_cast<nsDisplayOpacity*>(aItem);
float opacity = opacityItem->GetOpacity();