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

Side by Side Diff: tests/ClipStackTest.cpp

Issue 2244223004: Make GrReducedClip's gen ID only apply to the element list (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix GrReducedClip::fGenID to be kEmpty/kWideOpen when appropriate Created 4 years, 4 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
« src/gpu/GrReducedClip.cpp ('K') | « src/gpu/GrReducedClip.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 2011 Google Inc. 2 * Copyright 2011 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 "Test.h" 8 #include "Test.h"
9 #include "SkClipStack.h" 9 #include "SkClipStack.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 queryXform.mapRect(&queryBounds, preXformQuery); 1189 queryXform.mapRect(&queryBounds, preXformQuery);
1190 const GrReducedClip reduced(stack, queryBounds); 1190 const GrReducedClip reduced(stack, queryBounds);
1191 1191
1192 SkClipStack::BoundsType stackBoundsType; 1192 SkClipStack::BoundsType stackBoundsType;
1193 SkRect stackBounds; 1193 SkRect stackBounds;
1194 stack.getBounds(&stackBounds, &stackBoundsType); 1194 stack.getBounds(&stackBounds, &stackBoundsType);
1195 1195
1196 switch (expectedMethod) { 1196 switch (expectedMethod) {
1197 case ClipMethod::kSkipDraw: 1197 case ClipMethod::kSkipDraw:
1198 SkASSERT(0 == numExpectedElems); 1198 SkASSERT(0 == numExpectedElems);
1199 REPORTER_ASSERT_MESSAGE(reporter, SkClipStack::kEmptyGenID == reduce d.genID(),
1200 testName.c_str());
1199 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), test Name.c_str()); 1201 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), test Name.c_str());
1200 REPORTER_ASSERT_MESSAGE(reporter, 1202 REPORTER_ASSERT_MESSAGE(reporter,
1201 GrReducedClip::InitialState::kAllOut == redu ced.initialState(), 1203 GrReducedClip::InitialState::kAllOut == redu ced.initialState(),
1202 testName.c_str()); 1204 testName.c_str());
1203 return; 1205 return;
1204 case ClipMethod::kIgnoreClip: 1206 case ClipMethod::kIgnoreClip:
1205 SkASSERT(0 == numExpectedElems); 1207 SkASSERT(0 == numExpectedElems);
1208 SkASSERT(SkClipStack::kWideOpenGenID == reduced.genID());
1209 REPORTER_ASSERT_MESSAGE(reporter, SkClipStack::kWideOpenGenID == red uced.genID(),
1210 testName.c_str());
1206 REPORTER_ASSERT_MESSAGE(reporter, 1211 REPORTER_ASSERT_MESSAGE(reporter,
1207 !reduced.hasIBounds() || 1212 !reduced.hasIBounds() ||
1208 GrClip::IsInsideClip(reduced.ibounds(), quer yBounds), 1213 GrClip::IsInsideClip(reduced.ibounds(), quer yBounds),
1209 testName.c_str()); 1214 testName.c_str());
1210 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), test Name.c_str()); 1215 REPORTER_ASSERT_MESSAGE(reporter, reduced.elements().isEmpty(), test Name.c_str());
1211 REPORTER_ASSERT_MESSAGE(reporter, 1216 REPORTER_ASSERT_MESSAGE(reporter,
1212 GrReducedClip::InitialState::kAllIn == reduc ed.initialState(), 1217 GrReducedClip::InitialState::kAllIn == reduc ed.initialState(),
1213 testName.c_str()); 1218 testName.c_str());
1214 return; 1219 return;
1215 case ClipMethod::kScissor: { 1220 case ClipMethod::kScissor: {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 test_path_replace(reporter); 1381 test_path_replace(reporter);
1377 test_quickContains(reporter); 1382 test_quickContains(reporter);
1378 test_invfill_diff_bug(reporter); 1383 test_invfill_diff_bug(reporter);
1379 #if SK_SUPPORT_GPU 1384 #if SK_SUPPORT_GPU
1380 test_reduced_clip_stack(reporter); 1385 test_reduced_clip_stack(reporter);
1381 test_reduced_clip_stack_genid(reporter); 1386 test_reduced_clip_stack_genid(reporter);
1382 test_reduced_clip_stack_no_aa_crash(reporter); 1387 test_reduced_clip_stack_no_aa_crash(reporter);
1383 test_reduced_clip_stack_aa(reporter); 1388 test_reduced_clip_stack_aa(reporter);
1384 #endif 1389 #endif
1385 } 1390 }
OLDNEW
« src/gpu/GrReducedClip.cpp ('K') | « src/gpu/GrReducedClip.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698