Use vertex buffer objects instead of client side arrays in fixed-function codepaths

Pass vertices to the fixed-function shaders in vertex buffer object
stored at attribute 0. This is specified in OpenGL Compatibility
Profile Section 10.8.2 (Transferring Vertices With Vertex Attribute
Zero).

This makes future integration to Chromium command buffer better, since
the command buffer already has code for vertex buffer objects but not
vertex arrays.

Delete unused function pointers related to fixed-function codepaths.

R=bsalomon@google.com

Author: kkinnunen@nvidia.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13557 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp
index fa404ce..50b1828 100644
--- a/src/gpu/gl/GrGLCreateNullInterface.cpp
+++ b/src/gpu/gl/GrGLCreateNullInterface.cpp
@@ -100,7 +100,6 @@
 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindAttribLocation(GrGLuint program, GrGLuint index, const char* name) {}
 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindTexture(GrGLenum target, GrGLuint texture) {}
 GrGLvoid GR_GL_FUNCTION_TYPE nullGLBindVertexArray(GrGLuint id) {}
-GrGLvoid GR_GL_FUNCTION_TYPE nullGLClientActiveTexture(GrGLenum) {}
 
 GrGLvoid GR_GL_FUNCTION_TYPE nullGLGenBuffers(GrGLsizei n, GrGLuint* ids) {
 
@@ -285,7 +284,6 @@
         functions->fClear = noOpGLClear;
         functions->fClearColor = noOpGLClearColor;
         functions->fClearStencil = noOpGLClearStencil;
-        functions->fClientActiveTexture = nullGLClientActiveTexture;
         functions->fColorMask = noOpGLColorMask;
         functions->fCompileShader = noOpGLCompileShader;
         functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D;
@@ -301,14 +299,12 @@
         functions->fDeleteVertexArrays = noOpGLDeleteIds;
         functions->fDepthMask = noOpGLDepthMask;
         functions->fDisable = noOpGLDisable;
-        functions->fDisableClientState = noOpGLDisableClientState;
         functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray;
         functions->fDrawArrays = noOpGLDrawArrays;
         functions->fDrawBuffer = noOpGLDrawBuffer;
         functions->fDrawBuffers = noOpGLDrawBuffers;
         functions->fDrawElements = noOpGLDrawElements;
         functions->fEnable = noOpGLEnable;
-        functions->fEnableClientState = noOpGLEnableClientState;
         functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray;
         functions->fEndQuery = noOpGLEndQuery;
         functions->fFinish = noOpGLFinish;
@@ -355,7 +351,6 @@
         functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate;
         functions->fStencilOp = noOpGLStencilOp;
         functions->fStencilOpSeparate = noOpGLStencilOpSeparate;
-        functions->fTexGenf = noOpGLTexGenf;
         functions->fTexGenfv = noOpGLTexGenfv;
         functions->fTexGeni = noOpGLTexGeni;
         functions->fTexImage2D = noOpGLTexImage2D;
@@ -386,7 +381,6 @@
         functions->fUseProgram = nullGLUseProgram;
         functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv;
         functions->fVertexAttribPointer = noOpGLVertexAttribPointer;
-        functions->fVertexPointer = noOpGLVertexPointer;
         functions->fViewport = nullGLViewport;
         functions->fBindFramebuffer = nullGLBindFramebuffer;
         functions->fBindRenderbuffer = nullGLBindRenderbuffer;
diff --git a/src/gpu/gl/GrGLInterface.cpp b/src/gpu/gl/GrGLInterface.cpp
index 5bee408..0a43f6e 100644
--- a/src/gpu/gl/GrGLInterface.cpp
+++ b/src/gpu/gl/GrGLInterface.cpp
@@ -115,7 +115,6 @@
     , fClear(&fFunctions.fClear)
     , fClearColor(&fFunctions.fClearColor)
     , fClearStencil(&fFunctions.fClearStencil)
-    , fClientActiveTexture(&fFunctions.fClientActiveTexture)
     , fColorMask(&fFunctions.fColorMask)
     , fCompileShader(&fFunctions.fCompileShader)
     , fCompressedTexImage2D(&fFunctions.fCompressedTexImage2D)
@@ -133,14 +132,12 @@
     , fDeleteVertexArrays(&fFunctions.fDeleteVertexArrays)
     , fDepthMask(&fFunctions.fDepthMask)
     , fDisable(&fFunctions.fDisable)
-    , fDisableClientState(&fFunctions.fDisableClientState)
     , fDisableVertexAttribArray(&fFunctions.fDisableVertexAttribArray)
     , fDrawArrays(&fFunctions.fDrawArrays)
     , fDrawBuffer(&fFunctions.fDrawBuffer)
     , fDrawBuffers(&fFunctions.fDrawBuffers)
     , fDrawElements(&fFunctions.fDrawElements)
     , fEnable(&fFunctions.fEnable)
-    , fEnableClientState(&fFunctions.fEnableClientState)
     , fEnableVertexAttribArray(&fFunctions.fEnableVertexAttribArray)
     , fEndQuery(&fFunctions.fEndQuery)
     , fFinish(&fFunctions.fFinish)
@@ -201,7 +198,6 @@
     , fStencilMaskSeparate(&fFunctions.fStencilMaskSeparate)
     , fStencilOp(&fFunctions.fStencilOp)
     , fStencilOpSeparate(&fFunctions.fStencilOpSeparate)
-    , fTexGenf(&fFunctions.fTexGenf)
     , fTexGenfv(&fFunctions.fTexGenfv)
     , fTexGeni(&fFunctions.fTexGeni)
     , fTexImage2D(&fFunctions.fTexImage2D)
@@ -233,7 +229,6 @@
     , fUseProgram(&fFunctions.fUseProgram)
     , fVertexAttrib4fv(&fFunctions.fVertexAttrib4fv)
     , fVertexAttribPointer(&fFunctions.fVertexAttribPointer)
-    , fVertexPointer(&fFunctions.fVertexPointer)
     , fViewport(&fFunctions.fViewport)
     , fPathCommands(&fFunctions.fPathCommands)
     , fPathCoords(&fFunctions.fPathCoords)
@@ -483,16 +478,11 @@
             }
         }
         if (!isCoreProfile) {
-            if (NULL == fFunctions.fClientActiveTexture ||
-                NULL == fFunctions.fDisableClientState ||
-                NULL == fFunctions.fEnableClientState ||
-                NULL == fFunctions.fLoadIdentity ||
+            if (NULL == fFunctions.fLoadIdentity ||
                 NULL == fFunctions.fLoadMatrixf ||
                 NULL == fFunctions.fMatrixMode ||
-                NULL == fFunctions.fTexGenf ||
                 NULL == fFunctions.fTexGenfv ||
-                NULL == fFunctions.fTexGeni ||
-                NULL == fFunctions.fVertexPointer) {
+                NULL == fFunctions.fTexGeni) {
                 return false;
             }
         }
diff --git a/src/gpu/gl/GrGLNoOpInterface.cpp b/src/gpu/gl/GrGLNoOpInterface.cpp
index a9a7d3f..65729c9 100644
--- a/src/gpu/gl/GrGLNoOpInterface.cpp
+++ b/src/gpu/gl/GrGLNoOpInterface.cpp
@@ -119,9 +119,6 @@
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisable(GrGLenum cap) {
 }
 
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisableClientState(GrGLenum) {
-}
-
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisableVertexAttribArray(GrGLuint index) {
 }
 
@@ -146,9 +143,6 @@
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnable(GrGLenum cap) {
 }
 
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnableClientState(GrGLenum cap) {
-}
-
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnableVertexAttribArray(GrGLuint index) {
 }
 
@@ -385,9 +379,6 @@
                                                        const GrGLvoid* ptr) {
 }
 
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexPointer(GrGLint, GrGLenum, GrGLsizei, const GrGLvoid*) {
-}
-
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLViewport(GrGLint x,
                                             GrGLint y,
                                             GrGLsizei width,
diff --git a/src/gpu/gl/GrGLNoOpInterface.h b/src/gpu/gl/GrGLNoOpInterface.h
index 20c67a3..b5b681f 100644
--- a/src/gpu/gl/GrGLNoOpInterface.h
+++ b/src/gpu/gl/GrGLNoOpInterface.h
@@ -70,8 +70,6 @@
 
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisable(GrGLenum cap);
 
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisableClientState(GrGLenum);
-
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDisableVertexAttribArray(GrGLuint index);
 
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDrawArrays(GrGLenum mode, GrGLint first, GrGLsizei count);
@@ -88,8 +86,6 @@
 
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnable(GrGLenum cap);
 
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnableClientState(GrGLenum cap);
-
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEnableVertexAttribArray(GrGLuint index);
 
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLEndQuery(GrGLenum target);
@@ -277,8 +273,6 @@
                                                        GrGLsizei stride,
                                                        const GrGLvoid* ptr);
 
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLVertexPointer(GrGLint, GrGLenum, GrGLsizei, const GrGLvoid*);
-
 GrGLvoid GR_GL_FUNCTION_TYPE noOpGLViewport(GrGLint x,
                                             GrGLint y,
                                             GrGLsizei width,
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index 605ec33..abd337a 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -49,39 +49,7 @@
     }
 }
 
