Flush text contexts before drawing text as path
authorbsalomon <bsalomon@google.com>
Tue, 14 Oct 2014 17:52:00 +0000 (10:52 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 14 Oct 2014 17:52:00 +0000 (10:52 -0700)
BUG=416289

Review URL: https://codereview.chromium.org/636233008

src/gpu/GrBitmapTextContext.cpp
src/gpu/GrDistanceFieldTextContext.cpp

index 8620e97..fa70d32 100755 (executable)
@@ -407,6 +407,9 @@ void GrBitmapTextContext::appendGlyph(GrGlyph::PackedID packed,
             glyph->fPath = path;
         }
 
+        // flush any accumulated draws before drawing this glyph as a path.
+        this->flush();
+
         GrContext::AutoMatrix am;
         SkMatrix translate;
         translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.fLeft)),
index e10fa4f..9fa0c1d 100755 (executable)
@@ -487,6 +487,9 @@ void GrDistanceFieldTextContext::appendGlyph(GrGlyph::PackedID packed,
             glyph->fPath = path;
         }
 
+        // flush any accumulated draws before drawing this glyph as a path.
+        this->flush();
+
         GrContext::AutoMatrix am;
         SkMatrix ctm;
         ctm.setScale(fTextRatio, fTextRatio);