Index: include/gpu/gl/GrGLInterface.h |
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h |
index 2471da90a1eee1291d3ad608c96949fb75bf1826..5ddca4d3f00cc9fdbbd37205fbd4419fd871f539 100644 |
--- a/include/gpu/gl/GrGLInterface.h |
+++ b/include/gpu/gl/GrGLInterface.h |
@@ -9,26 +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 alias until Chromium can be updated. |
-static const GrGLStandard kES2_GrGLBinding = kGLES_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 |
@@ -127,6 +113,20 @@ public: |
GrGLStandard fBindingsExported; // Legacy name, will be remove when Chromium is updated. |
}; |
robertphillips
2014/01/16 17:13:11
Do we want to make fExtensions protected if using
bsalomon
2014/01/16 18:28:45
We can't. The factory functions need access to it.
|
+ 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; |