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

Side by Side Diff: src/gpu/GrAAHairLinePathRenderer.cpp

Issue 1176953002: move SkPath direction-as-computed into SkPathPriv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "GrAAHairLinePathRenderer.h" 8 #include "GrAAHairLinePathRenderer.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 break; 338 break;
339 } 339 }
340 case SkPath::kCubic_Verb: 340 case SkPath::kCubic_Verb:
341 m.mapPoints(devPts, pathPts, 4); 341 m.mapPoints(devPts, pathPts, 4);
342 bounds.setBounds(devPts, 4); 342 bounds.setBounds(devPts, 4);
343 bounds.outset(SK_Scalar1, SK_Scalar1); 343 bounds.outset(SK_Scalar1, SK_Scalar1);
344 bounds.roundOut(&ibounds); 344 bounds.roundOut(&ibounds);
345 if (SkIRect::Intersects(devClipBounds, ibounds)) { 345 if (SkIRect::Intersects(devClipBounds, ibounds)) {
346 PREALLOC_PTARRAY(32) q; 346 PREALLOC_PTARRAY(32) q;
347 // we don't need a direction if we aren't constraining the s ubdivision 347 // we don't need a direction if we aren't constraining the s ubdivision
348 static const SkPath::Direction kDummyDir = SkPath::kCCW_Dire ction; 348 const SkPathPriv::FirstDirection kDummyDir = SkPathPriv::kCC W_FirstDirection;
349 // We convert cubics to quadratics (for now). 349 // We convert cubics to quadratics (for now).
350 // In perspective have to do conversion in src space. 350 // In perspective have to do conversion in src space.
351 if (persp) { 351 if (persp) {
352 SkScalar tolScale = 352 SkScalar tolScale =
353 GrPathUtils::scaleToleranceToSrc(SK_Scalar1, m, 353 GrPathUtils::scaleToleranceToSrc(SK_Scalar1, m,
354 path.getBounds()); 354 path.getBounds());
355 GrPathUtils::convertCubicToQuads(pathPts, tolScale, fals e, kDummyDir, &q); 355 GrPathUtils::convertCubicToQuads(pathPts, tolScale, fals e, kDummyDir, &q);
356 } else { 356 } else {
357 GrPathUtils::convertCubicToQuads(devPts, SK_Scalar1, fal se, kDummyDir, &q); 357 GrPathUtils::convertCubicToQuads(devPts, SK_Scalar1, fal se, kDummyDir, &q);
358 } 358 }
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 GrColor color = GrRandomColor(random); 997 GrColor color = GrRandomColor(random);
998 SkMatrix viewMatrix = GrTest::TestMatrix(random); 998 SkMatrix viewMatrix = GrTest::TestMatrix(random);
999 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle); 999 GrStrokeInfo stroke(SkStrokeRec::kHairline_InitStyle);
1000 SkPath path = GrTest::TestPath(random); 1000 SkPath path = GrTest::TestPath(random);
1001 SkIRect devClipBounds; 1001 SkIRect devClipBounds;
1002 devClipBounds.setEmpty(); 1002 devClipBounds.setEmpty();
1003 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ; 1003 return create_hairline_batch(color, viewMatrix, path, stroke, devClipBounds) ;
1004 } 1004 }
1005 1005
1006 #endif 1006 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698