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

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

Issue 318873002: Remove GrIsPow2 in favor of SkIsPow2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | include/gpu/GrTexture.h » ('j') | include/gpu/GrTypes.h » ('J')
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 kA_GrColorComponentFlag = 1 << (GrColor_SHIFT_A / 8), 99 kA_GrColorComponentFlag = 1 << (GrColor_SHIFT_A / 8),
100 100
101 kRGB_GrColorComponentFlags = (kR_GrColorComponentFlag | kG_GrColorComponentF lag | 101 kRGB_GrColorComponentFlags = (kR_GrColorComponentFlag | kG_GrColorComponentF lag |
102 kB_GrColorComponentFlag), 102 kB_GrColorComponentFlag),
103 103
104 kRGBA_GrColorComponentFlags = (kR_GrColorComponentFlag | kG_GrColorComponent Flag | 104 kRGBA_GrColorComponentFlags = (kR_GrColorComponentFlag | kG_GrColorComponent Flag |
105 kB_GrColorComponentFlag | kA_GrColorComponent Flag) 105 kB_GrColorComponentFlag | kA_GrColorComponent Flag)
106 }; 106 };
107 107
108 static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) { 108 static inline char GrColorComponentFlagToChar(GrColorComponentFlags component) {
109 SkASSERT(GrIsPow2(component)); 109 SkASSERT(SkIsPow2(component));
110 switch (component) { 110 switch (component) {
111 case kR_GrColorComponentFlag: 111 case kR_GrColorComponentFlag:
112 return 'r'; 112 return 'r';
113 case kG_GrColorComponentFlag: 113 case kG_GrColorComponentFlag:
114 return 'g'; 114 return 'g';
115 case kB_GrColorComponentFlag: 115 case kB_GrColorComponentFlag:
116 return 'b'; 116 return 'b';
117 case kA_GrColorComponentFlag: 117 case kA_GrColorComponentFlag:
118 return 'a'; 118 return 'a';
119 default: 119 default:
(...skipping 23 matching lines...) Expand all
143 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); 143 GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig);
144 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); 144 GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig);
145 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); 145 GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig);
146 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); 146 GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig);
147 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig); 147 GR_STATIC_ASSERT(7 == kETC1_GrPixelConfig);
148 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig); 148 GR_STATIC_ASSERT(8 == kLATC_GrPixelConfig);
149 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt); 149 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kFlags) == kGrPixelConfigCnt);
150 } 150 }
151 151
152 #endif 152 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrTexture.h » ('j') | include/gpu/GrTypes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698