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

Side by Side Diff: experimental/StrokePathRenderer/GrStrokePathRenderer.cpp

Issue 22850006: Replace uses of GrAssert by SkASSERT. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "GrStrokePathRenderer.h" 8 #include "GrStrokePathRenderer.h"
9 9
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 *idxs++ = vCount+2; 259 *idxs++ = vCount+2;
260 *idxs++ = vCount+3; 260 *idxs++ = vCount+3;
261 261
262 vCount += 4; 262 vCount += 4;
263 iCount += 6; 263 iCount += 6;
264 } 264 }
265 } 265 }
266 break; 266 break;
267 case SkPath::kQuad_Verb: 267 case SkPath::kQuad_Verb:
268 case SkPath::kCubic_Verb: 268 case SkPath::kCubic_Verb:
269 GrAssert(!"Curves not supported!"); 269 SkASSERT(!"Curves not supported!");
270 default: 270 default:
271 // Unhandled cases 271 // Unhandled cases
272 GrAssert(false); 272 SkASSERT(false);
273 } 273 }
274 } 274 }
275 275
276 if (isOpen) { 276 if (isOpen) {
277 // Add caps 277 // Add caps
278 switch (stroke.getCap()) { 278 switch (stroke.getCap()) {
279 case SkPaint::kSquare_Cap: 279 case SkPaint::kSquare_Cap:
280 firstPt[0] -= firstDir; 280 firstPt[0] -= firstDir;
281 firstPt[1] -= firstDir; 281 firstPt[1] -= firstDir;
282 lastPt [0] += dir; 282 lastPt [0] += dir;
283 lastPt [1] += dir; 283 lastPt [1] += dir;
284 break; 284 break;
285 case SkPaint::kRound_Cap: 285 case SkPaint::kRound_Cap:
286 GrAssert(!"Round caps not supported!"); 286 SkASSERT(!"Round caps not supported!");
287 default: // No cap 287 default: // No cap
288 break; 288 break;
289 } 289 }
290 } 290 }
291 291
292 GrAssert(vCount <= maxVertexCount); 292 SkASSERT(vCount <= maxVertexCount);
293 GrAssert(iCount <= maxIndexCount); 293 SkASSERT(iCount <= maxIndexCount);
294 294
295 if (vCount > 0) { 295 if (vCount > 0) {
296 target->drawIndexed(kTriangles_GrPrimitiveType, 296 target->drawIndexed(kTriangles_GrPrimitiveType,
297 0, // start vertex 297 0, // start vertex
298 0, // start index 298 0, // start index
299 vCount, 299 vCount,
300 iCount); 300 iCount);
301 } 301 }
302 302
303 return true; 303 return true;
304 } 304 }
OLDNEW
« no previous file with comments | « experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp ('k') | include/gpu/GrBackendEffectFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698