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

Side by Side Diff: gm/recordopts.cpp

Issue 2095693002: Change loop bounds to be correct (and much less confusing) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « 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 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 SkColorSetARGB(255, 0, (kDetectorGreenValue + 1), 0) // This tests that detectors work. 183 SkColorSetARGB(255, 0, (kDetectorGreenValue + 1), 0) // This tests that detectors work.
184 }; 184 };
185 185
186 InstallDetectorFunc detectorInstallFuncs[] = { 186 InstallDetectorFunc detectorInstallFuncs[] = {
187 install_detector_image_filter, 187 install_detector_image_filter,
188 install_detector_color_filter 188 install_detector_color_filter
189 }; 189 };
190 190
191 for (size_t i = 0; i < SK_ARRAY_COUNT(shapeColors); ++i) { 191 for (size_t i = 0; i < SK_ARRAY_COUNT(shapeColors); ++i) {
192 shapeColor = shapeColors[i]; 192 shapeColor = shapeColors[i];
193 for (size_t j = 0; j < SK_ARRAY_COUNT(shapeColors); ++j) { 193 for (size_t j = 0; j < SK_ARRAY_COUNT(detectorInstallFuncs); ++j) {
reed1 2016/06/23 17:43:29 can we use the fancy style (and be perhaps even cl
194 InstallDetectorFunc detectorInstallFunc = detectorInstallFuncs[j]; 194 InstallDetectorFunc detectorInstallFunc = detectorInstallFuncs[j];
195 for (size_t k = 0; k < SK_ARRAY_COUNT(funcs); ++k) { 195 for (size_t k = 0; k < SK_ARRAY_COUNT(funcs); ++k) {
196 TestVariantSequence drawTestSequence = funcs[k]; 196 TestVariantSequence drawTestSequence = funcs[k];
197 canvas->save(); 197 canvas->save();
198 drawTestSequence(canvas, shapeColor, detectorInstallFunc); 198 drawTestSequence(canvas, shapeColor, detectorInstallFunc);
199 canvas->flush(); 199 canvas->flush();
200 canvas->translate(SkIntToScalar(kTestRectSize) + SkIntToScalar(1 ), SkIntToScalar(0)); 200 canvas->translate(SkIntToScalar(kTestRectSize) + SkIntToScalar(1 ), SkIntToScalar(0));
201 { 201 {
202 SkPictureRecorder recorder; 202 SkPictureRecorder recorder;
203 drawTestSequence(recorder.beginRecording(SkIntToScalar(kTest RectSize), 203 drawTestSequence(recorder.beginRecording(SkIntToScalar(kTest RectSize),
204 SkIntToScalar(kTest RectSize)), 204 SkIntToScalar(kTest RectSize)),
205 shapeColor, detectorInstallFunc); 205 shapeColor, detectorInstallFunc);
206 recorder.finishRecordingAsPicture()->playback(canvas); 206 recorder.finishRecordingAsPicture()->playback(canvas);
207 canvas->flush(); 207 canvas->flush();
208 } 208 }
209 209
210 canvas->restore(); 210 canvas->restore();
211 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize) + SkIntToScalar(1)); 211 canvas->translate(SkIntToScalar(0), SkIntToScalar(kTestRectSize) + SkIntToScalar(1));
212 } 212 }
213 213
214 } 214 }
215 } 215 }
216 } 216 }
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