Index: src/core/SkDevice.cpp |
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp |
index 50755c94ed5e65999574ec120ff3af5610344960..f4ae7b138173cf7132b67bda531ffc022ac83d61 100644 |
--- a/src/core/SkDevice.cpp |
+++ b/src/core/SkDevice.cpp |
@@ -86,10 +86,12 @@ void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const |
SkISize lod = SkPatchUtils::GetLevelOfDetail(cubics, draw.fMatrix); |
// It automatically adjusts lodX and lodY in case it exceeds the number of indices. |
- SkPatchUtils::getVertexData(&data, cubics, colors, texCoords, lod.width(), lod.height()); |
- this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount, data.fPoints, |
- data.fTexCoords, data.fColors, xmode, data.fIndices, data.fIndexCount, |
- paint); |
+ // If it fails to generate the vertices, then we do not draw. |
+ if (SkPatchUtils::getVertexData(&data, cubics, colors, texCoords, lod.width(), lod.height())) { |
+ this->drawVertices(draw, SkCanvas::kTriangles_VertexMode, data.fVertexCount, data.fPoints, |
+ data.fTexCoords, data.fColors, xmode, data.fIndices, data.fIndexCount, |
+ paint); |
+ } |
} |
bool SkBaseDevice::readPixels(const SkImageInfo& info, void* dstP, size_t rowBytes, int x, int y) { |