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

Unified Diff: tests/PathOpsBoundsTest.cpp

Issue 1111333002: compute initial winding from projected rays (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add missing test reference Created 5 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 | « tests/PathOpsBattles.cpp ('k') | tests/PathOpsCubicReduceOrderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsBoundsTest.cpp
diff --git a/tests/PathOpsBoundsTest.cpp b/tests/PathOpsBoundsTest.cpp
index 0c74b69b12bfda4589f9386838aae7d7181e7740..573a0cecf9b04e3d77b285ad1b82a9f5cea778ce 100644
--- a/tests/PathOpsBoundsTest.cpp
+++ b/tests/PathOpsBoundsTest.cpp
@@ -29,24 +29,6 @@ static const SkRect noSectTests[][2] = {
static const size_t noSectTestsCount = SK_ARRAY_COUNT(noSectTests);
-static const SkRect reallyEmpty[] = {
- {0, 0, 0, 0},
- {1, 1, 1, 0},
- {1, 1, 0, 1},
- {1, 1, 0, 0},
- {1, 2, 3, SK_ScalarNaN},
-};
-
-static const size_t emptyTestsCount = SK_ARRAY_COUNT(reallyEmpty);
-
-static const SkRect notReallyEmpty[] = {
- {0, 0, 1, 0},
- {0, 0, 0, 1},
- {0, 0, 1, 1},
-};
-
-static const size_t notEmptyTestsCount = SK_ARRAY_COUNT(notReallyEmpty);
-
DEF_TEST(PathOpsBounds, reporter) {
for (size_t index = 0; index < sectTestsCount; ++index) {
const SkPathOpsBounds& bounds1 = static_cast<const SkPathOpsBounds&>(sectTests[index][0]);
@@ -75,41 +57,18 @@ DEF_TEST(PathOpsBounds, reporter) {
ordinal.set(1, 2, 3, 4);
bounds.add(ordinal);
REPORTER_ASSERT(reporter, bounds == expected);
- SkDPoint topLeft = {0, 0};
- bounds.setPointBounds(topLeft);
+ bounds.setEmpty();
SkDPoint botRight = {3, 4};
bounds.add(botRight);
REPORTER_ASSERT(reporter, bounds == expected);
- for (size_t index = 0; index < emptyTestsCount; ++index) {
- const SkPathOpsBounds& bounds = static_cast<const SkPathOpsBounds&>(reallyEmpty[index]);
- // SkASSERT(ValidBounds(bounds)); // don't check because test may contain nan
- bool empty = bounds.isReallyEmpty();
- REPORTER_ASSERT(reporter, empty);
- }
- for (size_t index = 0; index < notEmptyTestsCount; ++index) {
- const SkPathOpsBounds& bounds = static_cast<const SkPathOpsBounds&>(notReallyEmpty[index]);
- SkASSERT(ValidBounds(bounds));
- bool empty = bounds.isReallyEmpty();
- REPORTER_ASSERT(reporter, !empty);
- }
const SkPoint curvePts[] = {{0, 0}, {1, 2}, {3, 4}, {5, 6}};
SkDCurve curve;
- curve.fLine.set(curvePts);
- curve.setLineBounds(curvePts, 1, 0, 1, &bounds);
- expected.set(0, 0, 1, 2);
- REPORTER_ASSERT(reporter, bounds == expected);
- (curve.*SetBounds[SkPath::kLine_Verb])(curvePts, 1, 0, 1, &bounds);
- REPORTER_ASSERT(reporter, bounds == expected);
curve.fQuad.set(curvePts);
curve.setQuadBounds(curvePts, 1, 0, 1, &bounds);
expected.set(0, 0, 3, 4);
REPORTER_ASSERT(reporter, bounds == expected);
- (curve.*SetBounds[SkPath::kQuad_Verb])(curvePts, 1, 0, 1, &bounds);
- REPORTER_ASSERT(reporter, bounds == expected);
curve.fCubic.set(curvePts);
curve.setCubicBounds(curvePts, 1, 0, 1, &bounds);
expected.set(0, 0, 5, 6);
REPORTER_ASSERT(reporter, bounds == expected);
- (curve.*SetBounds[SkPath::kCubic_Verb])(curvePts, 1, 0, 1, &bounds);
- REPORTER_ASSERT(reporter, bounds == expected);
}
« no previous file with comments | « tests/PathOpsBattles.cpp ('k') | tests/PathOpsCubicReduceOrderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698