Bug 1379404 - Part 3. Prevent using gfxContext::Save/Restore in gfxTextRun.
MozReview-Commit-ID: 5p7vAYHGhdy
--- 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;
}
}