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

Side by Side Diff: tests/GrShapeTest.cpp

Issue 2051263003: Fix GrShape to preserve inverseness of rrects for strokes but not dashes. (Closed) Base URL: https://chromium.googlesource.com/skia.git@strokeinv
Patch Set: Address comment Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrShape.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 <initializer_list> 8 #include <initializer_list>
9 #include <functional> 9 #include <functional>
10 #include "Test.h" 10 #include "Test.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 bool aIsRRect = a.asRRect(&rrectA, &dirA, &startA, &invertedA); 274 bool aIsRRect = a.asRRect(&rrectA, &dirA, &startA, &invertedA);
275 bool bIsRRect = b.asRRect(&rrectB, &dirB, &startB, &invertedB); 275 bool bIsRRect = b.asRRect(&rrectB, &dirB, &startB, &invertedB);
276 bool aHasPE = a.style().hasPathEffect(); 276 bool aHasPE = a.style().hasPathEffect();
277 bool bHasPE = b.style().hasPathEffect(); 277 bool bHasPE = b.style().hasPathEffect();
278 bool allowSameRRectButDiffStartAndDir = (aIsRRect && bIsRRect) && (aHasPE != bHasPE); 278 bool allowSameRRectButDiffStartAndDir = (aIsRRect && bIsRRect) && (aHasPE != bHasPE);
279 279
280 SkPath pathA, pathB; 280 SkPath pathA, pathB;
281 a.asPath(&pathA); 281 a.asPath(&pathA);
282 b.asPath(&pathB); 282 b.asPath(&pathB);
283 283
284 // Having a fill style or non-dash path effect can prevent 'a' but not 'b' f rom turning an 284 // Having a dash path effect can allow 'a' but not 'b' to turn a inverse fil l type into a
285 // inverse fill type into a non-inverse fill type. 285 // non-inverse fill type (or vice versa).
286 bool ignoreInversenessDifference = false; 286 bool ignoreInversenessDifference = false;
287 if (pathA.isInverseFillType() != pathB.isInverseFillType()) { 287 if (pathA.isInverseFillType() != pathB.isInverseFillType()) {
288 const GrShape* s1 = pathA.isInverseFillType() ? &a : &b; 288 const GrShape* s1 = pathA.isInverseFillType() ? &a : &b;
289 const GrShape* s2 = pathA.isInverseFillType() ? &b : &a; 289 const GrShape* s2 = pathA.isInverseFillType() ? &b : &a;
290 SkStrokeRec::Style style1 = s1->style().strokeRec().getStyle(); 290 bool canDropInverse1 = s1->style().isDashed();
291 SkStrokeRec::Style style2 = s2->style().strokeRec().getStyle(); 291 bool canDropInverse2 = s2->style().isDashed();
292 bool canDropInverse1 = !s1->style().hasNonDashPathEffect() && 292 ignoreInversenessDifference = (canDropInverse1 != canDropInverse2);
293 (SkStrokeRec::kStroke_Style == style1 ||
294 SkStrokeRec::kHairline_Style == style1);
295 bool canDropInverse2 = !s2->style().hasNonDashPathEffect() &&
296 (SkStrokeRec::kStroke_Style == style2 ||
297 SkStrokeRec::kHairline_Style == style2);
298 ignoreInversenessDifference = !canDropInverse1 && canDropInverse2;
299 } 293 }
300 294
301 if (allowSameRRectButDiffStartAndDir) { 295 if (allowSameRRectButDiffStartAndDir) {
302 REPORTER_ASSERT(r, rrectA == rrectB); 296 REPORTER_ASSERT(r, rrectA == rrectB);
303 REPORTER_ASSERT(r, paths_fill_same(pathA, pathB)); 297 REPORTER_ASSERT(r, paths_fill_same(pathA, pathB));
304 REPORTER_ASSERT(r, ignoreInversenessDifference || invertedA == invertedB ); 298 REPORTER_ASSERT(r, ignoreInversenessDifference || invertedA == invertedB );
305 } else { 299 } else {
306 SkPath pA = pathA; 300 SkPath pA = pathA;
307 SkPath pB = pathB; 301 SkPath pB = pathB;
308 if (ignoreInversenessDifference) { 302 if (ignoreInversenessDifference) {
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 SkPathEffect* pe = dash ? dashEffect.get() : nullptr; 1081 SkPathEffect* pe = dash ? dashEffect.get() : nullptr;
1088 shapes[index(inverted, dir, start, style, dash)] = 1082 shapes[index(inverted, dir, start, style, dash)] =
1089 GrShape(rrect, dir, start, SkToBool(inverted), 1083 GrShape(rrect, dir, start, SkToBool(inverted),
1090 GrStyle(strokeRecs[style], pe)); 1084 GrStyle(strokeRecs[style], pe));
1091 } 1085 }
1092 } 1086 }
1093 } 1087 }
1094 } 1088 }
1095 } 1089 }
1096 1090
1097 static const SkPath::Direction kDir = SkPath::kCW_Direction; // arbitrary 1091 // Get the keys for some example shape instances that we'll use for comparis ion against the
1098 const GrShape& exampleFillCase = shapes[index(false, kDir, 0, kFill, false)] ; 1092 // rest.
1093 static constexpr SkPath::Direction kExamplesDir = SkPath::kCW_Direction;
1094 static constexpr unsigned kExamplesStart = 0;
1095 const GrShape& exampleFillCase = shapes[index(false, kExamplesDir, kExamples Start, kFill,
1096 false)];
1099 Key exampleFillCaseKey; 1097 Key exampleFillCaseKey;
1100 make_key(&exampleFillCaseKey, exampleFillCase); 1098 make_key(&exampleFillCaseKey, exampleFillCase);
1101 1099
1102 const GrShape& exampleStrokeAndFillCase = shapes[index(false, kDir, 0, kStro keAndFill, false)]; 1100 const GrShape& exampleStrokeAndFillCase = shapes[index(false, kExamplesDir, kExamplesStart,
1101 kStrokeAndFill, false )];
1103 Key exampleStrokeAndFillCaseKey; 1102 Key exampleStrokeAndFillCaseKey;
1104 make_key(&exampleStrokeAndFillCaseKey, exampleStrokeAndFillCase); 1103 make_key(&exampleStrokeAndFillCaseKey, exampleStrokeAndFillCase);
1105 1104
1106 const GrShape& exampleInvFillCase = shapes[index(true, kDir, 0, kFill, false )]; 1105 const GrShape& exampleInvFillCase = shapes[index(true, kExamplesDir, kExampl esStart, kFill,
1106 false)];
1107 Key exampleInvFillCaseKey; 1107 Key exampleInvFillCaseKey;
1108 make_key(&exampleInvFillCaseKey, exampleInvFillCase); 1108 make_key(&exampleInvFillCaseKey, exampleInvFillCase);
1109 1109
1110 const GrShape& exampleInvStrokeAndFillCase = 1110 const GrShape& exampleInvStrokeAndFillCase = shapes[index(true, kExamplesDir , kExamplesStart,
1111 shapes[index(true, kDir, 0, kStrokeAndFill, false)]; 1111 kStrokeAndFill, fa lse)];
1112 Key exampleInvStrokeAndFillCaseKey; 1112 Key exampleInvStrokeAndFillCaseKey;
1113 make_key(&exampleInvStrokeAndFillCaseKey, exampleInvStrokeAndFillCase); 1113 make_key(&exampleInvStrokeAndFillCaseKey, exampleInvStrokeAndFillCase);
1114 1114
1115 const GrShape& exampleStrokeCase = shapes[index(false, kDir, 0, kStroke, fal se)]; 1115 const GrShape& exampleStrokeCase = shapes[index(false, kExamplesDir, kExampl esStart, kStroke,
1116 false)];
1116 Key exampleStrokeCaseKey; 1117 Key exampleStrokeCaseKey;
1117 make_key(&exampleStrokeCaseKey, exampleStrokeCase); 1118 make_key(&exampleStrokeCaseKey, exampleStrokeCase);
1118 1119
1119 const GrShape& exampleHairlineCase = shapes[index(false, kDir, 0, kHairline, false)]; 1120 const GrShape& exampleInvStrokeCase = shapes[index(true, kExamplesDir, kExam plesStart, kStroke,
1121 false)];
1122 Key exampleInvStrokeCaseKey;
1123 make_key(&exampleInvStrokeCaseKey, exampleInvStrokeCase);
1124
1125 const GrShape& exampleHairlineCase = shapes[index(false, kExamplesDir, kExam plesStart,
1126 kHairline, false)];
1120 Key exampleHairlineCaseKey; 1127 Key exampleHairlineCaseKey;
1121 make_key(&exampleHairlineCaseKey, exampleHairlineCase); 1128 make_key(&exampleHairlineCaseKey, exampleHairlineCase);
1122 1129
1130 const GrShape& exampleInvHairlineCase = shapes[index(true, kExamplesDir, kEx amplesStart,
1131 kHairline, false)];
1132 Key exampleInvHairlineCaseKey;
1133 make_key(&exampleInvHairlineCaseKey, exampleInvHairlineCase);
1134
1123 // These are dummy initializations to suppress warnings. 1135 // These are dummy initializations to suppress warnings.
1124 SkRRect queryRR = SkRRect::MakeEmpty(); 1136 SkRRect queryRR = SkRRect::MakeEmpty();
1125 SkPath::Direction queryDir = SkPath::kCW_Direction; 1137 SkPath::Direction queryDir = SkPath::kCW_Direction;
1126 unsigned queryStart = ~0U; 1138 unsigned queryStart = ~0U;
1127 bool queryInverted = true; 1139 bool queryInverted = true;
1128 1140
1129 REPORTER_ASSERT(r, exampleFillCase.asRRect(&queryRR, &queryDir, &queryStart, &queryInverted)); 1141 REPORTER_ASSERT(r, exampleFillCase.asRRect(&queryRR, &queryDir, &queryStart, &queryInverted));
1130 REPORTER_ASSERT(r, queryRR == rrect); 1142 REPORTER_ASSERT(r, queryRR == rrect);
1131 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir); 1143 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1132 REPORTER_ASSERT(r, 0 == queryStart); 1144 REPORTER_ASSERT(r, 0 == queryStart);
(...skipping 20 matching lines...) Expand all
1153 REPORTER_ASSERT(r, 0 == queryStart); 1165 REPORTER_ASSERT(r, 0 == queryStart);
1154 REPORTER_ASSERT(r, queryInverted); 1166 REPORTER_ASSERT(r, queryInverted);
1155 1167
1156 REPORTER_ASSERT(r, exampleHairlineCase.asRRect(&queryRR, &queryDir, &querySt art, 1168 REPORTER_ASSERT(r, exampleHairlineCase.asRRect(&queryRR, &queryDir, &querySt art,
1157 &queryInverted)); 1169 &queryInverted));
1158 REPORTER_ASSERT(r, queryRR == rrect); 1170 REPORTER_ASSERT(r, queryRR == rrect);
1159 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir); 1171 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1160 REPORTER_ASSERT(r, 0 == queryStart); 1172 REPORTER_ASSERT(r, 0 == queryStart);
1161 REPORTER_ASSERT(r, !queryInverted); 1173 REPORTER_ASSERT(r, !queryInverted);
1162 1174
1175 REPORTER_ASSERT(r, exampleInvHairlineCase.asRRect(&queryRR, &queryDir, &quer yStart,
1176 &queryInverted));
1177 REPORTER_ASSERT(r, queryRR == rrect);
1178 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1179 REPORTER_ASSERT(r, 0 == queryStart);
1180 REPORTER_ASSERT(r, queryInverted);
1181
1163 REPORTER_ASSERT(r, exampleStrokeCase.asRRect(&queryRR, &queryDir, &queryStar t, &queryInverted)); 1182 REPORTER_ASSERT(r, exampleStrokeCase.asRRect(&queryRR, &queryDir, &queryStar t, &queryInverted));
1164 REPORTER_ASSERT(r, queryRR == rrect); 1183 REPORTER_ASSERT(r, queryRR == rrect);
1165 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir); 1184 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1166 REPORTER_ASSERT(r, 0 == queryStart); 1185 REPORTER_ASSERT(r, 0 == queryStart);
1167 REPORTER_ASSERT(r, !queryInverted); 1186 REPORTER_ASSERT(r, !queryInverted);
1168 1187
1188 REPORTER_ASSERT(r, exampleInvStrokeCase.asRRect(&queryRR, &queryDir, &queryS tart,
1189 &queryInverted));
1190 REPORTER_ASSERT(r, queryRR == rrect);
1191 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1192 REPORTER_ASSERT(r, 0 == queryStart);
1193 REPORTER_ASSERT(r, queryInverted);
1194
1169 // Remember that the key reflects the geometry before styling is applied. 1195 // Remember that the key reflects the geometry before styling is applied.
1170 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvFillCaseKey); 1196 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvFillCaseKey);
1171 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeAndFillCaseKey); 1197 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeAndFillCaseKey);
1172 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvStrokeAndFillCaseKey); 1198 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvStrokeAndFillCaseKey);
1173 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeCaseKey); 1199 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeCaseKey);
1200 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvStrokeCaseKey);
1174 REPORTER_ASSERT(r, exampleFillCaseKey == exampleHairlineCaseKey); 1201 REPORTER_ASSERT(r, exampleFillCaseKey == exampleHairlineCaseKey);
1202 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvHairlineCaseKey);
1175 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvFillCaseKey); 1203 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvFillCaseKey);
1204 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvStrokeCaseKey );
1205 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvHairlineCaseK ey);
1176 1206
1177 for (bool inverted : {false, true}) { 1207 for (bool inverted : {false, true}) {
1178 for (SkPath::Direction dir : {SkPath::kCW_Direction, SkPath::kCCW_Direct ion}) { 1208 for (SkPath::Direction dir : {SkPath::kCW_Direction, SkPath::kCCW_Direct ion}) {
1179 for (unsigned start = 0; start < 8; ++start) { 1209 for (unsigned start = 0; start < 8; ++start) {
1180 for (bool dash : {false, true}) { 1210 for (bool dash : {false, true}) {
1181 const GrShape& fillCase = shapes[index(inverted, dir, start, kFill, dash)]; 1211 const GrShape& fillCase = shapes[index(inverted, dir, start, kFill, dash)];
1182 Key fillCaseKey; 1212 Key fillCaseKey;
1183 make_key(&fillCaseKey, fillCase); 1213 make_key(&fillCaseKey, fillCase);
1184 1214
1185 const GrShape& strokeAndFillCase = shapes[index(inverted, di r, start, 1215 const GrShape& strokeAndFillCase = shapes[index(inverted, di r, start,
(...skipping 11 matching lines...) Expand all
1197 TestCase d(inverted ? exampleInvStrokeAndFillCase 1227 TestCase d(inverted ? exampleInvStrokeAndFillCase
1198 : exampleStrokeAndFillCase, r); 1228 : exampleStrokeAndFillCase, r);
1199 a.compare(r, b, TestCase::kAllSame_ComparisonExpecation); 1229 a.compare(r, b, TestCase::kAllSame_ComparisonExpecation);
1200 c.compare(r, d, TestCase::kAllSame_ComparisonExpecation); 1230 c.compare(r, d, TestCase::kAllSame_ComparisonExpecation);
1201 1231
1202 const GrShape& strokeCase = shapes[index(inverted, dir, star t, kStroke, dash)]; 1232 const GrShape& strokeCase = shapes[index(inverted, dir, star t, kStroke, dash)];
1203 const GrShape& hairlineCase = shapes[index(inverted, dir, st art, kHairline, 1233 const GrShape& hairlineCase = shapes[index(inverted, dir, st art, kHairline,
1204 dash)]; 1234 dash)];
1205 1235
1206 TestCase e(strokeCase, r); 1236 TestCase e(strokeCase, r);
1207 TestCase f(exampleStrokeCase, r);
1208 TestCase g(hairlineCase, r); 1237 TestCase g(hairlineCase, r);
1209 TestCase h(exampleHairlineCase, r);
1210 1238
1211 // Both hairline and stroke shapes must respect the dashing and both 1239 // Both hairline and stroke shapes must respect the dashing.
1212 // ignore inverseness.
1213 if (dash) { 1240 if (dash) {
1241 // Dashing always ignores the inverseness. skbug.com/542 1
1242 TestCase f(exampleStrokeCase, r);
1243 TestCase h(exampleHairlineCase, r);
1214 unsigned expectedStart = canonicalize_rrect_start(start, rrect); 1244 unsigned expectedStart = canonicalize_rrect_start(start, rrect);
1215 REPORTER_ASSERT(r, strokeCase.style().pathEffect()); 1245 REPORTER_ASSERT(r, strokeCase.style().pathEffect());
1216 REPORTER_ASSERT(r, hairlineCase.style().pathEffect()); 1246 REPORTER_ASSERT(r, hairlineCase.style().pathEffect());
1217 1247
1218 REPORTER_ASSERT(r, strokeCase.asRRect(&queryRR, &queryDi r, &queryStart, 1248 REPORTER_ASSERT(r, strokeCase.asRRect(&queryRR, &queryDi r, &queryStart,
1219 &queryInverted)); 1249 &queryInverted));
1220 REPORTER_ASSERT(r, queryRR == rrect); 1250 REPORTER_ASSERT(r, queryRR == rrect);
1221 REPORTER_ASSERT(r, queryDir == dir); 1251 REPORTER_ASSERT(r, queryDir == dir);
1222 REPORTER_ASSERT(r, queryStart == expectedStart); 1252 REPORTER_ASSERT(r, queryStart == expectedStart);
1223 REPORTER_ASSERT(r, !queryInverted); 1253 REPORTER_ASSERT(r, !queryInverted);
1224 REPORTER_ASSERT(r, hairlineCase.asRRect(&queryRR, &query Dir, &queryStart, 1254 REPORTER_ASSERT(r, hairlineCase.asRRect(&queryRR, &query Dir, &queryStart,
1225 &queryInverted)) ; 1255 &queryInverted)) ;
1226 REPORTER_ASSERT(r, queryRR == rrect); 1256 REPORTER_ASSERT(r, queryRR == rrect);
1227 REPORTER_ASSERT(r, queryDir == dir); 1257 REPORTER_ASSERT(r, queryDir == dir);
1228 REPORTER_ASSERT(r, queryStart == expectedStart); 1258 REPORTER_ASSERT(r, queryStart == expectedStart);
1229 REPORTER_ASSERT(r, !queryInverted); 1259 REPORTER_ASSERT(r, !queryInverted);
1230 1260
1231 // The pre-style case for the dash will match the non-da sh example iff the 1261 // The pre-style case for the dash will match the non-da sh example iff the
1232 // dir and start match (dir=cw, start=0). 1262 // dir and start match (dir=cw, start=0).
1233 if (0 == expectedStart && SkPath::kCW_Direction == dir) { 1263 if (0 == expectedStart && SkPath::kCW_Direction == dir) {
1234 e.compare(r, f, TestCase::kSameUpToPE_ComparisonExpe cation); 1264 e.compare(r, f, TestCase::kSameUpToPE_ComparisonExpe cation);
1235 g.compare(r, h, TestCase::kSameUpToPE_ComparisonExpe cation); 1265 g.compare(r, h, TestCase::kSameUpToPE_ComparisonExpe cation);
1236 } else { 1266 } else {
1237 e.compare(r, f, TestCase::kAllDifferent_ComparisonEx pecation); 1267 e.compare(r, f, TestCase::kAllDifferent_ComparisonEx pecation);
1238 g.compare(r, h, TestCase::kAllDifferent_ComparisonEx pecation); 1268 g.compare(r, h, TestCase::kAllDifferent_ComparisonEx pecation);
1239 } 1269 }
1240 } else { 1270 } else {
1271 TestCase f(inverted ? exampleInvStrokeCase : exampleStro keCase, r);
1272 TestCase h(inverted ? exampleInvHairlineCase : exampleHa irlineCase, r);
1241 REPORTER_ASSERT(r, !strokeCase.style().pathEffect()); 1273 REPORTER_ASSERT(r, !strokeCase.style().pathEffect());
1242 REPORTER_ASSERT(r, !hairlineCase.style().pathEffect()); 1274 REPORTER_ASSERT(r, !hairlineCase.style().pathEffect());
1243 e.compare(r, f, TestCase::kAllSame_ComparisonExpecation) ; 1275 e.compare(r, f, TestCase::kAllSame_ComparisonExpecation) ;
1244 g.compare(r, h, TestCase::kAllSame_ComparisonExpecation) ; 1276 g.compare(r, h, TestCase::kAllSame_ComparisonExpecation) ;
1245 } 1277 }
1246 } 1278 }
1247 } 1279 }
1248 } 1280 }
1249 } 1281 }
1250 } 1282 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 [](SkPaint* p, SkPaint::Join j) { p->setStrokeJoin(j);}, 1410 [](SkPaint* p, SkPaint::Join j) { p->setStrokeJoin(j);},
1379 SkPaint::kMiter_Join, SkPaint::kRound_Join); 1411 SkPaint::kMiter_Join, SkPaint::kRound_Join);
1380 test_stroke_cap(reporter, path); 1412 test_stroke_cap(reporter, path);
1381 test_miter_limit(reporter, path); 1413 test_miter_limit(reporter, path);
1382 test_unknown_path_effect(reporter, path); 1414 test_unknown_path_effect(reporter, path);
1383 test_path_effect_makes_empty_shape(reporter, path); 1415 test_path_effect_makes_empty_shape(reporter, path);
1384 test_path_effect_fails(reporter, path); 1416 test_path_effect_fails(reporter, path);
1385 test_make_hairline_path_effect(reporter, path, testPath.fIsRRectForS troke); 1417 test_make_hairline_path_effect(reporter, path, testPath.fIsRRectForS troke);
1386 } 1418 }
1387 } 1419 }
1420
1388 for (auto testPath : paths) { 1421 for (auto testPath : paths) {
1389 const SkPath& path = testPath.fPath; 1422 const SkPath& path = testPath.fPath;
1390 1423
1391 SkPaint fillPaint; 1424 SkPaint fillPaint;
1392 TestCase fillPathCase(path, fillPaint, reporter); 1425 TestCase fillPathCase(path, fillPaint, reporter);
1393 SkRRect rrect; 1426 SkRRect rrect;
1394 REPORTER_ASSERT(reporter, testPath.fIsRRectForFill == 1427 REPORTER_ASSERT(reporter, testPath.fIsRRectForFill ==
1395 fillPathCase.baseShape().asRRect(&rrect, nullp tr, nullptr, 1428 fillPathCase.baseShape().asRRect(&rrect, nullp tr, nullptr,
1396 nullptr)); 1429 nullptr));
1397 if (testPath.fIsRRectForFill) { 1430 if (testPath.fIsRRectForFill) {
(...skipping 20 matching lines...) Expand all
1418 REPORTER_ASSERT(reporter, testPath.fIsLine == strokePathCase.baseShape() .asLine(nullptr)); 1451 REPORTER_ASSERT(reporter, testPath.fIsLine == strokePathCase.baseShape() .asLine(nullptr));
1419 } 1452 }
1420 1453
1421 // Test a volatile empty path. 1454 // Test a volatile empty path.
1422 test_volatile_path(reporter, SkPath(), true); 1455 test_volatile_path(reporter, SkPath(), true);
1423 1456
1424 test_empty_shape(reporter); 1457 test_empty_shape(reporter);
1425 } 1458 }
1426 1459
1427 #endif 1460 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrShape.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698