Bug 943351 - Make sure to clear any existing paths before getting the glyph path off a context. r=BenWa, a=bajaj
authorBas Schouten <bschouten@mozilla.com>
Tue, 26 Nov 2013 23:27:05 +0100
changeset 167879 71f37ad83d2283194e874b6ffba0219a1b06c4ef
parent 167878 c14b5cb7d00e104bede2d7151f89af85ef55bb6f
child 167880 3f97da3df62223e5f07584688db8d95609ccb213
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa, bajaj
bugs943351
milestone27.0
Bug 943351 - Make sure to clear any existing paths before getting the glyph path off a context. r=BenWa, a=bajaj
gfx/2d/ScaledFontBase.cpp
--- a/gfx/2d/ScaledFontBase.cpp
+++ b/gfx/2d/ScaledFontBase.cpp
@@ -92,16 +92,18 @@ ScaledFontBase::GetPathForGlyphs(const G
     // Convert our GlyphBuffer into an array of Cairo glyphs.
     std::vector<cairo_glyph_t> glyphs(aBuffer.mNumGlyphs);
     for (uint32_t i = 0; i < aBuffer.mNumGlyphs; ++i) {
       glyphs[i].index = aBuffer.mGlyphs[i].mIndex;
       glyphs[i].x = aBuffer.mGlyphs[i].mPosition.x;
       glyphs[i].y = aBuffer.mGlyphs[i].mPosition.y;
     }
 
+    cairo_new_path(ctx);
+
     cairo_glyph_path(ctx, &glyphs[0], aBuffer.mNumGlyphs);
 
     RefPtr<PathCairo> newPath = new PathCairo(ctx);
     if (isNewContext) {
       cairo_destroy(ctx);
     }
 
     return newPath;