Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 0b0434dab895963f0132fcbabe7ca99d93b3e8a2..d42c726c6c6a24c6ca7689bc68937ba616d1c710 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -2746,22 +2746,30 @@ void SkCanvas::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
void SkCanvas::drawText(const void* text, size_t byteLength, SkScalar x, SkScalar y, |
const SkPaint& paint) { |
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawText()"); |
- this->onDrawText(text, byteLength, x, y, paint); |
+ if (byteLength) { |
+ this->onDrawText(text, byteLength, x, y, paint); |
+ } |
} |
void SkCanvas::drawPosText(const void* text, size_t byteLength, const SkPoint pos[], |
const SkPaint& paint) { |
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPosText()"); |
- this->onDrawPosText(text, byteLength, pos, paint); |
+ if (byteLength) { |
+ this->onDrawPosText(text, byteLength, pos, paint); |
+ } |
} |
void SkCanvas::drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], |
SkScalar constY, const SkPaint& paint) { |
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawPosTextH()"); |
- this->onDrawPosTextH(text, byteLength, xpos, constY, paint); |
+ if (byteLength) { |
+ this->onDrawPosTextH(text, byteLength, xpos, constY, paint); |
+ } |
} |
void SkCanvas::drawTextOnPath(const void* text, size_t byteLength, const SkPath& path, |
const SkMatrix* matrix, const SkPaint& paint) { |
TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextOnPath()"); |
- this->onDrawTextOnPath(text, byteLength, path, matrix, paint); |
+ if (byteLength) { |
+ this->onDrawTextOnPath(text, byteLength, path, matrix, paint); |
+ } |
} |
void SkCanvas::drawTextRSXform(const void* text, size_t byteLength, const SkRSXform xform[], |
const SkRect* cullRect, const SkPaint& paint) { |