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>
diff --git a/src/core/SkDraw_vertices.cpp b/src/core/SkDraw_vertices.cpp
index 799e430..4c71d65 100644
--- a/src/core/SkDraw_vertices.cpp
+++ b/src/core/SkDraw_vertices.cpp
@@ -55,8 +55,9 @@
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 @@
}
#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 @@
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;
}