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

Side by Side Diff: tools/dump_record.cpp

Issue 290653004: Remove SkRecorder's kWriteOnly mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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 | « tools/bench_playback.cpp ('k') | 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 <stdio.h> 8 #include <stdio.h>
9 9
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 SkAutoTUnref<SkPicture> src( 54 SkAutoTUnref<SkPicture> src(
55 SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap)) ; 55 SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap)) ;
56 if (!src) { 56 if (!src) {
57 SkDebugf("Could not read %s as an SkPicture.\n", FLAGS_skps[i]); 57 SkDebugf("Could not read %s as an SkPicture.\n", FLAGS_skps[i]);
58 exit(1); 58 exit(1);
59 } 59 }
60 const int w = src->width(), h = src->height(); 60 const int w = src->width(), h = src->height();
61 61
62 SkRecord record; 62 SkRecord record;
63 SkRecorder canvas(SkRecorder::kWriteOnly_Mode, &record, w, h); 63 SkRecorder canvas(&record, w, h);
64 src->draw(&canvas); 64 src->draw(&canvas);
65 65
66
67 if (FLAGS_optimize) { 66 if (FLAGS_optimize) {
68 SkRecordOptimize(&record); 67 SkRecordOptimize(&record);
69 } 68 }
70 69
71 dump(FLAGS_skps[i], w, h, record); 70 dump(FLAGS_skps[i], w, h, record);
72 } 71 }
73 72
74 return 0; 73 return 0;
75 } 74 }
76 75
77 #if !defined SK_BUILD_FOR_IOS 76 #if !defined SK_BUILD_FOR_IOS
78 int main(int argc, char * const argv[]) { 77 int main(int argc, char * const argv[]) {
79 return tool_main(argc, (char**) argv); 78 return tool_main(argc, (char**) argv);
80 } 79 }
81 #endif 80 #endif
OLDNEW
« no previous file with comments | « tools/bench_playback.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698