mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 1414154 - Remove gfxContext::Set/GetFontSmoothingBackgroundColor and TextRunDrawParams::fontSmoothingBGColor. r=lsalzman
MozReview-Commit-ID: BXZP3maOJRi --HG-- extra : rebase_source : 5ba8b50835d98f78cdf854d914d61f5508edf6e3
This commit is contained in:
parent
78303f13ce
commit
06a44912a5
@ -751,19 +751,6 @@ gfxContext::GetPattern()
|
||||
return pat.forget();
|
||||
}
|
||||
|
||||
void
|
||||
gfxContext::SetFontSmoothingBackgroundColor(const Color& aColor)
|
||||
{
|
||||
CURRENTSTATE_CHANGED()
|
||||
CurrentState().fontSmoothingBackgroundColor = aColor;
|
||||
}
|
||||
|
||||
Color
|
||||
gfxContext::GetFontSmoothingBackgroundColor()
|
||||
{
|
||||
return CurrentState().fontSmoothingBackgroundColor;
|
||||
}
|
||||
|
||||
// masking
|
||||
void
|
||||
gfxContext::Mask(SourceSurface* aSurface, Float aAlpha, const Matrix& aTransform)
|
||||
|
@ -281,13 +281,6 @@ public:
|
||||
*/
|
||||
void SetPattern(gfxPattern *pattern);
|
||||
|
||||
/**
|
||||
* Set the color that text drawn on top of transparent pixels should be
|
||||
* anti-aliased into.
|
||||
*/
|
||||
void SetFontSmoothingBackgroundColor(const mozilla::gfx::Color& aColor);
|
||||
mozilla::gfx::Color GetFontSmoothingBackgroundColor();
|
||||
|
||||
/**
|
||||
* Get the source pattern (solid color, normal pattern, surface, etc)
|
||||
*/
|
||||
|
@ -2298,7 +2298,6 @@ struct MOZ_STACK_CLASS TextRunDrawParams {
|
||||
gfxFont::Spacing *spacing;
|
||||
gfxTextRunDrawCallbacks *callbacks;
|
||||
mozilla::SVGContextPaint *runContextPaint;
|
||||
mozilla::gfx::Color fontSmoothingBGColor;
|
||||
mozilla::gfx::Float direction;
|
||||
double devPerApp;
|
||||
nscolor textStrokeColor;
|
||||
|
@ -679,8 +679,6 @@ gfxTextRun::Draw(Range aRange, gfx::Point aPt, const DrawParams& aParams) const
|
||||
params.paintSVGGlyphs = !aParams.callbacks ||
|
||||
aParams.callbacks->mShouldPaintSVGGlyphs;
|
||||
params.dt = aParams.context->GetDrawTarget();
|
||||
params.fontSmoothingBGColor =
|
||||
aParams.context->GetFontSmoothingBackgroundColor();
|
||||
|
||||
GlyphRunIterator iter(this, aRange);
|
||||
gfxFloat advance = 0.0;
|
||||
|
@ -7092,10 +7092,7 @@ nsTextFrame::PaintText(const PaintTextParams& aParams,
|
||||
params.drawSoftHyphen = (GetStateBits() & TEXT_HYPHEN_BREAK) != 0;
|
||||
params.contextPaint = aParams.contextPaint;
|
||||
params.callbacks = aParams.callbacks;
|
||||
aParams.context->SetFontSmoothingBackgroundColor(
|
||||
Color::FromABGR(StyleFont()->mFont.fontSmoothingBackgroundColor));
|
||||
DrawText(range, textBaselinePt, params);
|
||||
aParams.context->SetFontSmoothingBackgroundColor(Color());
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -526,8 +526,6 @@ nsTextBoxFrame::DrawText(gfxContext& aRenderingContext,
|
||||
nscolor c = aOverrideColor ? *aOverrideColor : StyleColor()->mColor;
|
||||
ColorPattern color(ToDeviceColor(c));
|
||||
aRenderingContext.SetColor(Color::FromABGR(c));
|
||||
aRenderingContext.SetFontSmoothingBackgroundColor(
|
||||
Color::FromABGR(StyleFont()->mFont.fontSmoothingBackgroundColor));
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
@ -599,8 +597,6 @@ nsTextBoxFrame::DrawText(gfxContext& aRenderingContext,
|
||||
params.style = strikeStyle;
|
||||
nsCSSRendering::PaintDecorationLine(this, *drawTarget, params);
|
||||
}
|
||||
|
||||
aRenderingContext.SetFontSmoothingBackgroundColor(Color());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3061,10 +3061,6 @@ nsTreeBodyFrame::PaintRow(int32_t aRowIndex,
|
||||
theme = aPresContext->GetTheme();
|
||||
}
|
||||
|
||||
// Save the current font smoothing background color in case we change it.
|
||||
Color originalColor(aRenderingContext.GetFontSmoothingBackgroundColor());
|
||||
aRenderingContext.SetFontSmoothingBackgroundColor(
|
||||
ToDeviceColor(rowContext->StyleFont()->mFont.fontSmoothingBackgroundColor));
|
||||
if (theme && theme->ThemeSupportsWidget(aPresContext, nullptr, appearance)) {
|
||||
nsRect dirty;
|
||||
dirty.IntersectRect(rowRect, aDirtyRect);
|
||||
@ -3174,11 +3170,6 @@ nsTreeBodyFrame::PaintRow(int32_t aRowIndex,
|
||||
}
|
||||
}
|
||||
}
|
||||
// If we've changed the font smoothing background color for this row, restore
|
||||
// the color to the original one.
|
||||
if (originalColor != aRenderingContext.GetFontSmoothingBackgroundColor()) {
|
||||
aRenderingContext.SetFontSmoothingBackgroundColor(originalColor);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user