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

Side by Side Diff: tools/bench_pictures_main.cpp

Issue 540963002: Change SkPicture::draw to playback (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "BenchLogger.h" 8 #include "BenchLogger.h"
9 #include "Timer.h" 9 #include "Timer.h"
10 #include "CopyTilesRenderer.h" 10 #include "CopyTilesRenderer.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 SkString err; 194 SkString err;
195 err.printf("Could not read an SkPicture from %s\n", inputPath.c_str()); 195 err.printf("Could not read an SkPicture from %s\n", inputPath.c_str());
196 gLogger.logError(err); 196 gLogger.logError(err);
197 return false; 197 return false;
198 } 198 }
199 199
200 if (FLAGS_preprocess) { 200 if (FLAGS_preprocess) {
201 // Because the GPU preprocessing step relies on the in-memory picture 201 // Because the GPU preprocessing step relies on the in-memory picture
202 // statistics we need to rerecord the picture here 202 // statistics we need to rerecord the picture here
203 SkPictureRecorder recorder; 203 SkPictureRecorder recorder;
204 picture->draw(recorder.beginRecording(picture->cullRect().width(), 204 picture->playback(recorder.beginRecording(picture->cullRect().width(),
205 picture->cullRect().height(), 205 picture->cullRect().height(),
206 NULL, 0)); 206 NULL, 0));
207 picture.reset(recorder.endRecording()); 207 picture.reset(recorder.endRecording());
208 } 208 }
209 209
210 SkString filename = SkOSPath::Basename(inputPath.c_str()); 210 SkString filename = SkOSPath::Basename(inputPath.c_str());
211 211
212 gWriter.bench(filename.c_str(), 212 gWriter.bench(filename.c_str(),
213 SkScalarCeilToInt(picture->cullRect().width()), 213 SkScalarCeilToInt(picture->cullRect().width()),
214 SkScalarCeilToInt(picture->cullRect().height())); 214 SkScalarCeilToInt(picture->cullRect().height()));
215 215
216 benchmark.run(picture); 216 benchmark.run(picture);
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 #endif 478 #endif
479 gWriter.end(); 479 gWriter.end();
480 return 0; 480 return 0;
481 } 481 }
482 482
483 #if !defined SK_BUILD_FOR_IOS 483 #if !defined SK_BUILD_FOR_IOS
484 int main(int argc, char * const argv[]) { 484 int main(int argc, char * const argv[]) {
485 return tool_main(argc, (char**) argv); 485 return tool_main(argc, (char**) argv);
486 } 486 }
487 #endif 487 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698