From 7ab691c8278be5f0505f7f5d8158b1dcbb7d4fa2 Mon Sep 17 00:00:00 2001 From: Ethan Lin Date: Mon, 8 Jan 2018 10:59:01 +0800 Subject: [PATCH] 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 --HG-- extra : rebase_source : 9631cf189330b089992b8458113800ea9a3fd4a0 --- layout/generic/TextDrawTarget.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/layout/generic/TextDrawTarget.h b/layout/generic/TextDrawTarget.h index 28ee80221c7b..ca3e94bbee97 100644 --- a/layout/generic/TextDrawTarget.h +++ b/layout/generic/TextDrawTarget.h @@ -63,14 +63,11 @@ public: LayoutDeviceRect layoutBoundsRect = LayoutDeviceRect::FromAppUnits( aBounds, appUnitsPerDevPixel); LayoutDeviceRect layoutClipRect = 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();