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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « gyp/bench.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkPatchGrid.h" 8 #include "SkPatchGrid.h"
9 #include "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 10
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 } 168 }
169 // Draw the patches by generating their geometry with the maximum level of d etail per axis. 169 // Draw the patches by generating their geometry with the maximum level of d etail per axis.
170 for (int x = 0; x < fCols; x++) { 170 for (int x = 0; x < fCols; x++) {
171 for (int y = 0; y < fRows; y++) { 171 for (int y = 0; y < fRows; y++) {
172 SkPoint cubics[12]; 172 SkPoint cubics[12];
173 SkPoint texCoords[4]; 173 SkPoint texCoords[4];
174 SkColor colors[4]; 174 SkColor colors[4];
175 this->getPatch(x, y, cubics, colors, texCoords); 175 this->getPatch(x, y, cubics, colors, texCoords);
176 SkPatchUtils::VertexData data; 176 SkPatchUtils::VertexData data;
177 SkPatchUtils::getVertexData(&data, cubics, 177 if (SkPatchUtils::getVertexData(&data, cubics,
178 fModeFlags & kColors_VertexType ? colors : NULL, 178 fModeFlags & kColors_VertexType ? co lors : NULL,
179 fModeFlags & kTexs_VertexType ? texCoord s : NULL, 179 fModeFlags & kTexs_VertexType ? texC oords : NULL,
180 maxCols[x], maxRows[y]); 180 maxCols[x], maxRows[y])) {
181 canvas->drawVertices(SkCanvas::kTriangles_VertexMode, data.fVertexCo unt, 181 canvas->drawVertices(SkCanvas::kTriangles_VertexMode, data.fVert exCount,
182 data.fPoints, data.fTexCoords, data.fColors, fX ferMode, 182 data.fPoints, data.fTexCoords, data.fColors , fXferMode,
183 data.fIndices, data.fIndexCount, paint); 183 data.fIndices, data.fIndexCount, paint);
184 }
184 } 185 }
185 } 186 }
186 SkDELETE_ARRAY(maxCols); 187 SkDELETE_ARRAY(maxCols);
187 SkDELETE_ARRAY(maxRows); 188 SkDELETE_ARRAY(maxRows);
188 } 189 }
OLDNEW
« 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