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

Side by Side Diff: tests/RecordReplaceDrawTest.cpp

Issue 797633002: update test after I added a clip call, making the count odd (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « no previous file | 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 2014 Google Inc. 2 * Copyright 2014 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 #if SK_SUPPORT_GPU 8 #if SK_SUPPORT_GPU
9 9
10 #include "Test.h" 10 #include "Test.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 canvas->save(); 78 canvas->save();
79 canvas->scale(2, 2); 79 canvas->scale(2, 2);
80 pic.reset(recorder.endRecording()); 80 pic.reset(recorder.endRecording());
81 } 81 }
82 82
83 SkRecord rerecord; 83 SkRecord rerecord;
84 SkRecorder canvas(&rerecord, kWidth, kHeight); 84 SkRecorder canvas(&rerecord, kWidth, kHeight);
85 85
86 GrRecordReplaceDraw(pic, &canvas, NULL, SkMatrix::I(), NULL/*callback*/); 86 GrRecordReplaceDraw(pic, &canvas, NULL, SkMatrix::I(), NULL/*callback*/);
87 87
88 // ensure rerecord is balanced (in this case by checking that the count is e ven) 88 // ensure rerecord is balanced (in this case by checking that the count is o dd)
89 REPORTER_ASSERT(r, (rerecord.count() & 1) == 0); 89 REPORTER_ASSERT(r, (rerecord.count() & 1) == 1);
90 } 90 }
91 91
92 // Test out the layer replacement functionality with and w/o a BBH 92 // Test out the layer replacement functionality with and w/o a BBH
93 void test_replacements(skiatest::Reporter* r, GrContext* context, bool useBBH) { 93 void test_replacements(skiatest::Reporter* r, GrContext* context, bool useBBH) {
94 SkAutoTUnref<const SkPicture> pic; 94 SkAutoTUnref<const SkPicture> pic;
95 95
96 { 96 {
97 SkRTreeFactory bbhFactory; 97 SkRTreeFactory bbhFactory;
98 SkPictureRecorder recorder; 98 SkPictureRecorder recorder;
99 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kWidth), SkIntT oScalar(kHeight), 99 SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(kWidth), SkIntT oScalar(kHeight),
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (NULL == context) { 160 if (NULL == context) {
161 continue; 161 continue;
162 } 162 }
163 163
164 test_replacements(r, context, true); 164 test_replacements(r, context, true);
165 test_replacements(r, context, false); 165 test_replacements(r, context, false);
166 } 166 }
167 } 167 }
168 168
169 #endif 169 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698