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

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

Issue 783763002: Initial CL to move color / coverage off of drawstate (Closed) Base URL: https://skia.googlesource.com/skia.git@no-static-gp
Patch Set: bug fix Created 6 years 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 | « gm/yuvtorgbeffect.cpp ('k') | include/gpu/GrContext.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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 #define GrColorUnpackG(color) (((color) >> GrColor_SHIFT_G) & 0xFF) 59 #define GrColorUnpackG(color) (((color) >> GrColor_SHIFT_G) & 0xFF)
60 #define GrColorUnpackB(color) (((color) >> GrColor_SHIFT_B) & 0xFF) 60 #define GrColorUnpackB(color) (((color) >> GrColor_SHIFT_B) & 0xFF)
61 #define GrColorUnpackA(color) (((color) >> GrColor_SHIFT_A) & 0xFF) 61 #define GrColorUnpackA(color) (((color) >> GrColor_SHIFT_A) & 0xFF)
62 62
63 /** 63 /**
64 * Since premultiplied means that alpha >= color, we construct a color with 64 * Since premultiplied means that alpha >= color, we construct a color with
65 * each component==255 and alpha == 0 to be "illegal" 65 * each component==255 and alpha == 0 to be "illegal"
66 */ 66 */
67 #define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A)) 67 #define GrColor_ILLEGAL (~(0xFF << GrColor_SHIFT_A))
68 68
69 #define GrColor_WHITE 0xFFFFFFFF
70 #define GrColor_TRANS_BLACK 0x0
71
69 /** 72 /**
70 * Assert in debug builds that a GrColor is premultiplied. 73 * Assert in debug builds that a GrColor is premultiplied.
71 */ 74 */
72 static inline void GrColorIsPMAssert(GrColor SkDEBUGCODE(c)) { 75 static inline void GrColorIsPMAssert(GrColor SkDEBUGCODE(c)) {
73 #ifdef SK_DEBUG 76 #ifdef SK_DEBUG
74 unsigned a = GrColorUnpackA(c); 77 unsigned a = GrColorUnpackA(c);
75 unsigned r = GrColorUnpackR(c); 78 unsigned r = GrColorUnpackR(c);
76 unsigned g = GrColorUnpackG(c); 79 unsigned g = GrColorUnpackG(c);
77 unsigned b = GrColorUnpackB(c); 80 unsigned b = GrColorUnpackB(c);
78 81
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); 185 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig);
183 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); 186 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig);
184 GR_STATIC_ASSERT(9 == kR11_EAC_GrPixelConfig); 187 GR_STATIC_ASSERT(9 == kR11_EAC_GrPixelConfig);
185 GR_STATIC_ASSERT(10 == kASTC_12x12_GrPixelConfig); 188 GR_STATIC_ASSERT(10 == kASTC_12x12_GrPixelConfig);
186 GR_STATIC_ASSERT(11 == kRGBA_float_GrPixelConfig); 189 GR_STATIC_ASSERT(11 == kRGBA_float_GrPixelConfig);
187 GR_STATIC_ASSERT(12 == kAlpha_half_GrPixelConfig); 190 GR_STATIC_ASSERT(12 == kAlpha_half_GrPixelConfig);
188 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); 191 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt);
189 } 192 }
190 193
191 #endif 194 #endif
OLDNEW
« no previous file with comments | « gm/yuvtorgbeffect.cpp ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698