| 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 "CopyTilesRenderer.h" | 8 #include "CopyTilesRenderer.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkDevice.h" | 10 #include "SkDevice.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 SkString inputFilename; | 142 SkString inputFilename; |
| 143 sk_tools::get_basename(&inputFilename, inputPath); | 143 sk_tools::get_basename(&inputFilename, inputPath); |
| 144 | 144 |
| 145 SkFILEStream inputStream; | 145 SkFILEStream inputStream; |
| 146 inputStream.setPath(inputPath.c_str()); | 146 inputStream.setPath(inputPath.c_str()); |
| 147 if (!inputStream.isValid()) { | 147 if (!inputStream.isValid()) { |
| 148 SkDebugf("Could not open file %s\n", inputPath.c_str()); | 148 SkDebugf("Could not open file %s\n", inputPath.c_str()); |
| 149 return false; | 149 return false; |
| 150 } | 150 } |
| 151 | 151 |
| 152 SkDebugf("deserializing... %s\n", inputPath.c_str()); |
| 153 |
| 152 bool success = false; | 154 bool success = false; |
| 153 SkPicture* picture; | 155 SkPicture* picture; |
| 154 if (FLAGS_deferImageDecoding) { | 156 if (FLAGS_deferImageDecoding) { |
| 155 picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &lazy_decode_bi
tmap)); | 157 picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &lazy_decode_bi
tmap)); |
| 156 } else if (FLAGS_writeEncodedImages) { | 158 } else if (FLAGS_writeEncodedImages) { |
| 157 SkASSERT(!FLAGS_writePath.isEmpty()); | 159 SkASSERT(!FLAGS_writePath.isEmpty()); |
| 158 reset_image_file_base_name(inputFilename); | 160 reset_image_file_base_name(inputFilename); |
| 159 picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &write_image_to
_file)); | 161 picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &write_image_to
_file)); |
| 160 } else { | 162 } else { |
| 161 picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &SkImageDecoder
::DecodeMemory)); | 163 picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &SkImageDecoder
::DecodeMemory)); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 #endif | 442 #endif |
| 441 #endif | 443 #endif |
| 442 return 0; | 444 return 0; |
| 443 } | 445 } |
| 444 | 446 |
| 445 #if !defined SK_BUILD_FOR_IOS | 447 #if !defined SK_BUILD_FOR_IOS |
| 446 int main(int argc, char * const argv[]) { | 448 int main(int argc, char * const argv[]) { |
| 447 return tool_main(argc, (char**) argv); | 449 return tool_main(argc, (char**) argv); |
| 448 } | 450 } |
| 449 #endif | 451 #endif |
| OLD | NEW |