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

Side by Side Diff: src/android/SkBitmapRegionCodec.cpp

Issue 2319293003: Checking for valid colorType, alphaType, colorSpace in SkCodec (Closed)
Patch Set: Fix nanobench Created 4 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 | « dm/DMSrcSink.cpp ('k') | src/codec/SkBmpCodec.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 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 "SkAndroidCodec.h" 8 #include "SkAndroidCodec.h"
9 #include "SkBitmapRegionCodec.h" 9 #include "SkBitmapRegionCodec.h"
10 #include "SkBitmapRegionDecoderPriv.h" 10 #include "SkBitmapRegionDecoderPriv.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Intialize the color table 129 // Intialize the color table
130 if (kIndex_8_SkColorType == dstColorType) { 130 if (kIndex_8_SkColorType == dstColorType) {
131 colorTable->dangerous_overwriteColors(colors, maxColors); 131 colorTable->dangerous_overwriteColors(colors, maxColors);
132 } 132 }
133 133
134 return true; 134 return true;
135 } 135 }
136 136
137 bool SkBitmapRegionCodec::conversionSupported(SkColorType colorType) { 137 bool SkBitmapRegionCodec::conversionSupported(SkColorType colorType) {
138 return conversion_possible(fCodec->getInfo().makeColorType(colorType), fCode c->getInfo()); 138 // Enable legacy behavior.
139 sk_sp<SkColorSpace> colorSpace = nullptr;
140 SkImageInfo dstInfo = fCodec->getInfo().makeColorType(colorType).makeColorSp ace(colorSpace);
141 return conversion_possible_ignore_color_space(dstInfo, fCodec->getInfo());
139 } 142 }
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | src/codec/SkBmpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698