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

Side by Side Diff: tools/render_pictures_main.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/render_pdfs_main.cpp ('k') | tools/skpinfo.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 2012 Google Inc. 2 * Copyright 2012 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 "CopyTilesRenderer.h" 9 #include "CopyTilesRenderer.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 if (NULL == picture) { 178 if (NULL == picture) {
179 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str()); 179 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str());
180 return false; 180 return false;
181 } 181 }
182 182
183 if (FLAGS_preprocess) { 183 if (FLAGS_preprocess) {
184 // Because the GPU preprocessing step relies on the in-memory picture 184 // Because the GPU preprocessing step relies on the in-memory picture
185 // statistics we need to rerecord the picture here 185 // statistics we need to rerecord the picture here
186 SkPictureRecorder recorder; 186 SkPictureRecorder recorder;
187 picture->draw(recorder.beginRecording(picture->width(), picture->height( ), NULL, 0)); 187 picture->draw(recorder.beginRecording(picture->cullRect().width(),
188 picture->cullRect().height(),
189 NULL, 0));
188 picture.reset(recorder.endRecording()); 190 picture.reset(recorder.endRecording());
189 } 191 }
190 192
191 while (FLAGS_bench_record) { 193 while (FLAGS_bench_record) {
192 SkPictureRecorder recorder; 194 SkPictureRecorder recorder;
193 picture->draw(recorder.beginRecording(picture->width(), picture->height( ), NULL, 0)); 195 picture->draw(recorder.beginRecording(picture->cullRect().width(),
196 picture->cullRect().height(),
197 NULL, 0));
194 SkAutoTUnref<SkPicture> other(recorder.endRecording()); 198 SkAutoTUnref<SkPicture> other(recorder.endRecording());
195 } 199 }
196 200
197 SkDebugf("drawing... [%i %i] %s\n", picture->width(), picture->height(), 201 SkDebugf("drawing... [%f %f %f %f] %s\n",
202 picture->cullRect().fLeft, picture->cullRect().fTop,
203 picture->cullRect().fRight, picture->cullRect().fBottom,
198 inputPath.c_str()); 204 inputPath.c_str());
199 205
200 renderer.init(picture, &writePathString, &mismatchPathString, &inputFilename , 206 renderer.init(picture, &writePathString, &mismatchPathString, &inputFilename ,
201 FLAGS_writeChecksumBasedFilenames); 207 FLAGS_writeChecksumBasedFilenames);
202 208
203 if (FLAGS_preprocess) { 209 if (FLAGS_preprocess) {
204 if (NULL != renderer.getCanvas()) { 210 if (NULL != renderer.getCanvas()) {
205 renderer.getCanvas()->EXPERIMENTAL_optimize(renderer.getPicture()); 211 renderer.getCanvas()->EXPERIMENTAL_optimize(renderer.getPicture());
206 } 212 }
207 } 213 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); 511 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]);
506 } 512 }
507 return 0; 513 return 0;
508 } 514 }
509 515
510 #if !defined SK_BUILD_FOR_IOS 516 #if !defined SK_BUILD_FOR_IOS
511 int main(int argc, char * const argv[]) { 517 int main(int argc, char * const argv[]) {
512 return tool_main(argc, (char**) argv); 518 return tool_main(argc, (char**) argv);
513 } 519 }
514 #endif 520 #endif
OLDNEW
« no previous file with comments | « tools/render_pdfs_main.cpp ('k') | tools/skpinfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698