aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.h
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-01-07 17:06:04 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-07 17:06:04 -0800
commit4999df8ca2d53d7f34e0f6d0c70ab620bef2fe13 (patch)
tree1761d982a48c93f9de8b0c57259599abda89ea6b /src/gpu/gl/GrGLCaps.h
parent3061af4a5f2b8ef00fc4a34b04cf99dfb780f1a1 (diff)
Revert of Move config texturability/renderability to config table (patchset #8 id:140001 of https://codereview.chromium.org/1563443002/ )
Reason for revert: speculative revert for breaking iOS writePixels tests Original issue's description: > Move config texturability/renderability to config table. > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563443002 > > Committed: https://skia.googlesource.com/skia/+/32a3cd2f2860b15a842a6aa49e4e6a3bed04f949 TBR=jvanverth@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1569103003
Diffstat (limited to 'src/gpu/gl/GrGLCaps.h')
-rw-r--r--src/gpu/gl/GrGLCaps.h47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 518708ba26..230bffc7a6 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -123,25 +123,12 @@ public:
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
* to be supported by the driver but are legal GLenum names given the GL
@@ -240,12 +227,15 @@ public:
/// 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 @@ public:
*/
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 @@ private:
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 @@ private:
void initConfigSwizzleTable(const GrGLContextInfo& ctxInfo, GrGLSLCaps* glslCaps);
+ void initConfigTable(const GrGLContextInfo&);
SkTArray<StencilFormat, true> fStencilFormats;
@@ -354,7 +359,10 @@ private:
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 @@ private:
int fStencilFormatIndex;
enum {
- kVerifiedColorAttachment_Flag = 0x1,
- kTextureable_Flag = 0x2,
- kRenderable_Flag = 0x4,
- kRenderableWithMSAA_Flag = 0x8,
+ kVerifiedColorAttachment_Flag = 0x1
};
uint32_t fFlags;
};