OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkLua.h" | 8 #include "SkLua.h" |
9 #include "SkLuaCanvas.h" | 9 #include "SkLuaCanvas.h" |
10 #include "SkPicture.h" | 10 #include "SkPicture.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 moduloStr.printf("[%d.%d] ", i, moduloDivisor); | 138 moduloStr.printf("[%d.%d] ", i, moduloDivisor); |
139 } | 139 } |
140 const char* path = paths[i].c_str(); | 140 const char* path = paths[i].c_str(); |
141 if (!FLAGS_quiet) { | 141 if (!FLAGS_quiet) { |
142 SkDebugf("scraping %s %s\n", path, moduloStr.c_str()); | 142 SkDebugf("scraping %s %s\n", path, moduloStr.c_str()); |
143 } | 143 } |
144 | 144 |
145 auto pic(load_picture(path)); | 145 auto pic(load_picture(path)); |
146 if (pic.get()) { | 146 if (pic.get()) { |
147 SkAutoTUnref<SkLuaCanvas> canvas( | 147 SkAutoTUnref<SkLuaCanvas> canvas( |
148 new SkLuaCanvas(SkScalarCeilToInt(pic->cullR
ect().width()), | 148 new SkLuaCanvas(SkScalarCeilToInt(pic->cullR
ect().width()), |
149 SkScalarCeilToInt(pic->cullR
ect().height()), | 149 SkScalarCeilToInt(pic->cullR
ect().height()), |
150 L.get(), gAccumulateFunc)); | 150 L.get(), gAccumulateFunc)); |
151 | 151 |
152 call_canvas(L.get(), canvas.get(), path, gStartCanvasFunc); | 152 call_canvas(L.get(), canvas.get(), path, gStartCanvasFunc); |
153 canvas->drawPicture(pic); | 153 canvas->drawPicture(pic); |
154 call_canvas(L.get(), canvas.get(), path, gEndCanvasFunc); | 154 call_canvas(L.get(), canvas.get(), path, gEndCanvasFunc); |
155 | 155 |
156 } else { | 156 } else { |
157 SkDebugf("failed to load\n"); | 157 SkDebugf("failed to load\n"); |
158 } | 158 } |
159 } | 159 } |
160 } | 160 } |
161 return 0; | 161 return 0; |
162 } | 162 } |
163 | 163 |
164 #if !defined SK_BUILD_FOR_IOS | 164 #if !defined SK_BUILD_FOR_IOS |
165 int main(int argc, char * const argv[]) { | 165 int main(int argc, char * const argv[]) { |
166 return tool_main(argc, (char**) argv); | 166 return tool_main(argc, (char**) argv); |
167 } | 167 } |
168 #endif | 168 #endif |
OLD | NEW |