From ec87dc64dd40c1a4f80088023c94764caca79bf9 Mon Sep 17 00:00:00 2001 From: bsalomon Date: Tue, 14 Oct 2014 10:52:00 -0700 Subject: [PATCH] Flush text contexts before drawing text as path BUG=416289 Review URL: https://codereview.chromium.org/636233008 --- src/gpu/GrBitmapTextContext.cpp | 3 +++ src/gpu/GrDistanceFieldTextContext.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp index 8620e97b19..fa70d3270b 100755 --- a/src/gpu/GrBitmapTextContext.cpp +++ b/src/gpu/GrBitmapTextContext.cpp @@ -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)), diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp index e10fa4fe7b..9fa0c1d7b8 100755 --- a/src/gpu/GrDistanceFieldTextContext.cpp +++ b/src/gpu/GrDistanceFieldTextContext.cpp @@ -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);