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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(pic->width(), pic->height(), |
158 L.get(), gAccumulateFunc)); | 158 L.get(), gAccumulateFunc)); |
159 | 159 |
160 call_canvas(L.get(), canvas.get(), path, gStartCanvasFunc); | 160 call_canvas(L.get(), canvas.get(), path, gStartCanvasFunc); |
161 canvas->drawPicture(*pic); | 161 canvas->drawPicture(pic); |
162 call_canvas(L.get(), canvas.get(), path, gEndCanvasFunc); | 162 call_canvas(L.get(), canvas.get(), path, gEndCanvasFunc); |
163 | 163 |
164 } else { | 164 } else { |
165 SkDebugf("failed to load\n"); | 165 SkDebugf("failed to load\n"); |
166 } | 166 } |
167 } | 167 } |
168 } | 168 } |
169 return 0; | 169 return 0; |
170 } | 170 } |
171 | 171 |
172 #if !defined SK_BUILD_FOR_IOS | 172 #if !defined SK_BUILD_FOR_IOS |
173 int main(int argc, char * const argv[]) { | 173 int main(int argc, char * const argv[]) { |
174 return tool_main(argc, (char**) argv); | 174 return tool_main(argc, (char**) argv); |
175 } | 175 } |
176 #endif | 176 #endif |
OLD | NEW |