Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: include/gpu/gl/GrGLInterface.h

Issue 140823003: Move GrGLExtensions from GrGLContextInfo to GrGLInterface (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix Android Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/gl/GrGLFunctions.h ('k') | include/gpu/gl/SkGLContextHelper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « include/gpu/gl/GrGLFunctions.h ('k') | include/gpu/gl/SkGLContextHelper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698