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

Unified Diff: tests/PathOpsExtendedTest.cpp

Issue 13851015: path ops : fix empty-diff bug, op-in-place (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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/pathops/SkPathOpsOp.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsExtendedTest.cpp
===================================================================
--- tests/PathOpsExtendedTest.cpp (revision 8822)
+++ tests/PathOpsExtendedTest.cpp (working copy)
@@ -29,6 +29,7 @@
"kIntersect_PathOp",
"kUnion_PathOp",
"kXor_PathOp",
+ "kReverseDifference_PathOp",
};
static const char* opSuffixes[] = {
@@ -43,7 +44,7 @@
static bool gComparePathsAssert = true;
static bool gPathStrAssert = true;
-static void showPathContour(SkPath::Iter& iter) {
+static void showPathContours(SkPath::Iter& iter) {
uint8_t verb;
SkPoint pts[4];
while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
@@ -77,6 +78,13 @@
showPath(path);
}
+const char* fillTypeStr[] = {
+ "kWinding_FillType",
+ "kEvenOdd_FillType",
+ "kInverseWinding_FillType",
+ "kInverseEvenOdd_FillType"
+};
+
void showPath(const SkPath& path) {
SkPath::Iter iter(path, true);
#define SUPPORT_RECT_CONTOUR_DETECTION 0
@@ -97,8 +105,11 @@
return;
}
#endif
+ SkPath::FillType fillType = path.getFillType();
+ SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInverseEvenOdd_FillType);
+ SkDebugf("path.setFillType(%s);\n", fillTypeStr[fillType]);
iter.setPath(path, true);
- showPathContour(iter);
+ showPathContours(iter);
}
void showPathData(const SkPath& path) {
@@ -145,6 +156,9 @@
case kXOR_PathOp:
SkDebugf("op xor\n");
break;
+ case kReverseDifference_PathOp:
+ SkDebugf("op reverse difference\n");
+ break;
default:
SkASSERT(0);
}
@@ -356,10 +370,13 @@
int errors2x2;
int errors = pathsDrawTheSame(bitmap, scaledOne, scaledTwo, errors2x2);
if (errors2x2 == 0) {
+ if (gShowPath) {
+ showPathOpPath(one, two, a, b, scaledOne, scaledTwo, shapeOp, scale);
+ }
return 0;
}
const int MAX_ERRORS = 8;
- if (errors2x2 == MAX_ERRORS || errors2x2 == MAX_ERRORS - 1) {
+ if (gShowPath || errors2x2 == MAX_ERRORS || errors2x2 == MAX_ERRORS - 1) {
showPathOpPath(one, two, a, b, scaledOne, scaledTwo, shapeOp, scale);
}
if (errors2x2 > MAX_ERRORS && gComparePathsAssert) {
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698