Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: src/codec/SkCodec_libico.cpp

Issue 1327963004: Ico bug fix for opaque embedded images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698