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 "LazyDecodeBitmap.h" | 8 #include "LazyDecodeBitmap.h" |
9 #include "SkLua.h" | 9 #include "SkLua.h" |
10 #include "SkLuaCanvas.h" | 10 #include "SkLuaCanvas.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 moduloStr.printf("[%d.%d] ", i, moduloDivisor); | 147 moduloStr.printf("[%d.%d] ", i, moduloDivisor); |
148 } | 148 } |
149 const char* path = paths[i].c_str(); | 149 const char* path = paths[i].c_str(); |
150 if (!FLAGS_quiet) { | 150 if (!FLAGS_quiet) { |
151 SkDebugf("scraping %s %s\n", path, moduloStr.c_str()); | 151 SkDebugf("scraping %s %s\n", path, moduloStr.c_str()); |
152 } | 152 } |
153 | 153 |
154 SkAutoTUnref<SkPicture> pic(load_picture(path)); | 154 SkAutoTUnref<SkPicture> pic(load_picture(path)); |
155 if (pic.get()) { | 155 if (pic.get()) { |
156 SkAutoTUnref<SkLuaCanvas> canvas( | 156 SkAutoTUnref<SkLuaCanvas> canvas( |
157 new SkLuaCanvas(pic->width(), pic->height(), | 157 new SkLuaCanvas(SkScalarCeilToInt(pic->cullR
ect().width()), |
| 158 SkScalarCeilToInt(pic->cullR
ect().height()), |
158 L.get(), gAccumulateFunc)); | 159 L.get(), gAccumulateFunc)); |
159 | 160 |
160 call_canvas(L.get(), canvas.get(), path, gStartCanvasFunc); | 161 call_canvas(L.get(), canvas.get(), path, gStartCanvasFunc); |
161 canvas->drawPicture(pic); | 162 canvas->drawPicture(pic); |
162 call_canvas(L.get(), canvas.get(), path, gEndCanvasFunc); | 163 call_canvas(L.get(), canvas.get(), path, gEndCanvasFunc); |
163 | 164 |
164 } else { | 165 } else { |
165 SkDebugf("failed to load\n"); | 166 SkDebugf("failed to load\n"); |
166 } | 167 } |
167 } | 168 } |
168 } | 169 } |
169 return 0; | 170 return 0; |
170 } | 171 } |
171 | 172 |
172 #if !defined SK_BUILD_FOR_IOS | 173 #if !defined SK_BUILD_FOR_IOS |
173 int main(int argc, char * const argv[]) { | 174 int main(int argc, char * const argv[]) { |
174 return tool_main(argc, (char**) argv); | 175 return tool_main(argc, (char**) argv); |
175 } | 176 } |
176 #endif | 177 #endif |
OLD | NEW |