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

Side by Side Diff: src/images/SkDecodingImageGenerator.cpp

Issue 159173004: SkBitmap now really stores SkImageInfo -- config is just a ruse (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/image/SkImagePriv.cpp ('k') | tests/ImageDecodingTest.cpp » ('j') | 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 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 "SkData.h" 8 #include "SkData.h"
9 #include "SkDecodingImageGenerator.h" 9 #include "SkDecodingImageGenerator.h"
10 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 SkASSERT(bitmap.config() != config); 271 SkASSERT(bitmap.config() != config);
272 return NULL; // Can not translate to needed config. 272 return NULL; // Can not translate to needed config.
273 } 273 }
274 info.fWidth = bitmap.width(); 274 info.fWidth = bitmap.width();
275 info.fHeight = bitmap.height(); 275 info.fHeight = bitmap.height();
276 info.fColorType = opts.fRequestedColorType; 276 info.fColorType = opts.fRequestedColorType;
277 info.fAlphaType = bitmap.alphaType(); 277 info.fAlphaType = bitmap.alphaType();
278 278
279 // Sanity check. 279 // Sanity check.
280 SkDEBUGCODE(SkColorType tmp;) 280 SkDEBUGCODE(SkColorType tmp;)
281 SkASSERT(SkBitmapConfigToColorType(config, &tmp));
282 SkASSERT(tmp == opts.fRequestedColorType); 281 SkASSERT(tmp == opts.fRequestedColorType);
283 } 282 }
284 return SkNEW_ARGS(SkDecodingImageGenerator, 283 return SkNEW_ARGS(SkDecodingImageGenerator,
285 (data, autoStream.detach(), info, 284 (data, autoStream.detach(), info,
286 opts.fSampleSize, opts.fDitherImage, config)); 285 opts.fSampleSize, opts.fDitherImage, config));
287 } 286 }
OLDNEW
« no previous file with comments | « src/image/SkImagePriv.cpp ('k') | tests/ImageDecodingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698