OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
9 #include "SkCodec_libico.h" | 9 #include "SkCodec_libico.h" |
10 #include "SkCodec_libpng.h" | 10 #include "SkCodec_libpng.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 embeddedAlpha = dstInfo.alphaType(); | 265 embeddedAlpha = dstInfo.alphaType(); |
266 break; | 266 break; |
267 case kOpaque_SkAlphaType: | 267 case kOpaque_SkAlphaType: |
268 // If the embedded codec claims it is opaque, decode as if i
t is opaque. | 268 // If the embedded codec claims it is opaque, decode as if i
t is opaque. |
269 break; | 269 break; |
270 default: | 270 default: |
271 SkASSERT(false); | 271 SkASSERT(false); |
272 break; | 272 break; |
273 } | 273 } |
274 SkImageInfo info = dstInfo.makeAlphaType(embeddedAlpha); | 274 SkImageInfo info = dstInfo.makeAlphaType(embeddedAlpha); |
275 result = embeddedCodec->getPixels(dstInfo, dst, dstRowBytes, &opts,
ct, ptr); | 275 result = embeddedCodec->getPixels(info, dst, dstRowBytes, &opts, ct,
ptr); |
276 | 276 |
277 // On a fatal error, keep trying to find an image to decode | 277 // On a fatal error, keep trying to find an image to decode |
278 if (kInvalidConversion == result || kInvalidInput == result || | 278 if (kInvalidConversion == result || kInvalidInput == result || |
279 kInvalidScale == result) { | 279 kInvalidScale == result) { |
280 SkCodecPrintf("Warning: Attempt to decode candidate ico failed.\
n"); | 280 SkCodecPrintf("Warning: Attempt to decode candidate ico failed.\
n"); |
281 continue; | 281 continue; |
282 } | 282 } |
283 | 283 |
284 // On success or partial success, return the result | 284 // On success or partial success, return the result |
285 return result; | 285 return result; |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 SkCodecPrintf("Error: No matching candidate image in ico.\n"); | 289 SkCodecPrintf("Error: No matching candidate image in ico.\n"); |
290 return result; | 290 return result; |
291 } | 291 } |
OLD | NEW |