Bug 791434 - Paint text shadows with the right alpha. r=roc

This commit is contained in:
Cameron McCormack 2012-09-18 08:24:02 +10:00
parent 6e0935558d
commit c07488a294
6 changed files with 24 additions and 3 deletions

View File

@ -5319,7 +5319,7 @@ nsTextFrame::PaintOneShadow(uint32_t aOffset, uint32_t aLength,
}
aCtx->Save();
aCtx->NewPath();
aCtx->NewPath();
aCtx->SetColor(gfxRGBA(shadowColor));
// Draw the text onto our alpha-only surface to capture the alpha values.
@ -5330,8 +5330,10 @@ nsTextFrame::PaintOneShadow(uint32_t aOffset, uint32_t aLength,
aDirtyRect.width, aDirtyRect.height);
DrawText(shadowContext, dirtyRect, aFramePt + shadowOffset,
aTextBaselinePt + shadowOffset, aOffset, aLength, *aProvider,
nsTextPaintStyle(this), shadowColor, aClipEdges, advanceWidth,
(GetStateBits() & TEXT_HYPHEN_BREAK) != 0, decorationOverrideColor);
nsTextPaintStyle(this),
aCtx == shadowContext ? shadowColor : NS_RGB(0, 0, 0), aClipEdges,
advanceWidth, (GetStateBits() & TEXT_HYPHEN_BREAK) != 0,
decorationOverrideColor);
contextBoxBlur.DoPaint();
aCtx->Restore();

View File

@ -0,0 +1,2 @@
<div style="position: absolute; top: 33px; left: 33px; color: rgba(0, 0, 255, 0.2); z-index: 0;">Hello</div>
<div style="position: absolute; top: 30px; left: 30px; color: green; z-index: 1;">Hello</div>

View File

@ -0,0 +1 @@
<div style="position: absolute; top: 30px; left: 30px; color: green; text-shadow: rgba(0, 0, 255, 0.2) 3px 3px;">Hello</div>

View File

@ -0,0 +1,7 @@
<style>
@font-face {
font-family: Ahem;
src: url(../fonts/Ahem.ttf);
}
</style>
<div style="font: 16px Ahem; color: transparent; text-shadow: blue 4px 4px 2px; opacity: 0.5">a</div>

View File

@ -0,0 +1,7 @@
<style>
@font-face {
font-family: Ahem;
src: url(../fonts/Ahem.ttf);
}
</style>
<div style="font: 16px Ahem; color: transparent; text-shadow: rgba(0, 0, 255, 0.5) 4px 4px 2px">a</div>

View File

@ -3,9 +3,11 @@ random-if(Android) == basic-negcoord.xul basic-negcoord-ref.xul
!= blur.xul blur-notref.xul
== color-inherit.xul color-inherit-ref.xul
== multiple-noblur.xul multiple-noblur-ref.xul
fuzzy(1,488) HTTP(..) == blur-opacity.html blur-opacity-ref.html
== basic.html basic-ref.html
== basic-negcoord.html basic-negcoord-ref.html
== basic-opacity.html basic-opacity-ref.html
!= blur.html blur-notref.html
== color-inherit.html color-inherit-ref.html
== color-parserorder.html color-parserorder-ref.html