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

Unified Diff: tests/StrokeTest.cpp

Issue 953383002: fuzzer fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix up width and height in initializer Created 5 years, 10 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 | « src/core/SkStroke.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/StrokeTest.cpp
diff --git a/tests/StrokeTest.cpp b/tests/StrokeTest.cpp
index 15220c4a3b6cdbc814999f0e04567a21c3cd9f74..ac3863e9cb532f84983c8dafad7e9ba77cf373dd 100644
--- a/tests/StrokeTest.cpp
+++ b/tests/StrokeTest.cpp
@@ -18,6 +18,35 @@ static bool equal(const SkRect& a, const SkRect& b) {
SkScalarNearlyEqual(a.bottom(), b.bottom());
}
+static void test_strokecubic(skiatest::Reporter* reporter) {
+ uint32_t hexCubicVals[] = {
+ 0x424c1086, 0x44bcf0cb, // fX=51.0161362 fY=1511.52478
+ 0x424c107c, 0x44bcf0cb, // fX=51.0160980 fY=1511.52478
+ 0x424c10c2, 0x44bcf0cb, // fX=51.0163651 fY=1511.52478
+ 0x424c1119, 0x44bcf0ca, // fX=51.0166969 fY=1511.52466
+ };
+ SkPoint cubicVals[] = {
+ {51.0161362f, 1511.52478f },
+ {51.0160980f, 1511.52478f },
+ {51.0163651f, 1511.52478f },
+ {51.0166969f, 1511.52466f },
+ };
+ SkPaint paint;
+
+ paint.setStyle(SkPaint::kStroke_Style);
+ paint.setStrokeWidth(0.394537568f);
+ SkPath path, fillPath;
+ path.moveTo(cubicVals[0]);
+ path.cubicTo(cubicVals[1], cubicVals[2], cubicVals[3]);
+ paint.getFillPath(path, &fillPath);
+ path.reset();
+ path.moveTo(SkBits2Float(hexCubicVals[0]), SkBits2Float(hexCubicVals[1]));
+ path.cubicTo(SkBits2Float(hexCubicVals[2]), SkBits2Float(hexCubicVals[3]),
+ SkBits2Float(hexCubicVals[4]), SkBits2Float(hexCubicVals[5]),
+ SkBits2Float(hexCubicVals[6]), SkBits2Float(hexCubicVals[7]));
+ paint.getFillPath(path, &fillPath);
+}
+
static void test_strokerect(skiatest::Reporter* reporter) {
const SkScalar width = SkIntToScalar(10);
SkPaint paint;
@@ -56,5 +85,6 @@ static void test_strokerect(skiatest::Reporter* reporter) {
}
DEF_TEST(Stroke, reporter) {
+ test_strokecubic(reporter);
test_strokerect(reporter);
}
« no previous file with comments | « src/core/SkStroke.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698