Bug 1421888 - Don't apply highlight-painted-layers or paint-flashing fills when drawing mask surfaces. r?ethlin
MozReview-Commit-ID: GfRkuBDly6f
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -441,26 +441,31 @@ PaintItemByDrawTarget(nsDisplayItem* aIt
default:
context->SetMatrix(context->CurrentMatrix().PreScale(aScale.width, aScale.height).PreTranslate(-aOffset.x, -aOffset.y));
aItem->Paint(aDisplayListBuilder, context);
isInvalidated = true;
break;
}
- if (aHighlight) {
- aDT->SetTransform(gfx::Matrix());
- aDT->FillRect(gfx::Rect(0, 0, aImageRect.Width(), aImageRect.Height()), gfx::ColorPattern(aHighlight.value()));
- }
- if (aItem->Frame()->PresContext()->GetPaintFlashing() && isInvalidated) {
- aDT->SetTransform(gfx::Matrix());
- float r = float(rand()) / RAND_MAX;
- float g = float(rand()) / RAND_MAX;
- float b = float(rand()) / RAND_MAX;
- aDT->FillRect(gfx::Rect(0, 0, aImageRect.Width(), aImageRect.Height()), gfx::ColorPattern(gfx::Color(r, g, b, 0.5)));
+ if (aItem->GetType() != DisplayItemType::TYPE_MASK) {
+ // Apply highlight fills, if the appropriate prefs are set.
+ // We don't do this for masks because we'd be filling the A8 mask surface,
+ // which isn't very useful.
+ if (aHighlight) {
+ aDT->SetTransform(gfx::Matrix());
+ aDT->FillRect(gfx::Rect(0, 0, aImageRect.Width(), aImageRect.Height()), gfx::ColorPattern(aHighlight.value()));
+ }
+ if (aItem->Frame()->PresContext()->GetPaintFlashing() && isInvalidated) {
+ aDT->SetTransform(gfx::Matrix());
+ float r = float(rand()) / RAND_MAX;
+ float g = float(rand()) / RAND_MAX;
+ float b = float(rand()) / RAND_MAX;
+ aDT->FillRect(gfx::Rect(0, 0, aImageRect.Width(), aImageRect.Height()), gfx::ColorPattern(gfx::Color(r, g, b, 0.5)));
+ }
}
return isInvalidated;
}
already_AddRefed<WebRenderFallbackData>
WebRenderCommandBuilder::GenerateFallbackData(nsDisplayItem* aItem,
wr::DisplayListBuilder& aBuilder,