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

Unified Diff: gm/convexpaths.cpp

Issue 15120004: Make GrAAConvexPathRender support paths with > 64K verts. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address comments Created 7 years, 7 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 | « no previous file | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/convexpaths.cpp
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp
index 2c4753d95a48ff78cf7b6cc9e47058d1c31f8440..a354bd4cef3489c9419b3682bb790cb261bda75f 100644
--- a/gm/convexpaths.cpp
+++ b/gm/convexpaths.cpp
@@ -120,12 +120,30 @@ protected:
20 * SK_Scalar1, 40 * SK_Scalar1,
SkPath::kCCW_Direction);
+ // large number of points
+ enum {
+ kLength = 100,
+ kPtsPerSide = (1 << 12),
+ };
+ fPaths.push_back().moveTo(0, 0);
+ for (int i = 1; i < kPtsPerSide; ++i) { // skip the first point due to moveTo.
+ fPaths.back().lineTo(kLength * SkIntToScalar(i) / kPtsPerSide, 0);
+ }
+ for (int i = 0; i < kPtsPerSide; ++i) {
+ fPaths.back().lineTo(kLength, kLength * SkIntToScalar(i) / kPtsPerSide);
+ }
+ for (int i = kPtsPerSide; i > 0; --i) {
+ fPaths.back().lineTo(kLength * SkIntToScalar(i) / kPtsPerSide, kLength);
+ }
+ for (int i = kPtsPerSide; i > 0; --i) {
+ fPaths.back().lineTo(0, kLength * SkIntToScalar(i) / kPtsPerSide);
+ }
+
// shallow diagonals
fPaths.push_back().lineTo(100 * SK_Scalar1, SK_Scalar1);
fPaths.back().lineTo(98 * SK_Scalar1, 100 * SK_Scalar1);
fPaths.back().lineTo(3 * SK_Scalar1, 96 * SK_Scalar1);
-
//It turns out arcTos are not automatically marked as convex and they
//may in fact be ever so slightly concave.
//fPaths.push_back().arcTo(SkRect::MakeXYWH(0, 0,
« no previous file with comments | « no previous file | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698