Bug 1424673 - Fix the clip region for text draw target. r=kats
For draw target, the initial clip region should be the draw target's size.
MozReview-Commit-ID: 2z2EobkYFs2
--- a/layout/generic/TextDrawTarget.h
+++ b/layout/generic/TextDrawTarget.h
@@ -58,24 +58,21 @@ public:
{
SetPermitSubpixelAA(!aItem->IsSubpixelAADisabled());
// Compute clip/bounds
auto appUnitsPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
LayoutDeviceRect layoutBoundsRect = LayoutDeviceRect::FromAppUnits(
aBounds, appUnitsPerDevPixel);
LayoutDeviceRect layoutClipRect = layoutBoundsRect;
+ mBoundsRect = aSc.ToRelativeLayoutRect(layoutBoundsRect);
- auto clip = aItem->GetClip();
- if (clip.HasClip()) {
- layoutClipRect = LayoutDeviceRect::FromAppUnits(
- clip.GetClipRect(), appUnitsPerDevPixel);
- }
-
- mBoundsRect = aSc.ToRelativeLayoutRect(layoutBoundsRect);
+ // Add 1 pixel of dirty area around clip rect to allow us to paint
+ // antialiased pixels beyond the measured text extents.
+ layoutClipRect.Inflate(1);
mClipRect = aSc.ToRelativeLayoutRect(layoutClipRect);
mBackfaceVisible = !aItem->BackfaceIsHidden();
mBuilder.Save();
}
// Prevent this from being copied