OLD | NEW |
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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 SkImageDecoder* codec = SkImageDecoder::Factory(&stream); | 102 SkImageDecoder* codec = SkImageDecoder::Factory(&stream); |
103 if (NULL == codec) { | 103 if (NULL == codec) { |
104 return; | 104 return; |
105 } | 105 } |
106 | 106 |
107 SkAutoTDelete<SkImageDecoder> ad(codec); | 107 SkAutoTDelete<SkImageDecoder> ad(codec); |
108 | 108 |
109 stream.rewind(); | 109 stream.rewind(); |
110 | 110 |
111 if (!codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config, | 111 if (!codec->decode(&stream, &bitmap, kN32_SkColorType, SkImageDecoder::kDeco
dePixels_Mode)) { |
112 SkImageDecoder::kDecodePixels_Mode)) { | |
113 return; | 112 return; |
114 } | 113 } |
115 | 114 |
116 write_bitmap(srcPath, bitmap); | 115 write_bitmap(srcPath, bitmap); |
117 } | 116 } |
118 | 117 |
119 /** | 118 /** |
120 * Return true if the filename represents an image. | 119 * Return true if the filename represents an image. |
121 */ | 120 */ |
122 static bool is_image_file(const char* filename) { | 121 static bool is_image_file(const char* filename) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 166 } |
168 | 167 |
169 return 0; | 168 return 0; |
170 } | 169 } |
171 | 170 |
172 #if !defined SK_BUILD_FOR_IOS | 171 #if !defined SK_BUILD_FOR_IOS |
173 int main(int argc, char * const argv[]) { | 172 int main(int argc, char * const argv[]) { |
174 return tool_main(argc, (char**) argv); | 173 return tool_main(argc, (char**) argv); |
175 } | 174 } |
176 #endif | 175 #endif |
OLD | NEW |