OLD | NEW |
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = SkScalarCeilToInt(src->cullRect().width()); | 60 const int w = SkScalarCeilToInt(src->cullRect().width()); |
61 const int h = SkScalarCeilToInt(src->cullRect().height()); | 61 const int h = SkScalarCeilToInt(src->cullRect().height()); |
62 | 62 |
63 SkRecord record; | 63 SkRecord record; |
64 SkRecorder canvas(&record, w, h); | 64 SkRecorder canvas(&record, w, h); |
65 src->draw(&canvas); | 65 src->playback(&canvas); |
66 | 66 |
67 if (FLAGS_optimize) { | 67 if (FLAGS_optimize) { |
68 SkRecordOptimize(&record); | 68 SkRecordOptimize(&record); |
69 } | 69 } |
70 | 70 |
71 dump(FLAGS_skps[i], w, h, record); | 71 dump(FLAGS_skps[i], w, h, record); |
72 } | 72 } |
73 | 73 |
74 return 0; | 74 return 0; |
75 } | 75 } |
76 | 76 |
77 #if !defined SK_BUILD_FOR_IOS | 77 #if !defined SK_BUILD_FOR_IOS |
78 int main(int argc, char * const argv[]) { | 78 int main(int argc, char * const argv[]) { |
79 return tool_main(argc, (char**) argv); | 79 return tool_main(argc, (char**) argv); |
80 } | 80 } |
81 #endif | 81 #endif |
OLD | NEW |