зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1395098 - Apply folded alpha to text when using advanced layers r=jrmuizel
MozReview-Commit-ID: 6crHThEP6Ha --HG-- extra : rebase_source : 9dd0c286b400b22803b1a52ac0822738ef17d904
This commit is contained in:
Родитель
8ceb4d1ed5
Коммит
bfdaac7f5c
|
@ -5268,8 +5268,14 @@ nsDisplayText::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder
|
|||
}
|
||||
|
||||
for (const mozilla::layout::TextRunFragment& text: mTextDrawer->GetText()) {
|
||||
// mOpacity is set after we do our analysis, so we need to apply it here.
|
||||
// mOpacity is only non-trivial when we have "pure" text, so we don't
|
||||
// ever need to apply it to shadows or decorations.
|
||||
auto color = text.color;
|
||||
color.a *= mOpacity;
|
||||
|
||||
aManager->WrBridge()->PushGlyphs(aBuilder, text.glyphs, text.font,
|
||||
text.color, aSc, boundsRect, clipRect);
|
||||
color, aSc, boundsRect, clipRect);
|
||||
}
|
||||
|
||||
for (const wr::Line& decoration: mTextDrawer->GetAfterDecorations()) {
|
||||
|
@ -5315,7 +5321,11 @@ nsDisplayText::BuildLayer(nsDisplayListBuilder* aBuilder,
|
|||
|
||||
GlyphArray* glyphs = allGlyphs.AppendElement();
|
||||
glyphs->glyphs() = text.glyphs;
|
||||
glyphs->color() = text.color;
|
||||
|
||||
// Apply folded alpha (only applies to glyphs)
|
||||
auto color = text.color;
|
||||
color.a *= mOpacity;
|
||||
glyphs->color() = color;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(font);
|
||||
|
|
Загрузка…
Ссылка в новой задаче