Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/utils/SkPatchGrid.cpp

Issue 470543004: SkPatchGrid bench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added SK_OVERRIDE to virtual overrides Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/bench.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkPatchGrid.cpp
diff --git a/src/utils/SkPatchGrid.cpp b/src/utils/SkPatchGrid.cpp
index b1fea574037b9e894de4cc323ff8ef24d790ea2d..a0809f3594db163d19226d7bc0612e11e825bf2b 100644
--- a/src/utils/SkPatchGrid.cpp
+++ b/src/utils/SkPatchGrid.cpp
@@ -174,13 +174,14 @@ void SkPatchGrid::draw(SkCanvas* canvas, SkPaint& paint) {
SkColor colors[4];
this->getPatch(x, y, cubics, colors, texCoords);
SkPatchUtils::VertexData data;
- SkPatchUtils::getVertexData(&data, cubics,
- fModeFlags & kColors_VertexType ? colors : NULL,
- fModeFlags & kTexs_VertexType ? texCoords : NULL,
- maxCols[x], maxRows[y]);
- canvas->drawVertices(SkCanvas::kTriangles_VertexMode, data.fVertexCount,
- data.fPoints, data.fTexCoords, data.fColors, fXferMode,
- data.fIndices, data.fIndexCount, paint);
+ if (SkPatchUtils::getVertexData(&data, cubics,
+ fModeFlags & kColors_VertexType ? colors : NULL,
+ fModeFlags & kTexs_VertexType ? texCoords : NULL,
+ maxCols[x], maxRows[y])) {
+ canvas->drawVertices(SkCanvas::kTriangles_VertexMode, data.fVertexCount,
+ data.fPoints, data.fTexCoords, data.fColors, fXferMode,
+ data.fIndices, data.fIndexCount, paint);
+ }
}
}
SkDELETE_ARRAY(maxCols);
« no previous file with comments | « gyp/bench.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698