Rename kES2_GrGLBinding to kES_GrGLBinding. Step 0 for supporting ES3.
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Aug 2013 18:54:39 +0000 (18:54 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Aug 2013 18:54:39 +0000 (18:54 +0000)
R=robertphillips@google.com

Review URL: https://codereview.chromium.org/23185004

git-svn-id: http://skia.googlecode.com/svn/trunk@10747 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/gl/GrGLCaps.cpp
src/gpu/gl/GrGLInterface.cpp
src/gpu/gl/GrGLSL.cpp
src/gpu/gl/GrGLShaderBuilder.cpp
src/gpu/gl/GrGLShaderVar.h
src/gpu/gl/GrGLUtil.cpp
src/gpu/gl/GrGpuGL.cpp
src/gpu/gl/SkGLContextHelper.cpp
src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp
src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp

index ec5b821..10a7eef 100644 (file)
@@ -101,7 +101,7 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
      * Caps specific to GrGLCaps
      **************************************************************************/
 
-    if (kES2_GrGLBinding == binding) {
+    if (kES_GrGLBinding == binding) {
         GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_VECTORS,
                           &fMaxFragmentUniformVectors);
     } else {
@@ -155,7 +155,7 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
             ctxInfo.hasExtension("GL_ANGLE_pack_reverse_row_order");
     }
 
-    fTextureUsageSupport = (kES2_GrGLBinding == binding) &&
+    fTextureUsageSupport = (kES_GrGLBinding == binding) &&
                             ctxInfo.hasExtension("GL_ANGLE_texture_usage");
 
     // Tex storage is in desktop 4.2 and can be an extension to desktop or ES.
@@ -183,7 +183,7 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
     // ES 2 only guarantees RGBA/uchar + one other format/type combo for
     // ReadPixels. The other format has to checked at run-time since it
     // can change based on which render target is bound
-    fTwoFormatLimit = kES2_GrGLBinding == binding;
+    fTwoFormatLimit = kES_GrGLBinding == binding;
 
     // Known issue on at least some Intel platforms:
     // http://code.google.com/p/skia/issues/detail?id=946
@@ -216,7 +216,7 @@ void GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
         fVertexArrayObjectSupport = ctxInfo.hasExtension("GL_OES_vertex_array_object");
     }
 
