OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkPathOpsDebug.h" | 8 #include "SkPathOpsDebug.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 void SkPathOpsDebug::ShowPath(const SkPath& a, const SkPath& b, SkPathOp shapeOp
, | 129 void SkPathOpsDebug::ShowPath(const SkPath& a, const SkPath& b, SkPathOp shapeOp
, |
130 const char* testName) { | 130 const char* testName) { |
131 SkAutoMutexAcquire ac(gTestMutex); | 131 SkAutoMutexAcquire ac(gTestMutex); |
132 show_function_header(testName); | 132 show_function_header(testName); |
133 ShowOnePath(a, "path", true); | 133 ShowOnePath(a, "path", true); |
134 ShowOnePath(b, "pathB", true); | 134 ShowOnePath(b, "pathB", true); |
135 show_op(shapeOp, "path", "pathB"); | 135 show_op(shapeOp, "path", "pathB"); |
136 } | 136 } |
137 | 137 |
| 138 #include "SkPathOpsTypes.h" |
| 139 |
| 140 #ifdef SK_DEBUG |
| 141 bool SkOpGlobalState::debugRunFail() const { |
| 142 #if DEBUG_VALIDATE |
| 143 return FLAGS_runFail; |
| 144 #else |
| 145 return false; |
| 146 #endif |
| 147 } |
| 148 #endif |
| 149 |
138 #include "SkPathOpsCubic.h" | 150 #include "SkPathOpsCubic.h" |
139 #include "SkPathOpsQuad.h" | 151 #include "SkPathOpsQuad.h" |
140 | 152 |
141 SkDCubic SkDQuad::debugToCubic() const { | 153 SkDCubic SkDQuad::debugToCubic() const { |
142 SkDCubic cubic; | 154 SkDCubic cubic; |
143 cubic[0] = fPts[0]; | 155 cubic[0] = fPts[0]; |
144 cubic[2] = fPts[1]; | 156 cubic[2] = fPts[1]; |
145 cubic[3] = fPts[2]; | 157 cubic[3] = fPts[2]; |
146 cubic[1].fX = (cubic[0].fX + cubic[2].fX * 2) / 3; | 158 cubic[1].fX = (cubic[0].fX + cubic[2].fX * 2) / 3; |
147 cubic[1].fY = (cubic[0].fY + cubic[2].fY * 2) / 3; | 159 cubic[1].fY = (cubic[0].fY + cubic[2].fY * 2) / 3; |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 #endif | 667 #endif |
656 SkPath::FillType fillType = path.getFillType(); | 668 SkPath::FillType fillType = path.getFillType(); |
657 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver
seEvenOdd_FillType); | 669 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver
seEvenOdd_FillType); |
658 if (includeDeclaration) { | 670 if (includeDeclaration) { |
659 SkDebugf(" SkPath %s;\n", name); | 671 SkDebugf(" SkPath %s;\n", name); |
660 } | 672 } |
661 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]); | 673 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]); |
662 iter.setPath(path); | 674 iter.setPath(path); |
663 showPathContours(iter, name); | 675 showPathContours(iter, name); |
664 } | 676 } |
OLD | NEW |