aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-03 14:56:17 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-09-03 14:56:17 +0000
commitb8bd6cbbcde9846094ade18cafadfad46dc00889 (patch)
tree43c334ad5bc8b19c27341e8cfa108b9ffd01f17a /gm
parent91f4d704ce16e147125b790a060575a1b74bcfa3 (diff)
Fix bounds computation in GrAAHairlineRenderer
R=robertphillips@google.com, jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/23684008 git-svn-id: http://skia.googlecode.com/svn/trunk@11054 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r--gm/hairlines.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/gm/hairlines.cpp b/gm/hairlines.cpp
index e73cc6ddf0..7be4423483 100644
--- a/gm/hairlines.cpp
+++ b/gm/hairlines.cpp
@@ -80,6 +80,30 @@ protected:
unevenClosedQuad->quadTo(SkIntToScalar(100), SkIntToScalar(100),
SkIntToScalar(75), SkIntToScalar(75));
}
+
+ // Two problem cases for gpu hairline renderer found by shapeops testing. These used
+ // to assert that the computed bounding box didn't contain all the vertices.
+ {
+ SkPath* problem1 = &fPaths.push_back();
+ problem1->moveTo(SkIntToScalar(4), SkIntToScalar(6));
+ problem1->cubicTo(SkIntToScalar(5), SkIntToScalar(6),
+ SkIntToScalar(5), SkIntToScalar(4),
+ SkIntToScalar(4), SkIntToScalar(0));
+ problem1->close();
+ }
+
+ {
+ SkPath* problem2 = &fPaths.push_back();
+ problem2->moveTo(SkIntToScalar(5), SkIntToScalar(1));
+ problem2->lineTo(SkFloatToScalar(4.32787323f), SkFloatToScalar(1.67212653f));
+ problem2->cubicTo(SkFloatToScalar(2.75223875f), SkFloatToScalar(3.24776125f),
+ SkFloatToScalar(3.00581908f), SkFloatToScalar(4.51236057f),
+ SkFloatToScalar(3.7580452f), SkFloatToScalar(4.37367964f));
+ problem2->cubicTo(SkFloatToScalar(4.66472578f), SkFloatToScalar(3.888381f),
+ SkFloatToScalar(5.f), SkFloatToScalar(2.875f),
+ SkFloatToScalar(5.f), SkFloatToScalar(1.f));
+ problem2->close();
+ }
}
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {