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 | 8 |
9 #ifndef GrGLCaps_DEFINED | 9 #ifndef GrGLCaps_DEFINED |
10 #define GrGLCaps_DEFINED | 10 #define GrGLCaps_DEFINED |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 }; | 113 }; |
114 | 114 |
115 /** | 115 /** |
116 * Initializes the GrGLCaps to the set of features supported in the current | 116 * Initializes the GrGLCaps to the set of features supported in the current |
117 * OpenGL context accessible via ctxInfo. | 117 * OpenGL context accessible via ctxInfo. |
118 */ | 118 */ |
119 GrGLCaps(const GrContextOptions& contextOptions, const GrGLContextInfo& ctxI
nfo, | 119 GrGLCaps(const GrContextOptions& contextOptions, const GrGLContextInfo& ctxI
nfo, |
120 const GrGLInterface* glInterface); | 120 const GrGLInterface* glInterface); |
121 | 121 |
122 bool isConfigTexturable(GrPixelConfig config) const override { | 122 bool isConfigTexturable(GrPixelConfig config) const override { |
123 SkASSERT(kGrPixelConfigCnt > config); | |
124 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kTextureable_F
lag); | 123 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kTextureable_F
lag); |
125 } | 124 } |
126 | 125 |
127 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override
{ | 126 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override
{ |
128 SkASSERT(kGrPixelConfigCnt > config); | |
129 if (withMSAA) { | 127 if (withMSAA) { |
130 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kRenderabl
eWithMSAA_Flag); | 128 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kRenderabl
eWithMSAA_Flag); |
131 } else { | 129 } else { |
132 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kRenderabl
e_Flag); | 130 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kRenderabl
e_Flag); |
133 } | 131 } |
134 } | 132 } |
135 | 133 |
136 bool isConfigTexSupportEnabled(GrPixelConfig config) const { | 134 bool isConfigTexSupportEnabled(GrPixelConfig config) const { |
137 SkASSERT(kGrPixelConfigCnt > config); | |
138 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kCanUseTexStor
age_Flag); | 135 return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kCanUseTexStor
age_Flag); |
139 } | 136 } |
140 | 137 |
141 /** Returns the mapping between GrPixelConfig components and GL internal for
mat components. */ | 138 /** Returns the mapping between GrPixelConfig components and GL internal for
mat components. */ |
142 const GrSwizzle& configSwizzle(GrPixelConfig config) const { | 139 const GrSwizzle& configSwizzle(GrPixelConfig config) const { |
143 return fConfigTable[config].fSwizzle; | 140 return fConfigTable[config].fSwizzle; |
144 } | 141 } |
145 | 142 |
146 bool getTexImageFormats(GrPixelConfig surfaceConfig, GrPixelConfig externalC
onfig, | 143 bool getTexImageFormats(GrPixelConfig surfaceConfig, GrPixelConfig externalC
onfig, |
147 GrGLenum* internalFormat, GrGLenum* externalFormat, | 144 GrGLenum* internalFormat, GrGLenum* externalFormat, |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 485 |
489 GrSwizzle fSwizzle; | 486 GrSwizzle fSwizzle; |
490 }; | 487 }; |
491 | 488 |
492 ConfigInfo fConfigTable[kGrPixelConfigCnt]; | 489 ConfigInfo fConfigTable[kGrPixelConfigCnt]; |
493 | 490 |
494 typedef GrCaps INHERITED; | 491 typedef GrCaps INHERITED; |
495 }; | 492 }; |
496 | 493 |
497 #endif | 494 #endif |
OLD | NEW |