Bug 1059033 - Part 6: Clip text drawing to its bound so we can skip unaffected tiles. r=Bas

This commit is contained in:
Matt Woodrow 2014-09-01 15:23:29 +12:00
parent b48bd57177
commit e3cbab20dc

View File

@ -4565,8 +4565,18 @@ nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
extraVisible.Inflate(appUnitsPerDevPixel, appUnitsPerDevPixel);
nsTextFrame* f = static_cast<nsTextFrame*>(mFrame);
gfxContextAutoDisableSubpixelAntialiasing disable(aCtx->ThebesContext(),
gfxContext* ctx = aCtx->ThebesContext();
gfxContextAutoDisableSubpixelAntialiasing disable(ctx,
mDisableSubpixelAA);
gfxContextAutoSaveRestore save(ctx);
gfxRect pixelVisible =
nsLayoutUtils::RectToGfxRect(extraVisible, appUnitsPerDevPixel);
ctx->NewPath();
ctx->Rectangle(pixelVisible);
ctx->Clip();
NS_ASSERTION(mLeftEdge >= 0, "illegal left edge");
NS_ASSERTION(mRightEdge >= 0, "illegal right edge");
f->PaintText(aCtx, ToReferenceFrame(), extraVisible, *this);