OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
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 GrTextureAccess_DEFINED | 8 #ifndef GrTextureAccess_DEFINED |
9 #define GrTextureAccess_DEFINED | 9 #define GrTextureAccess_DEFINED |
10 | 10 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 bool operator!= (const GrTextureAccess& other) const { return !(*this == oth
er); } | 156 bool operator!= (const GrTextureAccess& other) const { return !(*this == oth
er); } |
157 | 157 |
158 GrTexture* getTexture() const { return fTexture.get(); } | 158 GrTexture* getTexture() const { return fTexture.get(); } |
159 | 159 |
160 /** | 160 /** |
161 * Returns a string representing the swizzle. The string is is null-terminat
ed. | 161 * Returns a string representing the swizzle. The string is is null-terminat
ed. |
162 */ | 162 */ |
163 const char* getSwizzle() const { return fSwizzle; } | 163 const char* getSwizzle() const { return fSwizzle; } |
164 | 164 |
165 enum { | 165 /** Returns a mask indicating which components are referenced in the swizzle
. The return |
166 kR_SwizzleFlag = 0x1, | 166 is a bitfield of GrColorComponentFlags. */ |
167 kG_SwizzleFlag = 0x2, | |
168 kB_SwizzleFlag = 0x4, | |
169 kA_SwizzleFlag = 0x8, | |
170 | |
171 kRGB_SwizzleMask = (kR_SwizzleFlag | kG_SwizzleFlag | kB_SwizzleFlag), | |
172 }; | |
173 | |
174 /** Returns a mask indicating which components are referenced in the swizzle
. */ | |
175 uint32_t swizzleMask() const { return fSwizzleMask; } | 167 uint32_t swizzleMask() const { return fSwizzleMask; } |
176 | 168 |
177 const GrTextureParams& getParams() const { return fParams; } | 169 const GrTextureParams& getParams() const { return fParams; } |
178 | 170 |
179 private: | 171 private: |
180 void setSwizzle(const char*); | 172 void setSwizzle(const char*); |
181 | 173 |
182 GrTextureParams fParams; | 174 GrTextureParams fParams; |
183 SkAutoTUnref<GrTexture> fTexture; | 175 SkAutoTUnref<GrTexture> fTexture; |
184 uint32_t fSwizzleMask; | 176 uint32_t fSwizzleMask; |
185 char fSwizzle[5]; | 177 char fSwizzle[5]; |
186 | 178 |
187 typedef GrNoncopyable INHERITED; | 179 typedef GrNoncopyable INHERITED; |
188 }; | 180 }; |
189 | 181 |
190 #endif | 182 #endif |
OLD | NEW |