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

Unified Diff: gm/hairlines.cpp

Issue 23684008: Fix bounds computation in GrAAHairlineRenderer (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rob's comments Created 7 years, 3 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 | include/core/SkRect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/hairlines.cpp
diff --git a/gm/hairlines.cpp b/gm/hairlines.cpp
index e73cc6ddf0747570855aa6d5b88c3353aa9f1b05..7be4423483c903d70e26339877eab15cc6d3ace7 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 {
« no previous file with comments | « no previous file | include/core/SkRect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698