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 "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 Loading... |
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 } |
OLD | NEW |