aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-07-31 14:28:47 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-31 18:55:12 +0000
commit1380bb47ab14569a0c1920ae7367fb4360b92bb8 (patch)
treeab6d19bc772c098da383733a350f5e0432401d26
parentc722f79b6c8919e1a8a0df6d4d7735c5a8a1b5e8 (diff)
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>
-rw-r--r--src/gpu/text/GrTextUtils.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/text/GrTextUtils.cpp b/src/gpu/text/GrTextUtils.cpp
index 7ef7eb8587..c6ae5b141b 100644
--- a/src/gpu/text/GrTextUtils.cpp
+++ b/src/gpu/text/GrTextUtils.cpp
@@ -509,6 +509,9 @@ void GrTextUtils::DrawTextAsPath(GrContext* context, GrRenderTargetContext* rtc,
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 @@ void GrTextUtils::DrawPosTextAsPath(GrContext* context,
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();