-void GrGLAttribArrayState::setFixedFunctionVertexArray(const GrGpuGL* gpu,
-                                                       GrGLVertexBuffer* buffer,
-                                                       GrGLint size,
-                                                       GrGLenum type,
-                                                       GrGLsizei stride,
-                                                       GrGLvoid* offset) {
-    SkASSERT(gpu->glCaps().fixedFunctionSupport());
-    AttribArrayState* array = &fFixedFunctionVertexArray;
-    if (!array->fEnableIsValid || !array->fEnabled) {
-        GR_GL_CALL(gpu->glInterface(), EnableClientState(GR_GL_VERTEX_ARRAY));
-        array->fEnableIsValid = true;
-        array->fEnabled = true;
-    }
-    if (!array->fAttribPointerIsValid ||
-        array->fVertexBufferID != buffer->bufferID() ||
-        array->fSize != size ||
-        array->fStride != stride ||
-        array->fOffset != offset) {
-
-        buffer->bind();
-        GR_GL_CALL(gpu->glInterface(), VertexPointer(size,
-                                                     type,
-                                                     stride,
-                                                     offset));
-        array->fAttribPointerIsValid = true;
-        array->fVertexBufferID = buffer->bufferID();
-        array->fSize = size;
-        array->fStride = stride;
-        array->fOffset = offset;
-    }
-}
-
-void GrGLAttribArrayState::disableUnusedArrays(const GrGpuGL* gpu, uint64_t usedMask, bool usingFFVertexArray) {
+void GrGLAttribArrayState::disableUnusedArrays(const GrGpuGL* gpu, uint64_t usedMask) {
     int count = fAttribArrayStates.count();
     for (int i = 0; i < count; ++i) {
         if (!(usedMask & 0x1)) {
@@ -96,35 +64,6 @@
         // if the count is greater than 64 then this will become 0 and we will disable arrays 64+.
         usedMask >>= 1;
     }
-
-    // Deal with fixed-function vertex arrays.
-    if (gpu->glCaps().fixedFunctionSupport()) {
-        if (!usingFFVertexArray) {
-            if (!fFixedFunctionVertexArray.fEnableIsValid || fFixedFunctionVertexArray.fEnabled) {
-                GR_GL_CALL(gpu->glInterface(), DisableClientState(GR_GL_VERTEX_ARRAY));
-                fFixedFunctionVertexArray.fEnableIsValid = true;
-                fFixedFunctionVertexArray.fEnabled = false;
-            }
-        } else {
-            SkASSERT(fFixedFunctionVertexArray.fEnableIsValid && fFixedFunctionVertexArray.fEnabled);
-        }
-        // When we use fixed function vertex processing we always use the vertex array and none of
-        // the other arrays.
-        if (!fUnusedFixedFunctionArraysDisabled) {
-            GR_GL_CALL(gpu->glInterface(), DisableClientState(GR_GL_NORMAL_ARRAY));
-            GR_GL_CALL(gpu->glInterface(), DisableClientState(GR_GL_COLOR_ARRAY));
-            GR_GL_CALL(gpu->glInterface(), DisableClientState(GR_GL_SECONDARY_COLOR_ARRAY));
-            GR_GL_CALL(gpu->glInterface(), DisableClientState(GR_GL_INDEX_ARRAY));
-            GR_GL_CALL(gpu->glInterface(), DisableClientState(GR_GL_EDGE_FLAG_ARRAY));
-            for (int i = 0; i < gpu->glCaps().maxFixedFunctionTextureCoords(); ++i) {
-                GR_GL_CALL(gpu->glInterface(), ClientActiveTexture(GR_GL_TEXTURE0 + i));
-                GR_GL_CALL(gpu->glInterface(), DisableClientState(GR_GL_TEXTURE_COORD_ARRAY));
-            }
-            fUnusedFixedFunctionArraysDisabled = true;
-        }
-    } else {
-        SkASSERT(!usingFFVertexArray);
-    }
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h
index 5cc7b5f..8a61f1a 100644
--- a/src/gpu/gl/GrGLVertexArray.h
+++ b/src/gpu/gl/GrGLVertexArray.h
@@ -51,9 +51,6 @@
 public:
     explicit GrGLAttribArrayState(int arrayCount = 0) {
         this->resize(arrayCount);
-        // glVertexPointer doesn't have a normalization param.
-        fFixedFunctionVertexArray.fNormalized = false;
-        fUnusedFixedFunctionArraysDisabled = false;
     }
 
     void resize(int newCount) {
@@ -77,26 +74,17 @@
              GrGLsizei stride,
              GrGLvoid* offset);
 
-    void setFixedFunctionVertexArray(const GrGpuGL*,
-                                     GrGLVertexBuffer*,
-                                     GrGLint size,
-                                     GrGLenum type,
-                                     GrGLsizei stride,
-                                     GrGLvoid* offset);
-
     /**
      * This function disables vertex attribs not present in the mask. It is assumed that the
      * GrGLAttribArrayState is tracking the state of the currently bound vertex array object.
      */
-    void disableUnusedArrays(const GrGpuGL*, uint64_t usedAttribArrayMask, bool usingFFVertexArray);
+    void disableUnusedArrays(const GrGpuGL*, uint64_t usedAttribArrayMask);
 
     void invalidate() {
         int count = fAttribArrayStates.count();
         for (int i = 0; i < count; ++i) {
             fAttribArrayStates[i].invalidate();
         }
-        fFixedFunctionVertexArray.invalidate();
-        fUnusedFixedFunctionArraysDisabled = false;
     }
 
     void notifyVertexBufferDelete(GrGLuint id) {
@@ -107,10 +95,6 @@
                 fAttribArrayStates[i].invalidate();
             }
         }
-        if (fFixedFunctionVertexArray.fAttribPointerIsValid &&
-            id == fFixedFunctionVertexArray.fVertexBufferID) {
-            fFixedFunctionVertexArray.invalidate();
-        }
     }
 
     /**
@@ -140,13 +124,6 @@
     };
 
     SkSTArray<16, AttribArrayState, true> fAttribArrayStates;
-
-    // Tracks the array specified by glVertexPointer.
-    AttribArrayState fFixedFunctionVertexArray;
-
-    // Tracks whether we've disabled the other fixed function arrays that we don't
-    // use (e.g. glNormalPointer).
-    bool fUnusedFixedFunctionArraysDisabled;
 };
 
 /**
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index a3beab1..50ecf0b 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -344,22 +344,29 @@
 
     if (!fCurrentProgram->hasVertexShader()) {
         int posIdx = this->getDrawState().positionAttributeIndex();
-        const GrVertexAttrib* vertexArray = this->getDrawState().getVertexAttribs() + posIdx;
-        GrVertexAttribType vertexArrayType = vertexArray->fType;
-        SkASSERT(!GrGLAttribTypeToLayout(vertexArrayType).fNormalized);
-        SkASSERT(GrGLAttribTypeToLayout(vertexArrayType).fCount == 2);
-        attribState->setFixedFunctionVertexArray(this,
-                                                 vbuf,
-                                                 2,
-                                                 GrGLAttribTypeToLayout(vertexArrayType).fType,
-                                                 stride,
-                                                 reinterpret_cast<GrGLvoid*>(
-                                                 vertexOffsetInBytes + vertexArray->fOffset));
-        attribState->disableUnusedArrays(this, 0, true);
+        const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttribs() + posIdx;
+        GrVertexAttribType attribType = vertexAttrib->fType;
+        SkASSERT(!GrGLAttribTypeToLayout(attribType).fNormalized);
+        SkASSERT(GrGLAttribTypeToLayout(attribType).fCount == 2);
+
+        // Attrib at location 0 is defined to be bound to vertex in fixed-function pipe.  Asserts
+        // above should make sure position attribute goes to location 0 when below code is executed.
+
+        attribState->set(this,
+                         0,
+                         vbuf,
+                         GrGLAttribTypeToLayout(attribType).fCount,
+                         GrGLAttribTypeToLayout(attribType).fType,
+                         GrGLAttribTypeToLayout(attribType).fNormalized,
+                         stride,
+                         reinterpret_cast<GrGLvoid*>(
+                             vertexOffsetInBytes + vertexAttrib->fOffset));
+        attribState->disableUnusedArrays(this, 1);
     } else {
+        int vertexAttribCount = this->getDrawState().getVertexAttribCount();
         uint32_t usedAttribArraysMask = 0;
         const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttribs();
-        int vertexAttribCount = this->getDrawState().getVertexAttribCount();
+
         for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount;
              ++vertexAttribIndex, ++vertexAttrib) {
 
@@ -373,9 +380,8 @@
                              GrGLAttribTypeToLayout(attribType).fNormalized,
                              stride,
                              reinterpret_cast<GrGLvoid*>(
-                             vertexOffsetInBytes + vertexAttrib->fOffset));
+                                 vertexOffsetInBytes + vertexAttrib->fOffset));
         }
-
-        attribState->disableUnusedArrays(this, usedAttribArraysMask, false);
+        attribState->disableUnusedArrays(this, usedAttribArraysMask);
     }
 }
diff --git a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
index 4c8c378..eacd2a3 100644
--- a/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
+++ b/src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp
@@ -231,7 +231,6 @@
     functions->fClear = (GrGLClearProc) eglGetProcAddress("glClear");
     functions->fClearColor = (GrGLClearColorProc) eglGetProcAddress("glClearColor");
     functions->fClearStencil = (GrGLClearStencilProc) eglGetProcAddress("glClearStencil");
-    functions->fClientActiveTexture = (GrGLClientActiveTextureProc) eglGetProcAddress("glClientActiveTexture");
     functions->fColorMask = (GrGLColorMaskProc) eglGetProcAddress("glColorMask");
     functions->fCompileShader = (GrGLCompileShaderProc) eglGetProcAddress("glCompileShader");
     functions->fCompressedTexImage2D = (GrGLCompressedTexImage2DProc) eglGetProcAddress("glCompressedTexImage2D");
@@ -249,14 +248,12 @@
     functions->fDeleteVertexArrays = (GrGLDeleteVertexArraysProc) eglGetProcAddress("glDeleteVertexArrays");
     functions->fDepthMask = (GrGLDepthMaskProc) eglGetProcAddress("glDepthMask");
     functions->fDisable = (GrGLDisableProc) eglGetProcAddress("glDisable");
-    functions->fDisableClientState = (GrGLDisableClientStateProc) eglGetProcAddress("glDisableClientState");
     functions->fDisableVertexAttribArray = (GrGLDisableVertexAttribArrayProc) eglGetProcAddress("glDisableVertexAttribArray");
     functions->fDrawArrays = (GrGLDrawArraysProc) eglGetProcAddress("glDrawArrays");
     functions->fDrawBuffer = (GrGLDrawBufferProc) eglGetProcAddress("glDrawBuffer");
     functions->fDrawBuffers = (GrGLDrawBuffersProc) eglGetProcAddress("glDrawBuffers");
     functions->fDrawElements = (GrGLDrawElementsProc) eglGetProcAddress("glDrawElements");
     functions->fEnable = (GrGLEnableProc) eglGetProcAddress("glEnable");
-    functions->fEnableClientState = (GrGLEnableClientStateProc) eglGetProcAddress("glEnableClientState");
     functions->fEnableVertexAttribArray = (GrGLEnableVertexAttribArrayProc) eglGetProcAddress("glEnableVertexAttribArray");
     functions->fEndQuery = (GrGLEndQueryProc) eglGetProcAddress("glEndQuery");
     functions->fFinish = (GrGLFinishProc) eglGetProcAddress("glFinish");
@@ -309,7 +306,6 @@
     functions->fStencilMaskSeparate = (GrGLStencilMaskSeparateProc) eglGetProcAddress("glStencilMaskSeparate");
     functions->fStencilOp = (GrGLStencilOpProc) eglGetProcAddress("glStencilOp");
     functions->fStencilOpSeparate = (GrGLStencilOpSeparateProc) eglGetProcAddress("glStencilOpSeparate");
-    functions->fTexGenf = (GrGLTexGenfProc) eglGetProcAddress("glTexGenf");
     functions->fTexGenfv = (GrGLTexGenfvProc) eglGetProcAddress("glTexGenfv");
     functions->fTexGeni = (GrGLTexGeniProc) eglGetProcAddress("glTexGeni");
     functions->fTexImage2D = (GrGLTexImage2DProc) eglGetProcAddress("glTexImage2D");
@@ -340,7 +336,6 @@
     functions->fUseProgram = (GrGLUseProgramProc) eglGetProcAddress("glUseProgram");
     functions->fVertexAttrib4fv = (GrGLVertexAttrib4fvProc) eglGetProcAddress("glVertexAttrib4fv");
     functions->fVertexAttribPointer = (GrGLVertexAttribPointerProc) eglGetProcAddress("glVertexAttribPointer");
-    functions->fVertexPointer = (GrGLVertexPointerProc) eglGetProcAddress("glVertexPointer");
     functions->fViewport = (GrGLViewportProc) eglGetProcAddress("glViewport");
 
     if (extensions.has("GL_NV_path_rendering")) {
diff --git a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
index 97ab9c2..a9cc34a 100644
--- a/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
+++ b/src/gpu/gl/debug/GrGLCreateDebugInterface.cpp
@@ -32,13 +32,6 @@
     GrDebugGL::getInstance()->setCurTextureUnit(texture);
 }
 
-GrGLvoid GR_GL_FUNCTION_TYPE debugGLClientActiveTexture(GrGLenum texture) {
-
-    // Ganesh offsets the texture unit indices
-    texture -= GR_GL_TEXTURE0;
-    GrAlwaysAssert(texture < GrDebugGL::getInstance()->getMaxTextureUnits());
-}
-
 ////////////////////////////////////////////////////////////////////////////////
 GrGLvoid GR_GL_FUNCTION_TYPE debugGLAttachShader(GrGLuint programID,
                                                  GrGLuint shaderID) {
@@ -808,7 +801,6 @@
     functions->fClear = noOpGLClear;
     functions->fClearColor = noOpGLClearColor;
     functions->fClearStencil = noOpGLClearStencil;
-    functions->fClientActiveTexture = debugGLClientActiveTexture;
     functions->fColorMask = noOpGLColorMask;
     functions->fCompileShader = noOpGLCompileShader;
     functions->fCompressedTexImage2D = noOpGLCompressedTexImage2D;
@@ -824,14 +816,12 @@
     functions->fDeleteVertexArrays = debugGLDeleteVertexArrays;
     functions->fDepthMask = noOpGLDepthMask;
     functions->fDisable = noOpGLDisable;
-    functions->fDisableClientState = noOpGLDisableClientState;
     functions->fDisableVertexAttribArray = noOpGLDisableVertexAttribArray;
     functions->fDrawArrays = noOpGLDrawArrays;
     functions->fDrawBuffer = noOpGLDrawBuffer;
     functions->fDrawBuffers = noOpGLDrawBuffers;
     functions->fDrawElements = noOpGLDrawElements;
     functions->fEnable = noOpGLEnable;
-    functions->fEnableClientState = noOpGLEnableClientState;
     functions->fEnableVertexAttribArray = noOpGLEnableVertexAttribArray;
     functions->fEndQuery = noOpGLEndQuery;
     functions->fFinish = noOpGLFinish;
@@ -875,7 +865,6 @@
     functions->fStencilMaskSeparate = noOpGLStencilMaskSeparate;
     functions->fStencilOp = noOpGLStencilOp;
     functions->fStencilOpSeparate = noOpGLStencilOpSeparate;
-    functions->fTexGenf = noOpGLTexGenf;
     functions->fTexGenfv = noOpGLTexGenfv;
     functions->fTexGeni = noOpGLTexGeni;
     functions->fTexImage2D = noOpGLTexImage2D;
@@ -906,7 +895,6 @@
     functions->fUseProgram = debugGLUseProgram;
     functions->fVertexAttrib4fv = noOpGLVertexAttrib4fv;
     functions->fVertexAttribPointer = noOpGLVertexAttribPointer;
-    functions->fVertexPointer = noOpGLVertexPointer;
     functions->fViewport = noOpGLViewport;
     functions->fBindFramebuffer = debugGLBindFramebuffer;
     functions->fBindRenderbuffer = debugGLBindRenderbuffer;
diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
index f580997..3a6e07a 100644
--- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
+++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
@@ -79,7 +79,6 @@
     GET_PROC(Clear);
     GET_PROC(ClearColor);
     GET_PROC(ClearStencil);
-    GET_PROC(ClientActiveTexture);
     GET_PROC(ColorMask);
     GET_PROC(CompileShader);
     GET_PROC(CompressedTexImage2D);
@@ -94,14 +93,12 @@
     GET_PROC(DeleteTextures);
     GET_PROC(DepthMask);
     GET_PROC(Disable);
-    GET_PROC(DisableClientState);
     GET_PROC(DisableVertexAttribArray);
     GET_PROC(DrawArrays);
     GET_PROC(DrawBuffer);
     GET_PROC(DrawBuffers);
     GET_PROC(DrawElements);
     GET_PROC(Enable);
-    GET_PROC(EnableClientState);
     GET_PROC(EnableVertexAttribArray);
     GET_PROC(EndQuery);
     GET_PROC(Finish);
@@ -142,7 +139,6 @@
     GET_PROC(StencilMaskSeparate);
     GET_PROC(StencilOp);
     GET_PROC(StencilOpSeparate);
-    GET_PROC(TexGenf);
     GET_PROC(TexGenfv);
     GET_PROC(TexGeni);
     GET_PROC(TexImage2D);
@@ -178,7 +174,6 @@
     GET_PROC(UseProgram);
     GET_PROC(VertexAttrib4fv);
     GET_PROC(VertexAttribPointer);
-    GET_PROC(VertexPointer);
     GET_PROC(Viewport);
 
     if (ver >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object")) {
diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
index 0ce6d2f..7736d95 100644
--- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
+++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
@@ -63,7 +63,6 @@
         GR_GL_GET_PROC(Clear);
         GR_GL_GET_PROC(ClearColor);
         GR_GL_GET_PROC(ClearStencil);
-        GR_GL_GET_PROC(ClientActiveTexture);
         GR_GL_GET_PROC(ColorMask);
         GR_GL_GET_PROC(CompileShader);
         GR_GL_GET_PROC(CompressedTexImage2D);
@@ -78,14 +77,12 @@
         GR_GL_GET_PROC(DeleteTextures);
         GR_GL_GET_PROC(DepthMask);
         GR_GL_GET_PROC(Disable);
-        GR_GL_GET_PROC(DisableClientState);
         GR_GL_GET_PROC(DisableVertexAttribArray);
         GR_GL_GET_PROC(DrawArrays);
         GR_GL_GET_PROC(DrawBuffer);
         GR_GL_GET_PROC(DrawBuffers);
         GR_GL_GET_PROC(DrawElements);
         GR_GL_GET_PROC(Enable);
-        GR_GL_GET_PROC(EnableClientState);
         GR_GL_GET_PROC(EnableVertexAttribArray);
         GR_GL_GET_PROC(EndQuery);
         GR_GL_GET_PROC(Finish);
@@ -134,7 +131,6 @@
         GR_GL_GET_PROC(StencilMaskSeparate);
         GR_GL_GET_PROC(StencilOp);
         GR_GL_GET_PROC(StencilOpSeparate);
-        GR_GL_GET_PROC(TexGenf);
         GR_GL_GET_PROC(TexGenfv);
         GR_GL_GET_PROC(TexGeni);
         GR_GL_GET_PROC(TexImage2D)
@@ -168,7 +164,6 @@
         GR_GL_GET_PROC(UseProgram);
         GR_GL_GET_PROC(VertexAttrib4fv);
         GR_GL_GET_PROC(VertexAttribPointer);
-        GR_GL_GET_PROC(VertexPointer);
         GR_GL_GET_PROC(Viewport);
 
         if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_ARB_vertex_array_object")) {
diff --git a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
index 8ef5ca2..c395177 100644
--- a/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
+++ b/src/gpu/gl/unix/GrGLCreateNativeInterface_unix.cpp
@@ -63,7 +63,6 @@
         functions->fClear = glClear;
         functions->fClearColor = glClearColor;
         functions->fClearStencil = glClearStencil;
-        functions->fClientActiveTexture = glClientActiveTexture;
         functions->fColorMask = glColorMask;
         GR_GL_GET_PROC(CompileShader);
         functions->fCompressedTexImage2D = glCompressedTexImage2D;
@@ -78,14 +77,12 @@
         functions->fDeleteTextures = glDeleteTextures;
         functions->fDepthMask = glDepthMask;
         functions->fDisable = glDisable;
-        functions->fDisableClientState = glDisableClientState;
         GR_GL_GET_PROC(DisableVertexAttribArray);
         functions->fDrawArrays = glDrawArrays;
         functions->fDrawBuffer = glDrawBuffer;
         GR_GL_GET_PROC(DrawBuffers);
         functions->fDrawElements = glDrawElements;
         functions->fEnable = glEnable;
-        functions->fEnableClientState = glEnableClientState;
         GR_GL_GET_PROC(EnableVertexAttribArray);
         GR_GL_GET_PROC(EndQuery);
         functions->fFinish = glFinish;
@@ -132,7 +129,6 @@
         functions->fStencilOp = glStencilOp;
         GR_GL_GET_PROC(StencilOpSeparate);
         functions->fTexImage2D = glTexImage2D;
-        functions->fTexGenf = glTexGenf;
         functions->fTexGenfv = glTexGenfv;
         functions->fTexGeni = glTexGeni;
         functions->fTexParameteri = glTexParameteri;
@@ -166,7 +162,6 @@
         GR_GL_GET_PROC(UseProgram);
         GR_GL_GET_PROC(VertexAttrib4fv);
         GR_GL_GET_PROC(VertexAttribPointer);
-        GR_GL_GET_PROC(VertexPointer);
         functions->fViewport = glViewport;
         GR_GL_GET_PROC(BindFragDataLocationIndexed);
 
diff --git a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
index 645a582..adc90a4 100644
--- a/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
+++ b/src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp
@@ -90,12 +90,10 @@
         SET_PROC(DeleteTextures)
         SET_PROC(DepthMask)
         SET_PROC(Disable)
-        SET_PROC(DisableClientState)
         SET_PROC(DrawArrays)
         SET_PROC(DrawElements)
         SET_PROC(DrawBuffer)
         SET_PROC(Enable)
-        SET_PROC(EnableClientState)
         SET_PROC(FrontFace)
         SET_PROC(Finish)
         SET_PROC(Flush)
@@ -115,7 +113,6 @@
         SET_PROC(StencilFunc)
         SET_PROC(StencilMask)
         SET_PROC(StencilOp)
-        SET_PROC(TexGenf)
         SET_PROC(TexGenfv)
         SET_PROC(TexGeni)
         SET_PROC(TexImage2D)
@@ -128,7 +125,6 @@
         }
         SET_PROC(TexSubImage2D)
         SET_PROC(Viewport)
-        SET_PROC(VertexPointer)
 
         WGL_SET_PROC(ActiveTexture);
         WGL_SET_PROC(AttachShader);
@@ -138,7 +134,6 @@
         WGL_SET_PROC(BindFragDataLocation);
         WGL_SET_PROC(BufferData);
         WGL_SET_PROC(BufferSubData);
-        WGL_SET_PROC(ClientActiveTexture);
         WGL_SET_PROC(CompileShader);
         WGL_SET_PROC(CompressedTexImage2D);
         WGL_SET_PROC(CreateProgram);