Bug 1379404 - Part 3. Prevent using gfxContext::Save/Restore in gfxTextRun. draft
authorcku <cku@mozilla.com>
Sun, 09 Jul 2017 00:33:54 +0800
changeset 605961 7dd59aa052aea4b54afc1596de187660243a4aca
parent 605960 c1255ef2980c265e486e22d591659b98499a94fe
child 605962 796130130330d90de8302ab0e8b1f4ab31538e95
push id67564
push userbmo:cku@mozilla.com
push dateMon, 10 Jul 2017 05:06:36 +0000
bugs1379404
milestone56.0a1
Bug 1379404 - Part 3. Prevent using gfxContext::Save/Restore in gfxTextRun. MozReview-Commit-ID: 5p7vAYHGhdy
gfx/thebes/gfxTextRun.cpp
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -494,30 +494,29 @@ gfxTextRun::DrawPartialLigature(gfxFont 
       // Also, make sure we snap the rectangle to device pixels.
       Rect clipRect = aParams.isVerticalRun ?
           Rect(clipExtents.X(), start / mAppUnitsPerDevUnit,
                clipExtents.Width(), (end - start) / mAppUnitsPerDevUnit) :
           Rect(start / mAppUnitsPerDevUnit, clipExtents.Y(),
                (end - start) / mAppUnitsPerDevUnit, clipExtents.Height());
       MaybeSnapToDevicePixels(clipRect, *aParams.dt, true);
 
-      aParams.context->Save();
       aParams.context->Clip(clipRect);
     }
 
     gfxPoint pt;
     if (aParams.isVerticalRun) {
         pt = gfxPoint(aPt->x, aPt->y - aParams.direction * data.mPartAdvance);
     } else {
         pt = gfxPoint(aPt->x - aParams.direction * data.mPartAdvance, aPt->y);
     }
 
     DrawGlyphs(aFont, data.mRange, &pt,
                aProvider, aRange, aParams, aOrientation);
-    aParams.context->Restore();
+    aParams.context->PopClip();
 
     if (aParams.isVerticalRun) {
         aPt->y += aParams.direction * data.mPartWidth;
     } else {
         aPt->x += aParams.direction * data.mPartWidth;
     }
 }