aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-02-05 12:43:18 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-05 18:03:46 +0000
commitefb25fd8093b5c9bfca38e7c43bc1bbbbd2b6fb9 (patch)
tree8e3e2374f700a733b3acba7ce9eafbbd0ba5621a
parent82831b18a6a6892b19f87289986db742ac0f7e19 (diff)
check for failure to make local-matrix
Bug: skia:7569 Change-Id: Idc00f756f1882824f9927f3ca23dc5dbe8c62d2f Reviewed-on: https://skia-review.googlesource.com/103721 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
-rw-r--r--src/core/SkDraw_vertices.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/SkDraw_vertices.cpp b/src/core/SkDraw_vertices.cpp
index 799e430ac2..4c71d65e8d 100644
--- a/src/core/SkDraw_vertices.cpp
+++ b/src/core/SkDraw_vertices.cpp
@@ -55,8 +55,9 @@ static SkScan::HairRCProc ChooseHairProc(bool doAntiAlias) {
return doAntiAlias ? SkScan::AntiHairLine : SkScan::HairLine;
}
-static bool texture_to_matrix(const VertState& state, const SkPoint verts[],
- const SkPoint texs[], SkMatrix* matrix) {
+static bool SK_WARN_UNUSED_RESULT
+texture_to_matrix(const VertState& state, const SkPoint verts[], const SkPoint texs[],
+ SkMatrix* matrix) {
SkPoint src[3], dst[3];
src[0] = texs[state.f0];
@@ -108,9 +109,9 @@ void SkTriColorShader::toString(SkString* str) const {
}
#endif
-static bool update_tricolor_matrix(const SkMatrix& ctmInv,
- const SkPoint pts[], const SkPM4f colors[],
- int index0, int index1, int index2, Matrix43* result) {
+static bool SK_WARN_UNUSED_RESULT
+update_tricolor_matrix(const SkMatrix& ctmInv, const SkPoint pts[], const SkPM4f colors[],
+ int index0, int index1, int index2, Matrix43* result) {
SkMatrix m, im;
m.reset();
m.set(0, pts[index1].fX - pts[index0].fX);
@@ -271,7 +272,9 @@ void SkDraw::drawVertices(SkVertices::VertexMode vmode, int count,
SkMatrix tmpCtm;
if (textures) {
SkMatrix localM;
- texture_to_matrix(state, vertices, textures, &localM);
+ if (!texture_to_matrix(state, vertices, textures, &localM)) {
+ continue;
+ }
tmpCtm = SkMatrix::Concat(*fMatrix, localM);
ctm = &tmpCtm;
}