| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 SkPicture* picture = SkPicture::CreateFromStream(&inputStream, proc); | 175 SkPicture* picture = SkPicture::CreateFromStream(&inputStream, proc); |
| 176 | 176 |
| 177 if (NULL == picture) { | 177 if (NULL == picture) { |
| 178 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str()); | 178 SkDebugf("Could not read an SkPicture from %s\n", inputPath.c_str()); |
| 179 return false; | 179 return false; |
| 180 } | 180 } |
| 181 | 181 |
| 182 while (FLAGS_bench_record) { | 182 while (FLAGS_bench_record) { |
| 183 const int kRecordFlags = 0; | 183 const int kRecordFlags = 0; |
| 184 SkPicture other; | 184 SkPictureRecorder recorder; |
| 185 picture->draw(other.beginRecording(picture->width(), picture->height(),
kRecordFlags)); | 185 picture->draw(recorder.beginRecording(picture->width(), picture->height(
), kRecordFlags)); |
| 186 other.endRecording(); | 186 SkAutoTUnref<SkPicture> other(recorder.endRecording()); |
| 187 } | 187 } |
| 188 | 188 |
| 189 for (int i = 0; i < FLAGS_clone; ++i) { | 189 for (int i = 0; i < FLAGS_clone; ++i) { |
| 190 SkPicture* clone = picture->clone(); | 190 SkPicture* clone = picture->clone(); |
| 191 SkDELETE(picture); | 191 SkDELETE(picture); |
| 192 picture = clone; | 192 picture = clone; |
| 193 } | 193 } |
| 194 | 194 |
| 195 SkDebugf("drawing... [%i %i] %s\n", picture->width(), picture->height(), | 195 SkDebugf("drawing... [%i %i] %s\n", picture->width(), picture->height(), |
| 196 inputPath.c_str()); | 196 inputPath.c_str()); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); | 494 jsonSummary.writeToFile(FLAGS_writeJsonSummaryPath[0]); |
| 495 } | 495 } |
| 496 return 0; | 496 return 0; |
| 497 } | 497 } |
| 498 | 498 |
| 499 #if !defined SK_BUILD_FOR_IOS | 499 #if !defined SK_BUILD_FOR_IOS |
| 500 int main(int argc, char * const argv[]) { | 500 int main(int argc, char * const argv[]) { |
| 501 return tool_main(argc, (char**) argv); | 501 return tool_main(argc, (char**) argv); |
| 502 } | 502 } |
| 503 #endif | 503 #endif |
| OLD | NEW |