Index: src/gpu/gl/GrGLCaps.h |
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h |
index a54a10da52d6109ed725a076bf6335539711ca7d..4ca73bc3a4073db022b7b68aa06fbb18bcf853b1 100644 |
--- a/src/gpu/gl/GrGLCaps.h |
+++ b/src/gpu/gl/GrGLCaps.h |
@@ -181,7 +181,7 @@ public: |
* using isConfigVerifiedColorAttachment(). |
*/ |
void markConfigAsValidColorAttachment(GrPixelConfig config) { |
- fVerifiedColorConfigs.markVerified(config); |
+ fConfigTable[config].fFlags |= ConfigInfo::kVerifiedColorAttachment_Flag; |
} |
/** |
@@ -189,7 +189,7 @@ public: |
* attachment. |
*/ |
bool isConfigVerifiedColorAttachment(GrPixelConfig config) const { |
- return fVerifiedColorConfigs.isVerified(config); |
+ return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kVerifiedColorAttachment_Flag); |
} |
/** |
@@ -341,43 +341,6 @@ private: |
void onApplyOptionsOverrides(const GrContextOptions& options) override; |
- /** |
- * Maintains a bit per GrPixelConfig. It is used to avoid redundantly |
- * performing glCheckFrameBufferStatus for the same config. |
- */ |
- struct VerifiedColorConfigs { |
- VerifiedColorConfigs() { |
- this->reset(); |
- } |
- |
- void reset() { |
- for (int i = 0; i < kNumUints; ++i) { |
- fVerifiedColorConfigs[i] = 0; |
- } |
- } |
- |
- static const int kNumUints = (kGrPixelConfigCnt + 31) / 32; |
- uint32_t fVerifiedColorConfigs[kNumUints]; |
- |
- void markVerified(GrPixelConfig config) { |
-#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT |
- return; |
-#endif |
- int u32Idx = config / 32; |
- int bitIdx = config % 32; |
- fVerifiedColorConfigs[u32Idx] |= 1 << bitIdx; |
- } |
- |
- bool isVerified(GrPixelConfig config) const { |
-#if !GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT |
- return false; |
-#endif |
- int u32Idx = config / 32; |
- int bitIdx = config % 32; |
- return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx)); |
- } |
- }; |
- |
void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*); |
void initBlendEqationSupport(const GrGLContextInfo&); |
void initStencilFormats(const GrGLContextInfo&); |
@@ -395,10 +358,6 @@ private: |
void initConfigTable(const GrGLContextInfo&); |
- // tracks configs that have been verified to pass the FBO completeness when |
- // used as a color attachment |
- VerifiedColorConfigs fVerifiedColorConfigs; |
- |
SkTArray<StencilFormat, true> fStencilFormats; |
int fMaxFragmentUniformVectors; |
@@ -437,20 +396,24 @@ private: |
bool fExternalTextureSupport : 1; |
struct ConfigInfo { |
- ConfigInfo() : fStencilFormatIndex(kUnknown_StencilIndex) {}; |
+ ConfigInfo() : fStencilFormatIndex(kUnknown_StencilIndex), fFlags(0) {}; |
ConfigFormats fFormats; |
- // Index into GrGLCaps's list of stencil formats. Support is determined experimentally and |
- // lazily. |
- int fStencilFormatIndex; |
- |
enum { |
// This indicates that a stencil format has not yet been determined for the config. |
kUnknown_StencilIndex = -1, |
// This indicates that there is no supported stencil format for the config. |
kUnsupported_StencilFormatIndex = -2 |
}; |
+ |
+ // Index fStencilFormats. |
+ int fStencilFormatIndex; |
+ |
+ enum { |
+ kVerifiedColorAttachment_Flag = 0x1 |
+ }; |
+ uint32_t fFlags; |
}; |
ConfigInfo fConfigTable[kGrPixelConfigCnt]; |