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

Side by Side Diff: src/codec/SkCodecPriv.h

Issue 1667823004: Set sRGB flag for PNGs with an sRGB chunk (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Created 4 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
« no previous file with comments | « no previous file | src/codec/SkPngCodec.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 The Android Open Source Project 2 * Copyright 2015 The Android Open Source Project
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 #ifndef SkCodecPriv_DEFINED 8 #ifndef SkCodecPriv_DEFINED
9 #define SkCodecPriv_DEFINED 9 #define SkCodecPriv_DEFINED
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 /* 110 /*
111 * Most of our codecs support the same conversions: 111 * Most of our codecs support the same conversions:
112 * - profileType must be the same 112 * - profileType must be the same
113 * - opaque to any alpha type 113 * - opaque to any alpha type
114 * - 565 only if opaque 114 * - 565 only if opaque
115 * - premul to unpremul and vice versa 115 * - premul to unpremul and vice versa
116 * - always support N32 116 * - always support N32
117 * - otherwise match the src color type 117 * - otherwise match the src color type
118 */ 118 */
119 inline bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) { 119 inline bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src) {
120 if (dst.profileType() != src.profileType()) { 120 // FIXME: skbug.com/4895
121 // Currently, we treat both kLinear and ksRGB encoded images as if they are kLinear.
122 // This makes sense while we do not have proper support for ksRGB. This is also
123 // the reason why we always allow the client to request kLinear.
124 if (dst.profileType() != src.profileType() &&
125 kLinear_SkColorProfileType != dst.profileType()) {
121 return false; 126 return false;
122 } 127 }
123 128
124 // Ensure the alpha type is valid 129 // Ensure the alpha type is valid
125 if (!valid_alpha(dst.alphaType(), src.alphaType())) { 130 if (!valid_alpha(dst.alphaType(), src.alphaType())) {
126 return false; 131 return false;
127 } 132 }
128 133
129 // Check for supported color types 134 // Check for supported color types
130 switch (dst.colorType()) { 135 switch (dst.colorType()) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 uint32_t result; 241 uint32_t result;
237 memcpy(&result, &(buffer[i]), 4); 242 memcpy(&result, &(buffer[i]), 4);
238 #ifdef SK_CPU_BENDIAN 243 #ifdef SK_CPU_BENDIAN
239 return SkEndianSwap32(result); 244 return SkEndianSwap32(result);
240 #else 245 #else
241 return result; 246 return result;
242 #endif 247 #endif
243 } 248 }
244 249
245 #endif // SkCodecPriv_DEFINED 250 #endif // SkCodecPriv_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkPngCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698