Bug 1269971 - Part 2. From ClipBackgroundByText to GenerateAndPushTextMask; r=jfkthame,mtseng

MozReview-Commit-ID: 1PK2Huytq3i
This commit is contained in:
CJKu
2016-05-13 00:08:41 +08:00
parent 17721f6781
commit b5b879d00c
3 changed files with 52 additions and 24 deletions

View File

@@ -4798,10 +4798,7 @@ nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
params.dirtyRect = extraVisible;
nsTextFrame::DrawPathCallbacks callbacks;
if (aBuilder->IsForGenerateGlyphMask()) {
params.callbacks = &callbacks;
}
params.generateTextMask = aBuilder->IsForGenerateGlyphMask();
f->PaintText(params, *this, mOpacity);
}
@@ -6595,7 +6592,9 @@ nsTextFrame::PaintText(const PaintTextParams& aParams,
}
}
nscolor foregroundColor = textPaintStyle.GetTextColor();
nscolor foregroundColor = aParams.generateTextMask
? NS_RGBA(0, 0, 0, 255)
: textPaintStyle.GetTextColor();
if (aOpacity != 1.0f) {
gfx::Color gfxColor = gfx::Color::FromABGR(foregroundColor);
gfxColor.a *= aOpacity;