Index: include/gpu/gl/GrGLInterface.h |
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h |
index 9438a158665d7c7d75a98038c544637565b2b6e6..2c2a6911d114f383d4de1fbc63adeca15cb99042 100644 |
--- a/include/gpu/gl/GrGLInterface.h |
+++ b/include/gpu/gl/GrGLInterface.h |
@@ -9,28 +9,12 @@ |
#define GrGLInterface_DEFINED |
#include "GrGLFunctions.h" |
+#include "GrGLExtensions.h" |
#include "SkRefCnt.h" |
//////////////////////////////////////////////////////////////////////////////// |
/** |
- * Classifies GL contexts by which standard they implement (currently as Desktop |
- * vs. ES). |
- */ |
-enum GrGLStandard { |
- kNone_GrGLStandard, |
- kGL_GrGLStandard, |
- kGLES_GrGLStandard, |
-}; |
- |
-// Temporary aliases until Chromium can be updated. |
-typedef GrGLStandard GrGLBinding; |
-static const GrGLStandard kES2_GrGLBinding = kGLES_GrGLStandard; |
-static const GrGLStandard kDesktop_GrGLBinding = kGL_GrGLStandard; |
- |
-//////////////////////////////////////////////////////////////////////////////// |
- |
-/** |
* Rather than depend on platform-specific GL headers and libraries, we require |
* the client to provide a struct of GL function pointers. This struct can be |
* specified per-GrContext as a parameter to GrContext::Create. If NULL is |
@@ -129,6 +113,20 @@ public: |
GrGLStandard fBindingsExported; // Legacy name, will be remove when Chromium is updated. |
}; |
+ GrGLExtensions fExtensions; |
+ |
+ // This wrapper and const hackery is necessary because the factories in Chromium do not yet |
+ // initialize fExtensions. |
+ bool hasExtension(const char ext[]) const { |
+ if (!fExtensions.isInitialized()) { |
+ GrGLExtensions* extensions = const_cast<GrGLExtensions*>(&fExtensions); |
+ if (!extensions->init(fStandard, fGetString, fGetStringi, fGetIntegerv)) { |
+ return false; |
+ } |
+ } |
+ return fExtensions.has(ext); |
+ } |
+ |
GLPtr<GrGLActiveTextureProc> fActiveTexture; |
GLPtr<GrGLAttachShaderProc> fAttachShader; |
GLPtr<GrGLBeginQueryProc> fBeginQuery; |