diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-14 14:20:28 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-05-14 14:20:28 +0000 |
commit | 7d9ffc8a04533d0207efe5511b587e89ecb9d898 (patch) | |
tree | 84330f947cdeff6fb2c5ffb78f5f356e8307d48a /gm | |
parent | 0431b87a98f2f3721d8e5dba04bf81a2fd8b5d1c (diff) |
Make GrAAConvexPathRender support paths with > 64K verts.
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/15120004
git-svn-id: http://skia.googlecode.com/svn/trunk@9118 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/convexpaths.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gm/convexpaths.cpp b/gm/convexpaths.cpp index 2c4753d95a..a354bd4cef 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, |