mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1229202 (part 3) - Make gfxContextAutoDisableSubpixelAntialiasing take a DrawTarget instead of a gfxContext. r=mattwoodrow.
This commit is contained in:
parent
386f2f87f8
commit
5169a5a9d8
@ -660,17 +660,19 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class gfxContextAutoDisableSubpixelAntialiasing {
|
||||
class DrawTargetAutoDisableSubpixelAntialiasing {
|
||||
public:
|
||||
gfxContextAutoDisableSubpixelAntialiasing(gfxContext *aContext, bool aDisable)
|
||||
typedef mozilla::gfx::DrawTarget DrawTarget;
|
||||
|
||||
DrawTargetAutoDisableSubpixelAntialiasing(DrawTarget *aDT, bool aDisable)
|
||||
{
|
||||
if (aDisable) {
|
||||
mDT = aContext->GetDrawTarget();
|
||||
mDT = aDT;
|
||||
mSubpixelAntialiasingEnabled = mDT->GetPermitSubpixelAA();
|
||||
mDT->SetPermitSubpixelAA(false);
|
||||
}
|
||||
}
|
||||
~gfxContextAutoDisableSubpixelAntialiasing()
|
||||
~DrawTargetAutoDisableSubpixelAntialiasing()
|
||||
{
|
||||
if (mDT) {
|
||||
mDT->SetPermitSubpixelAA(mSubpixelAntialiasingEnabled);
|
||||
@ -678,7 +680,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<mozilla::gfx::DrawTarget> mDT;
|
||||
RefPtr<DrawTarget> mDT;
|
||||
bool mSubpixelAntialiasingEnabled;
|
||||
};
|
||||
|
||||
|
@ -626,7 +626,8 @@ nsPageFrame::PaintHeaderFooter(nsRenderingContext& aRenderingContext,
|
||||
nsRect rect(aPt, mRect.Size());
|
||||
aRenderingContext.ThebesContext()->SetColor(Color(0.f, 0.f, 0.f));
|
||||
|
||||
gfxContextAutoDisableSubpixelAntialiasing disable(aRenderingContext.ThebesContext(), aDisableSubpixelAA);
|
||||
DrawTargetAutoDisableSubpixelAntialiasing
|
||||
disable(aRenderingContext.GetDrawTarget(), aDisableSubpixelAA);
|
||||
|
||||
// Get the FontMetrics to determine width.height of strings
|
||||
RefPtr<nsFontMetrics> fontMet;
|
||||
|
@ -4790,9 +4790,9 @@ nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
|
||||
extraVisible.Inflate(appUnitsPerDevPixel, appUnitsPerDevPixel);
|
||||
nsTextFrame* f = static_cast<nsTextFrame*>(mFrame);
|
||||
|
||||
gfxContext* ctx = aCtx->ThebesContext();
|
||||
gfxContextAutoDisableSubpixelAntialiasing disable(ctx,
|
||||
DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
|
||||
mDisableSubpixelAA);
|
||||
gfxContext* ctx = aCtx->ThebesContext();
|
||||
gfxContextAutoSaveRestore save(ctx);
|
||||
|
||||
gfxRect pixelVisible =
|
||||
|
@ -3211,10 +3211,8 @@ void
|
||||
nsDisplaySVGText::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx)
|
||||
{
|
||||
gfxContext* ctx = aCtx->ThebesContext();
|
||||
|
||||
gfxContextAutoDisableSubpixelAntialiasing
|
||||
disable(ctx, mDisableSubpixelAA);
|
||||
DrawTargetAutoDisableSubpixelAntialiasing
|
||||
disable(aCtx->GetDrawTarget(), mDisableSubpixelAA);
|
||||
|
||||
uint32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
|
||||
@ -3229,6 +3227,7 @@ nsDisplaySVGText::Paint(nsDisplayListBuilder* aBuilder,
|
||||
gfxMatrix tm = nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(mFrame) *
|
||||
gfxMatrix::Translation(devPixelOffset);
|
||||
|
||||
gfxContext* ctx = aCtx->ThebesContext();
|
||||
ctx->Save();
|
||||
static_cast<SVGTextFrame*>(mFrame)->PaintSVG(*ctx, tm);
|
||||
ctx->Restore();
|
||||
|
@ -320,7 +320,7 @@ void
|
||||
nsDisplayXULTextBox::Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx)
|
||||
{
|
||||
gfxContextAutoDisableSubpixelAntialiasing disable(aCtx->ThebesContext(),
|
||||
DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
|
||||
mDisableSubpixelAA);
|
||||
|
||||
// Paint the text shadow before doing any foreground stuff
|
||||
|
@ -2802,8 +2802,8 @@ public:
|
||||
virtual void Paint(nsDisplayListBuilder* aBuilder,
|
||||
nsRenderingContext* aCtx) override
|
||||
{
|
||||
gfxContext* ctx = aCtx->ThebesContext();
|
||||
gfxContextAutoDisableSubpixelAntialiasing disable(ctx, mDisableSubpixelAA);
|
||||
DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
|
||||
mDisableSubpixelAA);
|
||||
|
||||
DrawResult result = static_cast<nsTreeBodyFrame*>(mFrame)
|
||||
->PaintTreeBody(*aCtx, mVisibleRect, ToReferenceFrame());
|
||||
|
Loading…
Reference in New Issue
Block a user