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

Side by Side Diff: tools/lua/lua_pictures.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT again Created 6 years, 3 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/gpuveto.cpp ('k') | tools/pinspect.cpp » ('j') | 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 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
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
OLDNEW
« no previous file with comments | « tools/gpuveto.cpp ('k') | tools/pinspect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698