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

Side by Side Diff: tools/render_pictures_main.cpp

Issue 214953003: split SkPictureRecorder out of SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: update to ToT (again) Created 6 years, 8 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 | Annotate | Revision Log
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 "LazyDecodeBitmap.h" 8 #include "LazyDecodeBitmap.h"
9 #include "CopyTilesRenderer.h" 9 #include "CopyTilesRenderer.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 SkPicture* picture = SkPicture::CreateFromStream(&inputStream, proc); 168 SkPicture* picture = SkPicture::CreateFromStream(&inputStream, proc);
169 169
170 if (NULL == picture) { 170 if (NULL == picture) {
171 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str()); 171 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str());
172 return false; 172 return false;
173 } 173 }
174 174
175 while (FLAGS_bench_record) { 175 while (FLAGS_bench_record) {
176 const int kRecordFlags = 0; 176 const int kRecordFlags = 0;
177 SkPicture other; 177 SkPictureRecorder recorder;
178 picture->draw(other.beginRecording(picture->width(), picture->height(), kRecordFlags)); 178 picture->draw(recorder.beginRecording(picture->width(), picture->height( ), kRecordFlags));
179 other.endRecording(); 179 SkAutoTUnref<SkPicture> other(recorder.endRecording());
180 } 180 }
181 181
182 for (int i = 0; i < FLAGS_clone; ++i) { 182 for (int i = 0; i < FLAGS_clone; ++i) {
183 SkPicture* clone = picture->clone(); 183 SkPicture* clone = picture->clone();
184 SkDELETE(picture); 184 SkDELETE(picture);
185 picture = clone; 185 picture = clone;
186 } 186 }
187 187
188 SkDebugf("drawing... [%i %i] %s\n", picture->width(), picture->height(), 188 SkDebugf("drawing... [%i %i] %s\n", picture->width(), picture->height(),
189 inputPath.c_str()); 189 inputPath.c_str());
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); 480 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]);
481 } 481 }
482 return 0; 482 return 0;
483 } 483 }
484 484
485 #if !defined SK_BUILD_FOR_IOS 485 #if !defined SK_BUILD_FOR_IOS
486 int main(int argc, char * const argv[]) { 486 int main(int argc, char * const argv[]) {
487 return tool_main(argc, (char**) argv); 487 return tool_main(argc, (char**) argv);
488 } 488 }
489 #endif 489 #endif
OLDNEW
« samplecode/SampleTiling.cpp ('K') | « tools/filtermain.cpp ('k') | tools/skpmaker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698