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

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

Issue 233813004: Revert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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 | « src/image/SkSurface_Raster.cpp ('k') | src/ports/SkImageDecoder_CG.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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return NULL; 235 return NULL;
236 } 236 }
237 237
238 SkImageInfo info = bitmap.info(); 238 SkImageInfo info = bitmap.info();
239 239
240 if (!opts.fUseRequestedColorType) { 240 if (!opts.fUseRequestedColorType) {
241 // Use default 241 // Use default
242 if (kIndex_8_SkColorType == bitmap.colorType()) { 242 if (kIndex_8_SkColorType == bitmap.colorType()) {
243 // We don't support kIndex8 because we don't support 243 // We don't support kIndex8 because we don't support
244 // colortables in this workflow. 244 // colortables in this workflow.
245 info.fColorType = kPMColor_SkColorType; 245 info.fColorType = kN32_SkColorType;
246 } 246 }
247 } else { 247 } else {
248 if (!bitmap.canCopyTo(opts.fRequestedColorType)) { 248 if (!bitmap.canCopyTo(opts.fRequestedColorType)) {
249 SkASSERT(bitmap.colorType() != opts.fRequestedColorType); 249 SkASSERT(bitmap.colorType() != opts.fRequestedColorType);
250 return NULL; // Can not translate to needed config. 250 return NULL; // Can not translate to needed config.
251 } 251 }
252 info.fColorType = opts.fRequestedColorType; 252 info.fColorType = opts.fRequestedColorType;
253 } 253 }
254 254
255 if (opts.fRequireUnpremul && info.fAlphaType != kOpaque_SkAlphaType) { 255 if (opts.fRequireUnpremul && info.fAlphaType != kOpaque_SkAlphaType) {
(...skipping 25 matching lines...) Expand all
281 SkStreamRewindable* stream, 281 SkStreamRewindable* stream,
282 const SkDecodingImageGenerator::Options& opts) { 282 const SkDecodingImageGenerator::Options& opts) {
283 SkASSERT(stream != NULL); 283 SkASSERT(stream != NULL);
284 SkASSERT(stream->unique()); 284 SkASSERT(stream->unique());
285 if ((stream == NULL) || !stream->unique()) { 285 if ((stream == NULL) || !stream->unique()) {
286 SkSafeUnref(stream); 286 SkSafeUnref(stream);
287 return NULL; 287 return NULL;
288 } 288 }
289 return CreateDecodingImageGenerator(NULL, stream, opts); 289 return CreateDecodingImageGenerator(NULL, stream, opts);
290 } 290 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Raster.cpp ('k') | src/ports/SkImageDecoder_CG.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698