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

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: rm debugging change 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 const SkPath::Direction kExamplesDir = SkPath::kCW_Direction;
1094 static const SkPath::Direction kExamplesStart = SkPath::kCW_Direction;
egdaniel 2016/06/14 19:44:43 Should the start be a index here and not a directi
bsalomon 2016/06/14 19:48:27 derrrr. Fixed
1095 const GrShape& exampleFillCase = shapes[index(false, kExamplesDir, 0, kFill, false)];
1099 Key exampleFillCaseKey; 1096 Key exampleFillCaseKey;
1100 make_key(&exampleFillCaseKey, exampleFillCase); 1097 make_key(&exampleFillCaseKey, exampleFillCase);
1101 1098
1102 const GrShape& exampleStrokeAndFillCase = shapes[index(false, kDir, 0, kStro keAndFill, false)]; 1099 const GrShape& exampleStrokeAndFillCase = shapes[index(false, kExamplesDir, kExamplesStart,
1100 kStrokeAndFill, false )];
1103 Key exampleStrokeAndFillCaseKey; 1101 Key exampleStrokeAndFillCaseKey;
1104 make_key(&exampleStrokeAndFillCaseKey, exampleStrokeAndFillCase); 1102 make_key(&exampleStrokeAndFillCaseKey, exampleStrokeAndFillCase);
1105 1103
1106 const GrShape& exampleInvFillCase = shapes[index(true, kDir, 0, kFill, false )]; 1104 const GrShape& exampleInvFillCase = shapes[index(true, kExamplesDir, kExampl esStart, kFill,
1105 false)];
1107 Key exampleInvFillCaseKey; 1106 Key exampleInvFillCaseKey;
1108 make_key(&exampleInvFillCaseKey, exampleInvFillCase); 1107 make_key(&exampleInvFillCaseKey, exampleInvFillCase);
1109 1108
1110 const GrShape& exampleInvStrokeAndFillCase = 1109 const GrShape& exampleInvStrokeAndFillCase = shapes[index(true, kExamplesDir , kExamplesStart,
1111 shapes[index(true, kDir, 0, kStrokeAndFill, false)]; 1110 kStrokeAndFill, fa lse)];
1112 Key exampleInvStrokeAndFillCaseKey; 1111 Key exampleInvStrokeAndFillCaseKey;
1113 make_key(&exampleInvStrokeAndFillCaseKey, exampleInvStrokeAndFillCase); 1112 make_key(&exampleInvStrokeAndFillCaseKey, exampleInvStrokeAndFillCase);
1114 1113
1115 const GrShape& exampleStrokeCase = shapes[index(false, kDir, 0, kStroke, fal se)]; 1114 const GrShape& exampleStrokeCase = shapes[index(false, kExamplesDir, kExampl esStart, kStroke,
1115 false)];
1116 Key exampleStrokeCaseKey; 1116 Key exampleStrokeCaseKey;
1117 make_key(&exampleStrokeCaseKey, exampleStrokeCase); 1117 make_key(&exampleStrokeCaseKey, exampleStrokeCase);
1118 1118
1119 const GrShape& exampleHairlineCase = shapes[index(false, kDir, 0, kHairline, false)]; 1119 const GrShape& exampleInvStrokeCase = shapes[index(true, kExamplesDir, kExam plesStart, kStroke,
1120 false)];
1121 Key exampleInvStrokeCaseKey;
1122 make_key(&exampleInvStrokeCaseKey, exampleInvStrokeCase);
1123
1124 const GrShape& exampleHairlineCase = shapes[index(false, kExamplesDir, kExam plesStart,
1125 kHairline, false)];
1120 Key exampleHairlineCaseKey; 1126 Key exampleHairlineCaseKey;
1121 make_key(&exampleHairlineCaseKey, exampleHairlineCase); 1127 make_key(&exampleHairlineCaseKey, exampleHairlineCase);
1122 1128
1129 const GrShape& exampleInvHairlineCase = shapes[index(true, kExamplesDir, kEx amplesStart,
1130 kHairline, false)];
1131 Key exampleInvHairlineCaseKey;
1132 make_key(&exampleInvHairlineCaseKey, exampleInvHairlineCase);
1133
1123 // These are dummy initializations to suppress warnings. 1134 // These are dummy initializations to suppress warnings.
1124 SkRRect queryRR = SkRRect::MakeEmpty(); 1135 SkRRect queryRR = SkRRect::MakeEmpty();
1125 SkPath::Direction queryDir = SkPath::kCW_Direction; 1136 SkPath::Direction queryDir = SkPath::kCW_Direction;
1126 unsigned queryStart = ~0U; 1137 unsigned queryStart = ~0U;
1127 bool queryInverted = true; 1138 bool queryInverted = true;
1128 1139
1129 REPORTER_ASSERT(r, exampleFillCase.asRRect(&queryRR, &queryDir, &queryStart, &queryInverted)); 1140 REPORTER_ASSERT(r, exampleFillCase.asRRect(&queryRR, &queryDir, &queryStart, &queryInverted));
1130 REPORTER_ASSERT(r, queryRR == rrect); 1141 REPORTER_ASSERT(r, queryRR == rrect);
1131 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir); 1142 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1132 REPORTER_ASSERT(r, 0 == queryStart); 1143 REPORTER_ASSERT(r, 0 == queryStart);
(...skipping 20 matching lines...) Expand all
1153 REPORTER_ASSERT(r, 0 == queryStart); 1164 REPORTER_ASSERT(r, 0 == queryStart);
1154 REPORTER_ASSERT(r, queryInverted); 1165 REPORTER_ASSERT(r, queryInverted);
1155 1166
1156 REPORTER_ASSERT(r, exampleHairlineCase.asRRect(&queryRR, &queryDir, &querySt art, 1167 REPORTER_ASSERT(r, exampleHairlineCase.asRRect(&queryRR, &queryDir, &querySt art,
1157 &queryInverted)); 1168 &queryInverted));
1158 REPORTER_ASSERT(r, queryRR == rrect); 1169 REPORTER_ASSERT(r, queryRR == rrect);
1159 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir); 1170 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1160 REPORTER_ASSERT(r, 0 == queryStart); 1171 REPORTER_ASSERT(r, 0 == queryStart);
1161 REPORTER_ASSERT(r, !queryInverted); 1172 REPORTER_ASSERT(r, !queryInverted);
1162 1173
1174 REPORTER_ASSERT(r, exampleInvHairlineCase.asRRect(&queryRR, &queryDir, &quer yStart,
1175 &queryInverted));
1176 REPORTER_ASSERT(r, queryRR == rrect);
1177 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1178 REPORTER_ASSERT(r, 0 == queryStart);
1179 REPORTER_ASSERT(r, queryInverted);
1180
1163 REPORTER_ASSERT(r, exampleStrokeCase.asRRect(&queryRR, &queryDir, &queryStar t, &queryInverted)); 1181 REPORTER_ASSERT(r, exampleStrokeCase.asRRect(&queryRR, &queryDir, &queryStar t, &queryInverted));
1164 REPORTER_ASSERT(r, queryRR == rrect); 1182 REPORTER_ASSERT(r, queryRR == rrect);
1165 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir); 1183 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1166 REPORTER_ASSERT(r, 0 == queryStart); 1184 REPORTER_ASSERT(r, 0 == queryStart);
1167 REPORTER_ASSERT(r, !queryInverted); 1185 REPORTER_ASSERT(r, !queryInverted);
1168 1186
1187 REPORTER_ASSERT(r, exampleInvStrokeCase.asRRect(&queryRR, &queryDir, &queryS tart,
1188 &queryInverted));
1189 REPORTER_ASSERT(r, queryRR == rrect);
1190 REPORTER_ASSERT(r, SkPath::kCW_Direction == queryDir);
1191 REPORTER_ASSERT(r, 0 == queryStart);
1192 REPORTER_ASSERT(r, queryInverted);
1193
1169 // Remember that the key reflects the geometry before styling is applied. 1194 // Remember that the key reflects the geometry before styling is applied.
1170 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvFillCaseKey); 1195 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvFillCaseKey);
1171 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeAndFillCaseKey); 1196 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeAndFillCaseKey);
1172 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvStrokeAndFillCaseKey); 1197 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvStrokeAndFillCaseKey);
1173 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeCaseKey); 1198 REPORTER_ASSERT(r, exampleFillCaseKey == exampleStrokeCaseKey);
1199 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvStrokeCaseKey);
1174 REPORTER_ASSERT(r, exampleFillCaseKey == exampleHairlineCaseKey); 1200 REPORTER_ASSERT(r, exampleFillCaseKey == exampleHairlineCaseKey);
1201 REPORTER_ASSERT(r, exampleFillCaseKey != exampleInvHairlineCaseKey);
1175 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvFillCaseKey); 1202 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvFillCaseKey);
1203 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvStrokeCaseKey );
1204 REPORTER_ASSERT(r, exampleInvStrokeAndFillCaseKey == exampleInvHairlineCaseK ey);
1176 1205
1177 for (bool inverted : {false, true}) { 1206 for (bool inverted : {false, true}) {
1178 for (SkPath::Direction dir : {SkPath::kCW_Direction, SkPath::kCCW_Direct ion}) { 1207 for (SkPath::Direction dir : {SkPath::kCW_Direction, SkPath::kCCW_Direct ion}) {
1179 for (unsigned start = 0; start < 8; ++start) { 1208 for (unsigned start = 0; start < 8; ++start) {
1180 for (bool dash : {false, true}) { 1209 for (bool dash : {false, true}) {
1181 const GrShape& fillCase = shapes[index(inverted, dir, start, kFill, dash)]; 1210 const GrShape& fillCase = shapes[index(inverted, dir, start, kFill, dash)];
1182 Key fillCaseKey; 1211 Key fillCaseKey;
1183 make_key(&fillCaseKey, fillCase); 1212 make_key(&fillCaseKey, fillCase);
1184 1213
1185 const GrShape& strokeAndFillCase = shapes[index(inverted, di r, start, 1214 const GrShape& strokeAndFillCase = shapes[index(inverted, di r, start,
(...skipping 11 matching lines...) Expand all
1197 TestCase d(inverted ? exampleInvStrokeAndFillCase 1226 TestCase d(inverted ? exampleInvStrokeAndFillCase
1198 : exampleStrokeAndFillCase, r); 1227 : exampleStrokeAndFillCase, r);
1199 a.compare(r, b, TestCase::kAllSame_ComparisonExpecation); 1228 a.compare(r, b, TestCase::kAllSame_ComparisonExpecation);
1200 c.compare(r, d, TestCase::kAllSame_ComparisonExpecation); 1229 c.compare(r, d, TestCase::kAllSame_ComparisonExpecation);
1201 1230
1202 const GrShape& strokeCase = shapes[index(inverted, dir, star t, kStroke, dash)]; 1231 const GrShape& strokeCase = shapes[index(inverted, dir, star t, kStroke, dash)];
1203 const GrShape& hairlineCase = shapes[index(inverted, dir, st art, kHairline, 1232 const GrShape& hairlineCase = shapes[index(inverted, dir, st art, kHairline,
1204 dash)]; 1233 dash)];
1205 1234
1206 TestCase e(strokeCase, r); 1235 TestCase e(strokeCase, r);
1207 TestCase f(exampleStrokeCase, r);
1208 TestCase g(hairlineCase, r); 1236 TestCase g(hairlineCase, r);
1209 TestCase h(exampleHairlineCase, r);
1210 1237
1211 // Both hairline and stroke shapes must respect the dashing and both 1238 // Both hairline and stroke shapes must respect the dashing.
1212 // ignore inverseness.
1213 if (dash) { 1239 if (dash) {
1240 // Dashing always ignores the inverseness. skbug.com/542 1
1241 TestCase f(exampleStrokeCase, r);
1242 TestCase h(exampleHairlineCase, r);
1214 unsigned expectedStart = canonicalize_rrect_start(start, rrect); 1243 unsigned expectedStart = canonicalize_rrect_start(start, rrect);
1215 REPORTER_ASSERT(r, strokeCase.style().pathEffect()); 1244 REPORTER_ASSERT(r, strokeCase.style().pathEffect());
1216 REPORTER_ASSERT(r, hairlineCase.style().pathEffect()); 1245 REPORTER_ASSERT(r, hairlineCase.style().pathEffect());
1217 1246
1218 REPORTER_ASSERT(r, strokeCase.asRRect(&queryRR, &queryDi r, &queryStart, 1247 REPORTER_ASSERT(r, strokeCase.asRRect(&queryRR, &queryDi r, &queryStart,
1219 &queryInverted)); 1248 &queryInverted));
1220 REPORTER_ASSERT(r, queryRR == rrect); 1249 REPORTER_ASSERT(r, queryRR == rrect);
1221 REPORTER_ASSERT(r, queryDir == dir); 1250 REPORTER_ASSERT(r, queryDir == dir);
1222 REPORTER_ASSERT(r, queryStart == expectedStart); 1251 REPORTER_ASSERT(r, queryStart == expectedStart);
1223 REPORTER_ASSERT(r, !queryInverted); 1252 REPORTER_ASSERT(r, !queryInverted);
1224 REPORTER_ASSERT(r, hairlineCase.asRRect(&queryRR, &query Dir, &queryStart, 1253 REPORTER_ASSERT(r, hairlineCase.asRRect(&queryRR, &query Dir, &queryStart,
1225 &queryInverted)) ; 1254 &queryInverted)) ;
1226 REPORTER_ASSERT(r, queryRR == rrect); 1255 REPORTER_ASSERT(r, queryRR == rrect);
1227 REPORTER_ASSERT(r, queryDir == dir); 1256 REPORTER_ASSERT(r, queryDir == dir);
1228 REPORTER_ASSERT(r, queryStart == expectedStart); 1257 REPORTER_ASSERT(r, queryStart == expectedStart);
1229 REPORTER_ASSERT(r, !queryInverted); 1258 REPORTER_ASSERT(r, !queryInverted);
1230 1259
1231 // The pre-style case for the dash will match the non-da sh example iff the 1260 // 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). 1261 // dir and start match (dir=cw, start=0).
1233 if (0 == expectedStart && SkPath::kCW_Direction == dir) { 1262 if (0 == expectedStart && SkPath::kCW_Direction == dir) {
1234 e.compare(r, f, TestCase::kSameUpToPE_ComparisonExpe cation); 1263 e.compare(r, f, TestCase::kSameUpToPE_ComparisonExpe cation);
1235 g.compare(r, h, TestCase::kSameUpToPE_ComparisonExpe cation); 1264 g.compare(r, h, TestCase::kSameUpToPE_ComparisonExpe cation);
1236 } else { 1265 } else {
1237 e.compare(r, f, TestCase::kAllDifferent_ComparisonEx pecation); 1266 e.compare(r, f, TestCase::kAllDifferent_ComparisonEx pecation);
1238 g.compare(r, h, TestCase::kAllDifferent_ComparisonEx pecation); 1267 g.compare(r, h, TestCase::kAllDifferent_ComparisonEx pecation);
1239 } 1268 }
1240 } else { 1269 } else {
1270 TestCase f(inverted ? exampleInvStrokeCase : exampleStro keCase, r);
1271 TestCase h(inverted ? exampleInvHairlineCase : exampleHa irlineCase, r);
1241 REPORTER_ASSERT(r, !strokeCase.style().pathEffect()); 1272 REPORTER_ASSERT(r, !strokeCase.style().pathEffect());
1242 REPORTER_ASSERT(r, !hairlineCase.style().pathEffect()); 1273 REPORTER_ASSERT(r, !hairlineCase.style().pathEffect());
1243 e.compare(r, f, TestCase::kAllSame_ComparisonExpecation) ; 1274 e.compare(r, f, TestCase::kAllSame_ComparisonExpecation) ;
1244 g.compare(r, h, TestCase::kAllSame_ComparisonExpecation) ; 1275 g.compare(r, h, TestCase::kAllSame_ComparisonExpecation) ;
1245 } 1276 }
1246 } 1277 }
1247 } 1278 }
1248 } 1279 }
1249 } 1280 }
1250 } 1281 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 [](SkPaint* p, SkPaint::Join j) { p->setStrokeJoin(j);}, 1409 [](SkPaint* p, SkPaint::Join j) { p->setStrokeJoin(j);},
1379 SkPaint::kMiter_Join, SkPaint::kRound_Join); 1410 SkPaint::kMiter_Join, SkPaint::kRound_Join);
1380 test_stroke_cap(reporter, path); 1411 test_stroke_cap(reporter, path);
1381 test_miter_limit(reporter, path); 1412 test_miter_limit(reporter, path);
1382 test_unknown_path_effect(reporter, path); 1413 test_unknown_path_effect(reporter, path);
1383 test_path_effect_makes_empty_shape(reporter, path); 1414 test_path_effect_makes_empty_shape(reporter, path);
1384 test_path_effect_fails(reporter, path); 1415 test_path_effect_fails(reporter, path);
1385 test_make_hairline_path_effect(reporter, path, testPath.fIsRRectForS troke); 1416 test_make_hairline_path_effect(reporter, path, testPath.fIsRRectForS troke);
1386 } 1417 }
1387 } 1418 }
1419
1388 for (auto testPath : paths) { 1420 for (auto testPath : paths) {
1389 const SkPath& path = testPath.fPath; 1421 const SkPath& path = testPath.fPath;
1390 1422
1391 SkPaint fillPaint; 1423 SkPaint fillPaint;
1392 TestCase fillPathCase(path, fillPaint, reporter); 1424 TestCase fillPathCase(path, fillPaint, reporter);
1393 SkRRect rrect; 1425 SkRRect rrect;
1394 REPORTER_ASSERT(reporter, testPath.fIsRRectForFill == 1426 REPORTER_ASSERT(reporter, testPath.fIsRRectForFill ==
1395 fillPathCase.baseShape().asRRect(&rrect, nullp tr, nullptr, 1427 fillPathCase.baseShape().asRRect(&rrect, nullp tr, nullptr,
1396 nullptr)); 1428 nullptr));
1397 if (testPath.fIsRRectForFill) { 1429 if (testPath.fIsRRectForFill) {
(...skipping 20 matching lines...) Expand all
1418 REPORTER_ASSERT(reporter, testPath.fIsLine == strokePathCase.baseShape() .asLine(nullptr)); 1450 REPORTER_ASSERT(reporter, testPath.fIsLine == strokePathCase.baseShape() .asLine(nullptr));
1419 } 1451 }
1420 1452
1421 // Test a volatile empty path. 1453 // Test a volatile empty path.
1422 test_volatile_path(reporter, SkPath(), true); 1454 test_volatile_path(reporter, SkPath(), true);
1423 1455
1424 test_empty_shape(reporter); 1456 test_empty_shape(reporter);
1425 } 1457 }
1426 1458
1427 #endif 1459 #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