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

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

Issue 2390263002: Add SkColorSpaceXform to the public API (Closed)
Patch Set: Remove type on enum Created 4 years, 2 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 | « include/core/SkColorSpaceXform.h ('k') | src/codec/SkJpegCodec.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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 case kBGRA_8888_SkColorType: 169 case kBGRA_8888_SkColorType:
170 return colorPtr[fillIndex]; 170 return colorPtr[fillIndex];
171 case kRGB_565_SkColorType: 171 case kRGB_565_SkColorType:
172 return SkPixel32ToPixel16(colorPtr[fillIndex]); 172 return SkPixel32ToPixel16(colorPtr[fillIndex]);
173 case kIndex_8_SkColorType: 173 case kIndex_8_SkColorType:
174 return fillIndex; 174 return fillIndex;
175 case kRGBA_F16_SkColorType: { 175 case kRGBA_F16_SkColorType: {
176 SkASSERT(colorXform); 176 SkASSERT(colorXform);
177 uint64_t dstColor; 177 uint64_t dstColor;
178 uint32_t srcColor = colorPtr[fillIndex]; 178 uint32_t srcColor = colorPtr[fillIndex];
179 colorXform->apply(&dstColor, &srcColor, 1, select_xform_format(dstCo lorType), 179 SkAssertResult(colorXform->apply(select_xform_format(dstColorType), &dstColor,
180 SkColorSpaceXform::kRGBA_8888_ColorFormat, alphaTy pe); 180 SkColorSpaceXform::kRGBA_8888_ColorFormat, &srcColor, 1, alp haType));
181 return dstColor; 181 return dstColor;
182 } 182 }
183 default: 183 default:
184 SkASSERT(false); 184 SkASSERT(false);
185 return 0; 185 return 0;
186 } 186 }
187 } 187 }
188 188
189 /* 189 /*
190 * 190 *
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 return kOpaque_SkAlphaType == src.alphaType() && !needs_color_xform( dst, src); 393 return kOpaque_SkAlphaType == src.alphaType() && !needs_color_xform( dst, src);
394 case kGray_8_SkColorType: 394 case kGray_8_SkColorType:
395 return kGray_8_SkColorType == src.colorType() && 395 return kGray_8_SkColorType == src.colorType() &&
396 kOpaque_SkAlphaType == src.alphaType() && !needs_color_xform( dst, src); 396 kOpaque_SkAlphaType == src.alphaType() && !needs_color_xform( dst, src);
397 default: 397 default:
398 return false; 398 return false;
399 } 399 }
400 } 400 }
401 401
402 #endif // SkCodecPriv_DEFINED 402 #endif // SkCodecPriv_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkColorSpaceXform.h ('k') | src/codec/SkJpegCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698