-    if (kES2_GrGLBinding == binding) {
+    if (kES_GrGLBinding == binding) {
         if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) {
             fFBFetchType = kEXT_FBFetchType;
         } else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) {
index 72d7934..8f94f10 100644 (file)
@@ -150,7 +150,7 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
     // these functions are part of ES2, we assume they are available
     // On the desktop we assume they are available if the extension
     // is present or GL version is high enough.
-    if (kES2_GrGLBinding == binding) {
+    if (kES_GrGLBinding == binding) {
         if (NULL == fStencilFuncSeparate ||
             NULL == fStencilMaskSeparate ||
             NULL == fStencilOpSeparate) {
index dcaa85e..2ede494 100644 (file)
@@ -23,7 +23,7 @@ GrGLSLGeneration GrGetGLSLGeneration(GrGLBinding binding, const GrGLInterface* g
             } else {
                 return k110_GrGLSLGeneration;
             }
-        case kES2_GrGLBinding:
+        case kES_GrGLBinding:
             // version 1.00 of ES GLSL based on ver 1.20 of desktop GLSL
             GrAssert(ver >= GR_GL_VER(1,00));
             return k110_GrGLSLGeneration;
@@ -36,7 +36,7 @@ GrGLSLGeneration GrGetGLSLGeneration(GrGLBinding binding, const GrGLInterface* g
 const char* GrGetGLSLVersionDecl(GrGLBinding binding, GrGLSLGeneration gen) {
     switch (gen) {
         case k110_GrGLSLGeneration:
-            if (kES2_GrGLBinding == binding) {
+            if (kES_GrGLBinding == binding) {
                 // ES2s shader language is based on version 1.20 but is version
                 // 1.00 of the ES language.
                 return "#version 100\n";
index 5ed8f0d..5729497 100644 (file)
@@ -165,7 +165,7 @@ bool GrGLShaderBuilder::enableFeature(GLSLFeature feature) {
             if (!fCtxInfo.caps()->shaderDerivativeSupport()) {
                 return false;
             }
-            if (kES2_GrGLBinding == fCtxInfo.binding()) {
+            if (kES_GrGLBinding == fCtxInfo.binding()) {
                 this->addFSFeature(1 << kStandardDerivatives_GLSLFeature,
                                    "GL_OES_standard_derivatives");
             }
@@ -552,7 +552,7 @@ inline void append_default_precision_qualifier(GrGLShaderVar::Precision p,
                                                GrGLBinding binding,
                                                SkString* str) {
     // Desktop GLSL has added precision qualifiers but they don't do anything.
-    if (kES2_GrGLBinding == binding) {
+    if (kES_GrGLBinding == binding) {
         switch (p) {
             case GrGLShaderVar::kHigh_Precision:
                 str->append("precision highp float;\n");
index e03ed3e..0123b38 100644 (file)
@@ -304,7 +304,7 @@ public:
 
     static const char* PrecisionString(Precision p, GrGLBinding binding) {
         // Desktop GLSL has added precision qualifiers but they don't do anything.
-        if (kES2_GrGLBinding == binding) {
+        if (kES_GrGLBinding == binding) {
             switch (p) {
                 case kLow_Precision:
                     return "lowp ";
index a13b03d..0c14348 100644 (file)
@@ -116,7 +116,7 @@ GrGLBinding GrGLGetBindingInUseFromString(const char* versionString) {
     // check for ES2
     n = sscanf(versionString, "OpenGL ES %d.%d", &major, &minor);
     if (2 == n) {
-        return kES2_GrGLBinding;
+        return kES_GrGLBinding;
     }
     return kNone_GrGLBinding;
 }
index 5845d7a..64f4dfe 100644 (file)
@@ -263,7 +263,7 @@ bool GrGpuGL::canWriteTexturePixels(const GrTexture* texture, GrPixelConfig srcC
     if (kIndex_8_GrPixelConfig == srcConfig || kIndex_8_GrPixelConfig == texture->config()) {
         return false;
     }
-    if (srcConfig != texture->config() && kES2_GrGLBinding == this->glBinding()) {
+    if (srcConfig != texture->config() && kES_GrGLBinding == this->glBinding()) {
         // In general ES2 requires the internal format of the texture and the format of the src
         // pixels to match. However, It may or may not be possible to upload BGRA data to a RGBA
         // texture. It depends upon which extension added BGRA. The Apple extension allows it
@@ -810,7 +810,7 @@ bool GrGpuGL::createRenderTargetObjects(int width, int height,
             !desc->fMSColorRenderbufferID ||
             !this->configToGLFormats(desc->fConfig,
                                      // GLES requires sized internal formats
-                                     kES2_GrGLBinding == this->glBinding(),
+                                     kES_GrGLBinding == this->glBinding(),
                                      &msColorFormat,
                                      NULL,
                                      NULL)) {
@@ -2303,7 +2303,7 @@ inline bool can_copy_texsubimage(const GrSurface* dst,
     // Table 3.9 of the ES2 spec indicates the supported formats with CopyTexSubImage
     // and BGRA isn't in the spec. There doesn't appear to be any extension that adds it. Perhaps
     // many drivers would allow it to work, but ANGLE does not.
-    if (kES2_GrGLBinding == gpu->glBinding() && gpu->glCaps().bgraIsInternalFormat() &&
+    if (kES_GrGLBinding == gpu->glBinding() && gpu->glCaps().bgraIsInternalFormat() &&
         (kBGRA_8888_GrPixelConfig == dst->config() || kBGRA_8888_GrPixelConfig == src->config())) {
         return false;
     }
@@ -2364,7 +2364,7 @@ inline GrGLuint bind_surface_as_fbo(const GrGLInterface* gl,
 
 void GrGpuGL::initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* desc) {
     // Check for format issues with glCopyTexSubImage2D
-    if (kES2_GrGLBinding == this->glBinding() && this->glCaps().bgraIsInternalFormat() &&
+    if (kES_GrGLBinding == this->glBinding() && this->glCaps().bgraIsInternalFormat() &&
         kBGRA_8888_GrPixelConfig == src->config()) {
         // glCopyTexSubImage2D doesn't work with this config. We'll want to make it a render target
         // in order to call glBlitFramebuffer or to copy to it by rendering.
index 9dcc8ec..c4e9431 100644 (file)
@@ -61,7 +61,7 @@ bool SkGLContextHelper::init(int width, int height) {
         SK_GL(*this, BindFramebuffer(GR_GL_FRAMEBUFFER, fFBO));
         SK_GL(*this, GenRenderbuffers(1, &fColorBufferID));
         SK_GL(*this, BindRenderbuffer(GR_GL_RENDERBUFFER, fColorBufferID));
-        if (kES2_GrGLBinding == bindingInUse) {
+        if (kES_GrGLBinding == bindingInUse) {
             SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER,
                                              GR_GL_RGBA8,
                                              width, height));
@@ -81,7 +81,7 @@ bool SkGLContextHelper::init(int width, int height) {
         // in binding a packed format an FBO. However, we can't rely on packed
         // depth stencil being available.
         bool supportsPackedDepthStencil;
-        if (kES2_GrGLBinding == bindingInUse) {
+        if (kES_GrGLBinding == bindingInUse) {
             supportsPackedDepthStencil = this->hasExtension("GL_OES_packed_depth_stencil");
         } else {
             supportsPackedDepthStencil = version >= GR_GL_VER(3,0) ||
@@ -92,7 +92,7 @@ bool SkGLContextHelper::init(int width, int height) {
         if (supportsPackedDepthStencil) {
             // ES2 requires sized internal formats for RenderbufferStorage
             // On Desktop we let the driver decide.
-            GrGLenum format = kES2_GrGLBinding == bindingInUse ?
+            GrGLenum format = kES_GrGLBinding == bindingInUse ?
                                     GR_GL_DEPTH24_STENCIL8 :
                                     GR_GL_DEPTH_STENCIL;
             SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER,
@@ -103,7 +103,7 @@ bool SkGLContextHelper::init(int width, int height) {
                                                  GR_GL_RENDERBUFFER,
                                                  fDepthStencilBufferID));
         } else {
-            GrGLenum format = kES2_GrGLBinding == bindingInUse ?
+            GrGLenum format = kES_GrGLBinding == bindingInUse ?
                                     GR_GL_STENCIL_INDEX8 :
                                     GR_GL_STENCIL_INDEX;
             SK_GL(*this, RenderbufferStorage(GR_GL_RENDERBUFFER,
index cfd181a..17f7f19 100644 (file)
@@ -20,12 +20,12 @@ const GrGLInterface* GrGLCreateNativeInterface() {
     static SkAutoTUnref<GrGLInterface> glInterface;
     if (!glInterface.get()) {
         GrGLExtensions extensions;
-        if (!extensions.init(kES2_GrGLBinding, glGetString, NULL, glGetIntegerv)) {
+        if (!extensions.init(kES_GrGLBinding, glGetString, NULL, glGetIntegerv)) {
             return NULL;
         }
         GrGLInterface* interface = new GrGLInterface;
         glInterface.reset(interface);
-        interface->fBindingsExported = kES2_GrGLBinding;
+        interface->fBindingsExported = kES_GrGLBinding;
         interface->fActiveTexture = glActiveTexture;
         interface->fAttachShader = glAttachShader;
         interface->fBindAttribLocation = glBindAttribLocation;
index d74e395..19aee2b 100644 (file)
@@ -37,7 +37,7 @@ const GrGLInterface* GrGLCreateANGLEInterface() {
     if (!glInterface.get()) {
         GrGLInterface* interface = new GrGLInterface;
         glInterface.reset(interface);
-        interface->fBindingsExported = kES2_GrGLBinding;
+        interface->fBindingsExported = kES_GrGLBinding;
 
         GET_PROC(ActiveTexture);
         GET_PROC(AttachShader);
index 62a39e3..e8e9a2a 100644 (file)
@@ -145,7 +145,7 @@ const GrGLInterface* GrGLCreateNativeInterface() {
         interface->fGenVertexArrays = glGenVertexArraysOES;
 #endif
 
-        interface->fBindingsExported = kES2_GrGLBinding;
+        interface->fBindingsExported = kES_GrGLBinding;
     }
     glInterface.get()->ref();
     return glInterface.get();