FBFetch refactor + arm support
BUG=skia:
R=krajcevski@google.com, bsalomon@google.com
Author: joshualitt@chromium.org
Review URL: https://codereview.chromium.org/433603002
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index ccf04fd..887e2e9 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -68,16 +68,6 @@
kLast_MSFBOType = kES_EXT_MsToTexture_MSFBOType
};
- enum FBFetchType {
- kNone_FBFetchType,
- /** GL_EXT_shader_framebuffer_fetch */
- kEXT_FBFetchType,
- /** GL_NV_shader_framebuffer_fetch */
- kNV_FBFetchType,
-
- kLast_FBFetchType = kNV_FBFetchType
- };
-
enum InvalidateFBType {
kNone_InvalidateFBType,
kDiscard_InvalidateFBType, //<! glDiscardFramebuffer()
@@ -174,7 +164,16 @@
kES_EXT_MsToTexture_MSFBOType == fMSFBOType;
}
- FBFetchType fbFetchType() const { return fFBFetchType; }
+ /**
+ * Some helper functions for encapsulating various extensions to read FB Buffer on openglES
+ *
+ * TODO On desktop opengl 4.2+ we can achieve something similar to this effect
+ */
+ bool fbFetchSupport() const { return fFBFetchSupport; }
+
+ const char* fbFetchColorName() const { return fFBFetchColorName; }
+
+ const char* fbFetchExtensionString() const { return fFBFetchExtensionString; }
InvalidateFBType invalidateFBType() const { return fInvalidateFBType; }
@@ -340,7 +339,6 @@
int fMaxFixedFunctionTextureCoords;
MSFBOType fMSFBOType;
- FBFetchType fFBFetchType;
InvalidateFBType fInvalidateFBType;
MapBufferType fMapBufferType;
LATCAlias fLATCAlias;
@@ -363,6 +361,10 @@
bool fIsCoreProfile : 1;
bool fFullClearIsFree : 1;
bool fDropsTileOnZeroDivide : 1;
+ bool fFBFetchSupport : 1;
+
+ const char* fFBFetchColorName;
+ const char* fFBFetchExtensionString;
typedef GrDrawTargetCaps INHERITED;
};