Index: src/gpu/gl/GrGLCaps.h |
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h |
index 518708ba264922ef1d4207561425ea3254efd230..230bffc7a657cbbceee01801830768f46f08199e 100644 |
--- a/src/gpu/gl/GrGLCaps.h |
+++ b/src/gpu/gl/GrGLCaps.h |
@@ -123,24 +123,11 @@ |
GrGLCaps(const GrContextOptions& contextOptions, const GrGLContextInfo& ctxInfo, |
const GrGLInterface* glInterface); |
- bool isConfigTexturable(GrPixelConfig config) const override { |
- SkASSERT(kGrPixelConfigCnt > config); |
- return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kTextureable_Flag); |
- } |
- |
- bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override { |
- SkASSERT(kGrPixelConfigCnt > config) ; |
- if (withMSAA) { |
- return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kRenderableWithMSAA_Flag); |
- } else { |
- return SkToBool(fConfigTable[config].fFlags & ConfigInfo::kRenderable_Flag); |
- } |
- } |
- |
/** Returns conversions to various GL format parameters for a GrPixelCfonig. */ |
const ConfigFormats& configGLFormats(GrPixelConfig config) const { |
return fConfigTable[config].fFormats; |
} |
+ |
/** |
* Gets an array of legal stencil formats. These formats are not guaranteed |
@@ -240,12 +227,15 @@ |
/// maximum number of texture units accessible in the fragment shader. |
int maxFragmentTextureUnits() const { return fMaxFragmentTextureUnits; } |
+ /// ES requires an extension to support RGBA8 in RenderBufferStorage |
+ bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; } |
+ |
/** |
* Depending on the ES extensions present the BGRA external format may |
- * correspond to either a BGRA or RGBA internalFormat. On desktop GL it is |
+ * correspond either a BGRA or RGBA internalFormat. On desktop GL it is |
* RGBA. |
*/ |
- bool bgraIsInternalFormat() const; |
+ bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; } |
/// Is there support for GL_UNPACK_ROW_LENGTH |
bool unpackRowLengthSupport() const { return fUnpackRowLengthSupport; } |
@@ -319,6 +309,19 @@ |
*/ |
SkString dump() const override; |
+ /** |
+ * LATC can appear under one of three possible names. In order to know |
+ * which GL internal format to use, we need to keep track of which name |
+ * we found LATC under. The default is LATC. |
+ */ |
+ enum LATCAlias { |
+ kLATC_LATCAlias, |
+ kRGTC_LATCAlias, |
+ k3DC_LATCAlias |
+ }; |
+ |
+ LATCAlias latcAlias() const { return fLATCAlias; } |
+ |
bool rgba8888PixelsOpsAreSlow() const { return fRGBA8888PixelsOpsAreSlow; } |
bool partialFBOReadIsSlow() const { return fPartialFBOReadIsSlow; } |
@@ -335,7 +338,8 @@ |
void initBlendEqationSupport(const GrGLContextInfo&); |
void initStencilFormats(const GrGLContextInfo&); |
// This must be called after initFSAASupport(). |
- void initConfigTable(const GrGLContextInfo&, const GrGLInterface* gli); |
+ void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport); |
+ void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*, bool srgbSupport); |
void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, |
const GrGLInterface* intf, |
@@ -343,6 +347,7 @@ |
void initConfigSwizzleTable(const GrGLContextInfo& ctxInfo, GrGLSLCaps* glslCaps); |
+ void initConfigTable(const GrGLContextInfo&); |
SkTArray<StencilFormat, true> fStencilFormats; |
@@ -354,7 +359,10 @@ |
InvalidateFBType fInvalidateFBType; |
MapBufferType fMapBufferType; |
TransferBufferType fTransferBufferType; |
- |
+ LATCAlias fLATCAlias; |
+ |
+ bool fRGBA8RenderbufferSupport : 1; |
+ bool fBGRAIsInternalFormat : 1; |
bool fUnpackRowLengthSupport : 1; |
bool fUnpackFlipYSupport : 1; |
bool fPackRowLengthSupport : 1; |
@@ -412,10 +420,7 @@ |
int fStencilFormatIndex; |
enum { |
- kVerifiedColorAttachment_Flag = 0x1, |
- kTextureable_Flag = 0x2, |
- kRenderable_Flag = 0x4, |
- kRenderableWithMSAA_Flag = 0x8, |
+ kVerifiedColorAttachment_Flag = 0x1 |
}; |
uint32_t fFlags; |
}; |