For vertices/patches with a shader and no texCoords, use positions

This was another surprising (to me) inconsistency. Just because these
geometric primitives allow for explicit local coords, doesn't mean we
should require them (vs. all others that implicitly sample using local
position).

Change-Id: If3e7f6077bd15891b06cd2ffc969f1a649305d42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290130
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 78a36e4..65eb6fe 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1967,6 +1967,17 @@
         }
     }
 
+#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+    // Preserve legacy behavior for Android: ignore the SkShader if there are no texCoords present
+    if (paint.getShader() &&
+        !(vertices->priv().hasTexCoords() || vertices->priv().hasCustomData())) {
+        SkPaint noShaderPaint(paint);
+        noShaderPaint.setShader(nullptr);
+        this->onDrawVerticesObject(vertices, mode, noShaderPaint);
+        return;
+    }
+#endif
+
     this->onDrawVerticesObject(vertices, mode, paint);
 }