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

Side by Side Diff: include/gpu/GrColor.h

Issue 1789663002: sRGB support in Ganesh. Several pieces: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Squelch assert when blurring sRGB Created 4 years, 9 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/gpu/GrCaps.h ('k') | include/gpu/GrTextureParams.h » ('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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return 'b'; 201 return 'b';
202 case kA_GrColorComponentFlag: 202 case kA_GrColorComponentFlag:
203 return 'a'; 203 return 'a';
204 default: 204 default:
205 SkFAIL("Invalid color component flag."); 205 SkFAIL("Invalid color component flag.");
206 return '\0'; 206 return '\0';
207 } 207 }
208 } 208 }
209 209
210 static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) { 210 static inline uint32_t GrPixelConfigComponentMask(GrPixelConfig config) {
211 SkASSERT(config >= 0 && config < kGrPixelConfigCnt);
212 static const uint32_t kFlags[] = { 211 static const uint32_t kFlags[] = {
213 0, // kUnknown_GrPixelConfig 212 0, // kUnknown_GrPixelConfig
214 kA_GrColorComponentFlag, // kAlpha_8_GrPixelConfig 213 kA_GrColorComponentFlag, // kAlpha_8_GrPixelConfig
215 kRGBA_GrColorComponentFlags, // kIndex_8_GrPixelConfig 214 kRGBA_GrColorComponentFlags, // kIndex_8_GrPixelConfig
216 kRGB_GrColorComponentFlags, // kRGB_565_GrPixelConfig 215 kRGB_GrColorComponentFlags, // kRGB_565_GrPixelConfig
217 kRGBA_GrColorComponentFlags, // kRGBA_4444_GrPixelConfig 216 kRGBA_GrColorComponentFlags, // kRGBA_4444_GrPixelConfig
218 kRGBA_GrColorComponentFlags, // kRGBA_8888_GrPixelConfig 217 kRGBA_GrColorComponentFlags, // kRGBA_8888_GrPixelConfig
219 kRGBA_GrColorComponentFlags, // kBGRA_8888_GrPixelConfig 218 kRGBA_GrColorComponentFlags, // kBGRA_8888_GrPixelConfig
220 kRGBA_GrColorComponentFlags, // kSRGBA_8888_GrPixelConfig 219 kRGBA_GrColorComponentFlags, // kSRGBA_8888_GrPixelConfig
220 kRGBA_GrColorComponentFlags, // kSBGRA_8888_GrPixelConfig
221 kRGB_GrColorComponentFlags, // kETC1_GrPixelConfig 221 kRGB_GrColorComponentFlags, // kETC1_GrPixelConfig
222 kA_GrColorComponentFlag, // kLATC_GrPixelConfig 222 kA_GrColorComponentFlag, // kLATC_GrPixelConfig
223 kA_GrColorComponentFlag, // kR11_EAC_GrPixelConfig 223 kA_GrColorComponentFlag, // kR11_EAC_GrPixelConfig
224 kRGBA_GrColorComponentFlags, // kASTC_12x12_GrPixelConfig 224 kRGBA_GrColorComponentFlags, // kASTC_12x12_GrPixelConfig
225 kRGBA_GrColorComponentFlags, // kRGBA_float_GrPixelConfig 225 kRGBA_GrColorComponentFlags, // kRGBA_float_GrPixelConfig
226 kA_GrColorComponentFlag, // kAlpha_16_GrPixelConfig 226 kA_GrColorComponentFlag, // kAlpha_16_GrPixelConfig
227 kRGBA_GrColorComponentFlags, // kRGBA_half_GrPixelConfig 227 kRGBA_GrColorComponentFlags, // kRGBA_half_GrPixelConfig
228 }; 228 };
229 return kFlags[config]; 229 return kFlags[config];
230 230
231 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); 231 GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig);
232 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); 232 GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig);
233 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); 233 GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig);
234 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); 234 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig);
235 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); 235 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig);
236 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); 236 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig);
237 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); 237 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig);
238 GR_STATIC_ASSERT(7 == kSRGBA_8888_GrPixelConfig); 238 GR_STATIC_ASSERT(7 == kSRGBA_8888_GrPixelConfig);
239 GR_STATIC_ASSERT(8 == kETC1_GrPixelConfig); 239 GR_STATIC_ASSERT(8 == kSBGRA_8888_GrPixelConfig);
240 GR_STATIC_ASSERT(9 == kLATC_GrPixelConfig); 240 GR_STATIC_ASSERT(9 == kETC1_GrPixelConfig);
241 GR_STATIC_ASSERT(10 == kR11_EAC_GrPixelConfig); 241 GR_STATIC_ASSERT(10 == kLATC_GrPixelConfig);
242 GR_STATIC_ASSERT(11 == kASTC_12x12_GrPixelConfig); 242 GR_STATIC_ASSERT(11 == kR11_EAC_GrPixelConfig);
243 GR_STATIC_ASSERT(12 == kRGBA_float_GrPixelConfig); 243 GR_STATIC_ASSERT(12 == kASTC_12x12_GrPixelConfig);
244 GR_STATIC_ASSERT(13 == kAlpha_half_GrPixelConfig); 244 GR_STATIC_ASSERT(13 == kRGBA_float_GrPixelConfig);
245 GR_STATIC_ASSERT(14 == kRGBA_half_GrPixelConfig); 245 GR_STATIC_ASSERT(14 == kAlpha_half_GrPixelConfig);
246 GR_STATIC_ASSERT(15 == kRGBA_half_GrPixelConfig);
246 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); 247 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt);
247 } 248 }
248 249
249 #endif 250 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrCaps.h ('k') | include/gpu/GrTextureParams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698