Backed out changeset 2c4c38e037f0 (bug 1715803) for causing crashtest failures in 1513133.html

CLOSED TREE
This commit is contained in:
Marian-Vasile Laza 2021-06-15 09:06:59 +03:00
parent d8a751025a
commit ad6029d91d
4 changed files with 9 additions and 76 deletions

View File

@ -6213,7 +6213,6 @@ void nsDisplayBlendMode::Paint(nsDisplayListBuilder* aBuilder,
gfxContext* aCtx) {
// This should be switched to use PushLayerWithBlend, once it's
// been implemented for all DrawTarget backends.
DrawTarget* dt = aCtx->GetDrawTarget();
int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
IntRect rect =
IntRect::RoundOut(NSRectToRect(GetPaintRect(), appUnitsPerDevPixel));
@ -6221,38 +6220,23 @@ void nsDisplayBlendMode::Paint(nsDisplayListBuilder* aBuilder,
return;
}
// Compute the device space rect that we'll draw to, and allocate
// a temporary draw target of that size.
Rect deviceRect = dt->GetTransform().TransformBounds(Rect(rect));
deviceRect = deviceRect.Intersect(Rect(Point(), Size(dt->GetSize())));
deviceRect.RoundOut();
IntRect deviceIntRect;
deviceRect.ToIntRect(&deviceIntRect);
RefPtr<DrawTarget> temp = dt->CreateSimilarDrawTarget(
deviceIntRect.Size(), SurfaceFormat::B8G8R8A8);
RefPtr<DrawTarget> dt = aCtx->GetDrawTarget()->CreateSimilarDrawTarget(
rect.Size(), SurfaceFormat::B8G8R8A8);
if (!dt) {
return;
}
// Copy the transform across to the temporary DT so that we
// draw in device space.
temp->SetTransform(dt->GetTransform() *
Matrix::Translation(-deviceRect.x, -deviceRect.y));
RefPtr<gfxContext> ctx = gfxContext::CreatePreservingTransformOrNull(temp);
dt->SetTransform(Matrix::Translation(-rect.x, -rect.y));
RefPtr<gfxContext> ctx = gfxContext::CreatePreservingTransformOrNull(dt);
GetChildren()->Paint(aBuilder, ctx,
mFrame->PresContext()->AppUnitsPerDevPixel());
// Draw the temporary DT to the real destination, applying the blend mode, but
// no transform.
temp->Flush();
RefPtr<SourceSurface> surface = temp->Snapshot();
gfxContextMatrixAutoSaveRestore saveMatrix(aCtx);
dt->SetTransform(Matrix());
dt->DrawSurface(
surface, deviceRect, Rect(Point(), deviceRect.Size()),
DrawSurfaceOptions(),
dt->Flush();
RefPtr<SourceSurface> surface = dt->Snapshot();
aCtx->GetDrawTarget()->DrawSurface(
surface, Rect(rect.x, rect.y, rect.width, rect.height),
Rect(0, 0, rect.width, rect.height), DrawSurfaceOptions(),
DrawOptions(1.0f, nsCSSRendering::GetGFXBlendMode(mBlendMode)));
}

View File

@ -109,7 +109,6 @@ fuzzy-if(skiaContent,0-2,0-5) == stresstest-1.html stresstest-1-ref.html
== scale-1a.html scale-1-ref.html
== scale-1b.html scale-1-ref.html
== scale-percent-1.html scale-percent-1-ref.html
== scaled-blend-mode.html scaled-blend-mode-ref.html
# Some simple checks that it obeys selector operations
== descendant-1.html descendant-1-ref.html
== propagate-inherit-boolean.html propagate-inherit-boolean-ref.html

View File

@ -1,25 +0,0 @@
<html>
<head>
<style>
body { margin: 0px; }
div {
width: 200px;
height: 200px;
}
#scale {
transform: scale(2);
transform-origin: top left;
}
#blend {
mix-blend-mode: multiply;
}
</style>
</head>
<body>
<div id="blend">
<div id="scale">
Hello
</div>
</div>
</body>
</html>

View File

@ -1,25 +0,0 @@
<html>
<head>
<style>
body { margin: 0px; }
div {
width: 200px;
height: 200px;
}
#scale {
transform: scale(2);
transform-origin: top left;
}
#blend {
mix-blend-mode: multiply;
}
</style>
</head>
<body>
<div id="scale">
<div id="blend">
Hello
</div>
</div>
</body>
</html>