Don't draw text with zero glyph counts as paths

Bug: chromium:750420
Change-Id: Ie1a62356a3263c440a94ba1fd637c12884465515
Reviewed-on: https://skia-review.googlesource.com/28862
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 7ef7eb8..c6ae5b1 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -509,6 +509,9 @@
                                  const SkPaint& paint, const SkMatrix& viewMatrix,
                                  const char text[], size_t byteLength, SkScalar x, SkScalar y,
                                  const SkIRect& clipBounds) {
+    if (!paint.countText(text, byteLength)) {
+        return;
+    }
     SkTextToPathIter iter(text, byteLength, paint, true);
 
     SkMatrix    matrix;
@@ -537,6 +540,9 @@
                                     const char text[], size_t byteLength,
                                     const SkScalar pos[], int scalarsPerPosition,
                                     const SkPoint& offset, const SkIRect& clipBounds) {
+    if (!origPaint.countText(text, byteLength)) {
+        return;
+    }
     // setup our std paint, in hopes of getting hits in the cache
     SkPaint paint(origPaint);
     SkScalar matrixScale = paint.setupForAsPaths();