OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |