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

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: added guard 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 SkPicture* picture = SkPicture::CreateFromStream(&inputStream, proc); 175 SkPicture* picture = SkPicture::CreateFromStream(&inputStream, proc);
176 176
177 if (NULL == picture) { 177 if (NULL == picture) {
178 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str()); 178 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str());
179 return false; 179 return false;
180 } 180 }
181 181
182 while (FLAGS_bench_record) { 182 while (FLAGS_bench_record) {
183 const int kRecordFlags = 0; 183 const int kRecordFlags = 0;
184 SkPicture other; 184 SkPictureRecorder recorder;
185 picture->draw(other.beginRecording(picture->width(), picture->height(), kRecordFlags)); 185 picture->draw(recorder.beginRecording(picture->width(), picture->height( ), kRecordFlags));
186 other.endRecording(); 186 SkAutoTUnref<SkPicture> other(recorder.endRecording());
187 } 187 }
188 188
189 for (int i = 0; i < FLAGS_clone; ++i) { 189 for (int i = 0; i < FLAGS_clone; ++i) {
190 SkPicture* clone = picture->clone(); 190 SkPicture* clone = picture->clone();
191 SkDELETE(picture); 191 SkDELETE(picture);
192 picture = clone; 192 picture = clone;
193 } 193 }
194 194
195 SkDebugf("drawing... [%i %i] %s\n", picture->width(), picture->height(), 195 SkDebugf("drawing... [%i %i] %s\n", picture->width(), picture->height(),
196 inputPath.c_str()); 196 inputPath.c_str());
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); 494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]);
495 } 495 }
496 return 0; 496 return 0;
497 } 497 }
498 498
499 #if !defined SK_BUILD_FOR_IOS 499 #if !defined SK_BUILD_FOR_IOS
500 int main(int argc, char * const argv[]) { 500 int main(int argc, char * const argv[]) {
501 return tool_main(argc, (char**) argv); 501 return tool_main(argc, (char**) argv);
502 } 502 }
503 #endif 503 #endif
OLDNEW
« include/core/SkPicture.h ('K') | « tools/filtermain.cpp ('k') | tools/skpmaker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698