diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-16 16:35:09 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-16 16:35:09 +0000 |
commit | 9e90aed5de82732cc9921f01388d3063a41a053b (patch) | |
tree | 35fc0562a7bbe577a523276a420120ff5d69d84d /include/gpu | |
parent | f7ba41321b16ad8df611fa07e9ae48fe8a30a0bb (diff) |
Rename GrGLBinding->GrGLStandard, no longer a bitfield
BUG=skia:2042
R=jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/133413003
git-svn-id: http://skia.googlecode.com/svn/trunk@13108 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/gl/GrGLExtensions.h | 10 | ||||
-rw-r--r-- | include/gpu/gl/GrGLInterface.h | 36 |
2 files changed, 22 insertions, 24 deletions
diff --git a/include/gpu/gl/GrGLExtensions.h b/include/gpu/gl/GrGLExtensions.h index ffb673336a..45f698ef29 100644 --- a/include/gpu/gl/GrGLExtensions.h +++ b/include/gpu/gl/GrGLExtensions.h @@ -19,16 +19,18 @@ */ class GrGLExtensions { public: - bool init(GrGLBinding binding, const GrGLInterface* iface) { - SkASSERT(binding & iface->fBindingsExported); - return this->init(binding, iface->fGetString, iface->fGetStringi, iface->fGetIntegerv); + bool init(const GrGLInterface* iface) { + return this->init(iface->fStandard, + iface->fGetString, + iface->fGetStringi, + iface->fGetIntegerv); } /** * We sometimes need to use this class without having yet created a GrGLInterface. This version * of init expects that getString is always non-NULL while getIntegerv and getStringi are non- * NULL if on desktop GL with version 3.0 or higher. Otherwise it will fail. */ - bool init(GrGLBinding binding, + bool init(GrGLStandard standard, GrGLGetStringProc getString, GrGLGetStringiProc getStringi, GrGLGetIntegervProc getIntegerv); diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h index 588a3a2e9d..2471da90a1 100644 --- a/include/gpu/gl/GrGLInterface.h +++ b/include/gpu/gl/GrGLInterface.h @@ -14,22 +14,17 @@ //////////////////////////////////////////////////////////////////////////////// /** - * Classifies GL contexts (currently as Desktop vs. ES2). This is a bitfield. - * A GrGLInterface (defined below) may support multiple bindings. + * Classifies GL contexts by which standard they implement (currently as Desktop + * vs. ES). */ -enum GrGLBinding { - kNone_GrGLBinding = 0x0, - - kDesktop_GrGLBinding = 0x01, - kES_GrGLBinding = 0x02, // ES2+ only - - // for iteration of GrGLBindings - kFirstGrGLBinding = kDesktop_GrGLBinding, - kLastGrGLBinding = kES_GrGLBinding +enum GrGLStandard { + kNone_GrGLStandard, + kGL_GrGLStandard, + kGLES_GrGLStandard, }; // Temporary alias until Chromium can be updated. -static const GrGLBinding kES2_GrGLBinding = kES_GrGLBinding; +static const GrGLStandard kES2_GrGLBinding = kGLES_GrGLStandard; //////////////////////////////////////////////////////////////////////////////// @@ -121,15 +116,16 @@ public: GrGLInterface(); - // Validates that the GrGLInterface supports a binding. This means that - // the GrGLinterface advertises the binding in fBindingsExported and all - // the necessary function pointers have been initialized. The interface is - // validated for the current OpenGL context. - bool validate(GrGLBinding binding) const; + // Validates that the GrGLInterface supports its advertised standard. This means the necessary + // function pointers have been initialized for both the GL version and any advertised + // extensions. + bool validate() const; - // Indicator variable specifying the type of GL implementation - // exported: GLES2 and/or Desktop. - GrGLBinding fBindingsExported; + // Indicates the type of GL implementation + union { + GrGLStandard fStandard; + GrGLStandard fBindingsExported; // Legacy name, will be remove when Chromium is updated. + }; GLPtr<GrGLActiveTextureProc> fActiveTexture; GLPtr<GrGLAttachShaderProc> fAttachShader; |