Index: src/gpu/GrTextContext.cpp |
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp |
index 94c05a712439a8c8498c899a0059574df4c9e187..259ba184aaa6f6c6762416c1bce096e894416219 100644 |
--- a/src/gpu/GrTextContext.cpp |
+++ b/src/gpu/GrTextContext.cpp |
@@ -76,13 +76,14 @@ bool GrTextContext::drawPosText(const GrPaint& paint, const SkPaint& skPaint, |
//*** change to output positions? |
-void GrTextContext::MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
+int GrTextContext::MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheProc, |
const char text[], size_t byteLength, SkVector* stopVector) { |
SkFixed x = 0, y = 0; |
const char* stop = text + byteLength; |
SkAutoKern autokern; |
+ int numGlyphs = 0; |
while (text < stop) { |
// don't need x, y here, since all subpixel variants will have the |
// same advance |
@@ -90,10 +91,13 @@ void GrTextContext::MeasureText(SkGlyphCache* cache, SkDrawCacheProc glyphCacheP |
x += autokern.adjust(glyph) + glyph.fAdvanceX; |
y += glyph.fAdvanceY; |
+ ++numGlyphs; |
} |
stopVector->set(SkFixedToScalar(x), SkFixedToScalar(y)); |
SkASSERT(text == stop); |
+ |
+ return numGlyphs; |
} |
static void GlyphCacheAuxProc(void* data) { |