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

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: upload again, rietveld diff failed. 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
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;

Powered by Google App Engine
This is Rietveld 408576698