Added support for Chrome's gpu command buffer extension BindUniformLocation.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 7 Nov 2013 22:06:08 +0000 (22:06 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 7 Nov 2013 22:06:08 +0000 (22:06 +0000)
R=bsalomon@google.com, bsalomon

Author: skaslev@chromium.org

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

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

16 files changed:
include/gpu/gl/GrGLFunctions.h
include/gpu/gl/GrGLInterface.h
src/effects/SkColorFilters.cpp
src/effects/SkColorMatrixFilter.cpp
src/effects/SkLightingImageFilter.cpp
src/effects/SkMatrixConvolutionImageFilter.cpp
src/effects/SkMorphologyImageFilter.cpp
src/effects/gradients/SkTwoPointConicalGradient.cpp
src/effects/gradients/SkTwoPointRadialGradient.cpp
src/gpu/effects/GrBicubicEffect.cpp
src/gpu/effects/GrConvolutionEffect.cpp
src/gpu/effects/GrTextureDomainEffect.cpp
src/gpu/gl/GrGLProgram.cpp
src/gpu/gl/GrGLShaderBuilder.cpp
src/gpu/gl/GrGLUniformManager.cpp
src/gpu/gl/GrGLUniformManager.h

index 4908f14a1ef8aad27a46d46cf651888febdc062a..7417685b28a0adb7f415591a4d5d58609af7a362 100644 (file)
@@ -131,6 +131,8 @@ extern "C" {
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLRenderbufferStorageMultisampleProc)(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height);
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLResolveMultisampleFramebufferProc)();
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLScissorProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height);
+    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindUniformLocation)(GrGLuint program, GrGLint location, const char* name);
+
 #if GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char* const * str, const GrGLint* length);
 #else
index 44a9c7ca2a3a87c9421a60f73f73c5ee2e28e7d9..30690b99eb006afe51d3042d8428f93c82510702 100644 (file)
@@ -252,6 +252,9 @@ public:
     //  the standard function in ES3+ or GL 3.0+.
     GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
 
+    // Pointer to BindUniformLocationCHROMIUM from the GL_CHROMIUM_bind_uniform_location extension.
+    GLPtr<GrGLBindUniformLocation> fBindUniformLocation;
+
     GLPtr<GrGLResolveMultisampleFramebufferProc> fResolveMultisampleFramebuffer;
     GLPtr<GrGLScissorProc> fScissor;
     GLPtr<GrGLShaderSourceProc> fShaderSource;
index 613163e5a6c5d069eeab9cdff0b6eeef9901866d..8ef9edf2b21129304607f8cd55527e1eba977db9 100644 (file)
@@ -260,7 +260,7 @@ public:
                 const ModeColorFilterEffect& colorModeFilter = drawEffect.castEffect<ModeColorFilterEffect>();
                 GrGLfloat c[4];
                 GrColorToRGBAFloat(colorModeFilter.color(), c);
-                uman.set4fv(fFilterColorUni, 0, 1, c);
+                uman.set4fv(fFilterColorUni, 1, c);
             }
         }
 
index d8eb1f17c54c2b28e1602826b18597b0f8275d9a..5b36a8f7e55df1dec60b77de2b29ba6fa81aec39 100644 (file)
@@ -441,8 +441,8 @@ public:
             GrGLfloat vec[] = {
                 m[4] * kScale, m[9] * kScale, m[14] * kScale, m[19] * kScale,
             };
-            uniManager.setMatrix4fv(fMatrixHandle, 0, 1, mt);
-            uniManager.set4fv(fVectorHandle, 0, 1, vec);
+            uniManager.setMatrix4fv(fMatrixHandle, 1, mt);
+            uniManager.set4fv(fVectorHandle, 1, vec);
         }
 
     private:
index dd23532e71e832994b2a9921fce13a52132e5b33..db3a1a0924c402d0fb20803f71fb48fb2a25d34e 100644 (file)
@@ -36,7 +36,7 @@ const SkScalar gOneQuarter = SkFloatToScalar(0.25f);
 #if SK_SUPPORT_GPU
 void setUniformPoint3(const GrGLUniformManager& uman, UniformHandle uni, const SkPoint3& point) {
     GR_STATIC_ASSERT(sizeof(SkPoint3) == 3 * sizeof(GrGLfloat));
-    uman.set3fv(uni, 0, 1, &point.fX);
+    uman.set3fv(uni, 1, &point.fX);
 }
 
 void setUniformNormal3(const GrGLUniformManager& uman, UniformHandle uni, const SkPoint3& point) {
index 4864aec65aefd60798df0062a82465521bb9f601..6f213d71184887a8c61c5ee0c27489d374256003 100644 (file)
@@ -537,9 +537,9 @@ void GrGLMatrixConvolutionEffect::setData(const GrGLUniformManager& uman,
     float ySign = texture.origin() == kTopLeft_GrSurfaceOrigin ? 1.0f : -1.0f;
     imageIncrement[0] = 1.0f / texture.width();
     imageIncrement[1] = ySign / texture.height();
-    uman.set2fv(fImageIncrementUni, 0, 1, imageIncrement);
-    uman.set2fv(fTargetUni, 0, 1, conv.target());
-    uman.set1fv(fKernelUni, 0, fKernelSize.width() * fKernelSize.height(), conv.kernel());
+    uman.set2fv(fImageIncrementUni, 1, imageIncrement);
+    uman.set2fv(fTargetUni, 1, conv.target());
+    uman.set1fv(fKernelUni, fKernelSize.width() * fKernelSize.height(), conv.kernel());
     uman.set1f(fGainUni, conv.gain());
     uman.set1f(fBiasUni, conv.bias());
     const SkIRect& bounds = conv.bounds();
index 9665dcb162b132f24d48f363689a1d811333e2a5..c9855c9086bdd66275f749883ff341f03bc1338f 100644 (file)
@@ -434,7 +434,7 @@ void GrGLMorphologyEffect::setData(const GrGLUniformManager& uman,
         default:
             GrCrash("Unknown filter direction.");
     }
-    uman.set2fv(fImageIncrementUni, 0, 1, imageIncrement);
+    uman.set2fv(fImageIncrementUni, 1, imageIncrement);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index 94eb72f5a08c730ea20d77fe75bc6f32150b2f21..2a822e48292108ce7f31380ed9fc631923ba1715 100644 (file)
@@ -655,7 +655,7 @@ void GrGLConical2Gradient::setData(const GrGLUniformManager& uman,
             SkScalarToFloat(diffRadius)
         };
 
-        uman.set1fv(fParamUni, 0, 6, values);
+        uman.set1fv(fParamUni, 6, values);
         fCachedCenter = centerX1;
         fCachedRadius = radius0;
         fCachedDiffRadius = diffRadius;
index 923ed1e6ba795449eb06429664e75066e65b92f5..207f3db65377bfc6a2aa206a6c000bdf62db37e9 100644 (file)
@@ -638,7 +638,7 @@ void GrGLRadial2Gradient::setData(const GrGLUniformManager& uman,
             data.isPosRoot() ? 1.f : -1.f
         };
 
-        uman.set1fv(fParamUni, 0, 6, values);
+        uman.set1fv(fParamUni, 6, values);
         fCachedCenter = centerX1;
         fCachedRadius = radius0;
         fCachedPosRoot = data.isPosRoot();
index 568311b3ca6694a8eebedb0abde2fff094e5f0e1..f6cc37dc1138b7b5649be1af7f0a2f9dd4436016 100644 (file)
@@ -95,7 +95,7 @@ void GrGLBicubicEffect::setData(const GrGLUniformManager& uman,
     float imageIncrement[2];
     imageIncrement[0] = 1.0f / texture.width();
     imageIncrement[1] = 1.0f / texture.height();
-    uman.set2fv(fImageIncrementUni, 0, 1, imageIncrement);
+    uman.set2fv(fImageIncrementUni, 1, imageIncrement);
     uman.setMatrix4f(fCoefficientsUni, effect.coefficients());
 }
 
index 4d16361fe50f8064fd2a1b8ee2d79bafaf4edb5e..57cdece9d8217f59e58b27c192a2dc3ac540b01f 100644 (file)
@@ -120,7 +120,7 @@ void GrGLConvolutionEffect::setData(const GrGLUniformManager& uman,
         default:
             GrCrash("Unknown filter direction.");
     }
-    uman.set2fv(fImageIncrementUni, 0, 1, imageIncrement);
+    uman.set2fv(fImageIncrementUni, 1, imageIncrement);
     if (conv.useBounds()) {
         const float* bounds = conv.bounds();
         if (Gr1DKernelEffect::kY_Direction == conv.direction() &&
@@ -130,7 +130,7 @@ void GrGLConvolutionEffect::setData(const GrGLUniformManager& uman,
             uman.set2f(fBoundsUni, bounds[0], bounds[1]);
         }
     }
-    uman.set1fv(fKernelUni, 0, this->width(), conv.kernel());
+    uman.set1fv(fKernelUni, this->width(), conv.kernel());
 }
 
 GrGLEffect::EffectKey GrGLConvolutionEffect::GenKey(const GrDrawEffect& drawEffect,
index eca99d73a86b7f64d02028e9505592c2f905e17d..699aa729fd9f04052b0e6b3a77d320b93264cb16 100644 (file)
@@ -113,7 +113,7 @@ void GrGLTextureDomainEffect::setData(const GrGLUniformManager& uman,
         SkTSwap(values[1], values[3]);
     }
     if (0 != memcmp(values, fPrevDomain, 4 * sizeof(GrGLfloat))) {
-        uman.set4fv(fNameUni, 0, 1, values);
+        uman.set4fv(fNameUni, 1, values);
         memcpy(fPrevDomain, values, 4 * sizeof(GrGLfloat));
     }
 }
index f80bc2e550569be8fedac1e7d0d4f328df5d4bf5..accaf884d1774d90be131a5ca5ffaad6da33b63a 100644 (file)
@@ -272,7 +272,7 @@ void GrGLProgram::setColor(const GrDrawState& drawState,
                     // OpenGL ES doesn't support unsigned byte varieties of glUniform
                     GrGLfloat c[4];
                     GrColorToRGBAFloat(color, c);
-                    fUniformManager.set4fv(fUniformHandles.fColorUni, 0, 1, c);
+                    fUniformManager.set4fv(fUniformHandles.fColorUni, 1, c);
                     fColor = color;
                 }
                 sharedState->fConstAttribColorIndex = -1;
@@ -311,7 +311,7 @@ void GrGLProgram::setCoverage(const GrDrawState& drawState,
                     // OpenGL ES doesn't support unsigned byte varieties of glUniform
                     GrGLfloat c[4];
                     GrColorToRGBAFloat(coverage, c);
-                    fUniformManager.set4fv(fUniformHandles.fCoverageUni, 0, 1, c);
+                    fUniformManager.set4fv(fUniformHandles.fCoverageUni, 1, c);
                     fCoverage = coverage;
                 }
                 sharedState->fConstAttribCoverageIndex = -1;
index 348ee2622f0dbeb9efb198ea377997cf4d4c847e..961cad798fcf46b0de06c1dc4817f5bbe954baaa 100644 (file)
@@ -588,6 +588,9 @@ bool GrGLShaderBuilder::finish(GrGLuint* outProgramId) {
     }
 
     this->bindProgramLocations(programId);
+    if (fUniformManager.isUsingBindUniform()) {
+      fUniformManager.getUniformLocations(programId, fUniforms);
+    }
 
     GL_CALL(LinkProgram(programId));
 
@@ -619,7 +622,9 @@ bool GrGLShaderBuilder::finish(GrGLuint* outProgramId) {
         }
     }
 
-    fUniformManager.getUniformLocations(programId, fUniforms);
+    if (!fUniformManager.isUsingBindUniform()) {
+      fUniformManager.getUniformLocations(programId, fUniforms);
+    }
     *outProgramId = programId;
     return true;
 }
index 74bb651fa4b5a6b55680c9d5be49e9ccaaa45568..2d0b48a2bedf9defecd5b4389fd460d4fb8021f4 100644 (file)
 #include "gl/GrGpuGL.h"
 #include "SkMatrix.h"
 
-#define ASSERT_ARRAY_UPLOAD_IN_BOUNDS(UNI, OFFSET, COUNT) \
-         SkASSERT(offset + arrayCount <= uni.fArrayCount || \
-                  (0 == offset && 1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
+#define ASSERT_ARRAY_UPLOAD_IN_BOUNDS(UNI, COUNT) \
+         SkASSERT(arrayCount <= uni.fArrayCount || \
+                  (1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
+
+GrGLUniformManager::GrGLUniformManager(GrGpuGL* gpu) : fGpu(gpu) {
+    fUsingBindUniform = fGpu->glInterface()->fBindUniformLocation != NULL;
+}
 
 GrGLUniformManager::UniformHandle GrGLUniformManager::appendUniform(GrSLType type, int arrayCount) {
     int idx = fUniforms.count();
@@ -56,22 +60,21 @@ void GrGLUniformManager::set1f(UniformHandle u, GrGLfloat v0) const {
 }
 
 void GrGLUniformManager::set1fv(UniformHandle u,
-                                int offset,
                                 int arrayCount,
                                 const GrGLfloat v[]) const {
     const Uniform& uni = fUniforms[u.toUniformIndex()];
     SkASSERT(uni.fType == kFloat_GrSLType);
     SkASSERT(arrayCount > 0);
-    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
+    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
     // This assert fires in some instances of the two-pt gradient for its VSParams.
     // Once the uniform manager is responsible for inserting the duplicate uniform
     // arrays in VS and FS driver bug workaround, this can be enabled.
     //SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
     if (kUnusedUniform != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform1fv(uni.fFSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform1fv(uni.fFSLocation, arrayCount, v));
     }
     if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform1fv(uni.fVSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform1fv(uni.fVSLocation, arrayCount, v));
     }
 }
 
@@ -89,19 +92,18 @@ void GrGLUniformManager::set2f(UniformHandle u, GrGLfloat v0, GrGLfloat v1) cons
 }
 
 void GrGLUniformManager::set2fv(UniformHandle u,
-                                int offset,
                                 int arrayCount,
                                 const GrGLfloat v[]) const {
     const Uniform& uni = fUniforms[u.toUniformIndex()];
     SkASSERT(uni.fType == kVec2f_GrSLType);
     SkASSERT(arrayCount > 0);
-    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
+    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
     SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
     if (kUnusedUniform != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform2fv(uni.fFSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform2fv(uni.fFSLocation, arrayCount, v));
     }
     if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform2fv(uni.fVSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform2fv(uni.fVSLocation, arrayCount, v));
     }
 }
 
@@ -119,19 +121,18 @@ void GrGLUniformManager::set3f(UniformHandle u, GrGLfloat v0, GrGLfloat v1, GrGL
 }
 
 void GrGLUniformManager::set3fv(UniformHandle u,
-                                int offset,
                                 int arrayCount,
                                 const GrGLfloat v[]) const {
     const Uniform& uni = fUniforms[u.toUniformIndex()];
     SkASSERT(uni.fType == kVec3f_GrSLType);
     SkASSERT(arrayCount > 0);
-    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
+    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
     SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
     if (kUnusedUniform != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform3fv(uni.fFSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform3fv(uni.fFSLocation, arrayCount, v));
     }
     if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform3fv(uni.fVSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform3fv(uni.fVSLocation, arrayCount, v));
     }
 }
 
@@ -153,18 +154,18 @@ void GrGLUniformManager::set4f(UniformHandle u,
 }
 
 void GrGLUniformManager::set4fv(UniformHandle u,
-                                int offset,
                                 int arrayCount,
                                 const GrGLfloat v[]) const {
     const Uniform& uni = fUniforms[u.toUniformIndex()];
     SkASSERT(uni.fType == kVec4f_GrSLType);
     SkASSERT(arrayCount > 0);
+    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
     SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
     if (kUnusedUniform != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fFSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fFSLocation, arrayCount, v));
     }
     if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
-        GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fVSLocation + offset, arrayCount, v));
+        GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fVSLocation, arrayCount, v));
     }
 }
 
@@ -196,40 +197,38 @@ void GrGLUniformManager::setMatrix4f(UniformHandle u, const GrGLfloat matrix[])
 }
 
 void GrGLUniformManager::setMatrix3fv(UniformHandle u,
-                                      int offset,
                                       int arrayCount,
                                       const GrGLfloat matrices[]) const {
     const Uniform& uni = fUniforms[u.toUniformIndex()];
     SkASSERT(uni.fType == kMat33f_GrSLType);
     SkASSERT(arrayCount > 0);
-    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
+    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
     SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
     if (kUnusedUniform != uni.fFSLocation) {
         GR_GL_CALL(fGpu->glInterface(),
-                   UniformMatrix3fv(uni.fFSLocation + offset, arrayCount, false, matrices));
+                   UniformMatrix3fv(uni.fFSLocation, arrayCount, false, matrices));
     }
     if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
         GR_GL_CALL(fGpu->glInterface(),
-                   UniformMatrix3fv(uni.fVSLocation + offset, arrayCount, false, matrices));
+                   UniformMatrix3fv(uni.fVSLocation, arrayCount, false, matrices));
     }
 }
 
 void GrGLUniformManager::setMatrix4fv(UniformHandle u,
-                                      int offset,
                                       int arrayCount,
                                       const GrGLfloat matrices[]) const {
     const Uniform& uni = fUniforms[u.toUniformIndex()];
     SkASSERT(uni.fType == kMat44f_GrSLType);
     SkASSERT(arrayCount > 0);
-    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, offset, arrayCount);
+    ASSERT_ARRAY_UPLOAD_IN_BOUNDS(uni, arrayCount);
     SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
     if (kUnusedUniform != uni.fFSLocation) {
         GR_GL_CALL(fGpu->glInterface(),
-                   UniformMatrix4fv(uni.fFSLocation + offset, arrayCount, false, matrices));
+                   UniformMatrix4fv(uni.fFSLocation, arrayCount, false, matrices));
     }
     if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation) {
         GR_GL_CALL(fGpu->glInterface(),
-                   UniformMatrix4fv(uni.fVSLocation + offset, arrayCount, false, matrices));
+                   UniformMatrix4fv(uni.fVSLocation, arrayCount, false, matrices));
     }
 }
 
@@ -258,8 +257,14 @@ void GrGLUniformManager::getUniformLocations(GrGLuint programID, const BuilderUn
         SkASSERT(uniforms[i].fVariable.getArrayCount() == fUniforms[i].fArrayCount);
         GrGLint location;
         // TODO: Move the Xoom uniform array in both FS and VS bug workaround here.
-        GR_GL_CALL_RET(fGpu->glInterface(), location,
+        if (fUsingBindUniform) {
+            location = i;
+            GR_GL_CALL(fGpu->glInterface(),
+                       BindUniformLocation(programID, location, uniforms[i].fVariable.c_str()));
+        } else {
+            GR_GL_CALL_RET(fGpu->glInterface(), location,
                        GetUniformLocation(programID, uniforms[i].fVariable.c_str()));
+        }
         if (GrGLShaderBuilder::kVertex_Visibility & uniforms[i].fVisibility) {
             fUniforms[i].fVSLocation = location;
         }
index eefab049865070d92ea57cb88ccdfb536fea3a18..d7438f9ed7920a662adcfc992c51779aa9de476c 100644 (file)
@@ -46,28 +46,28 @@ public:
         friend class GrGLUniformManager; // For accessing toUniformIndex().
     };
 
-    GrGLUniformManager(GrGpuGL* gpu) : fGpu(gpu) {}
+    GrGLUniformManager(GrGpuGL* gpu);
 
     UniformHandle appendUniform(GrSLType type, int arrayCount = GrGLShaderVar::kNonArray);
 
     /** Functions for uploading uniform values. The varities ending in v can be used to upload to an
-     *  array of uniforms. offset + arrayCount must be <= the array count of the uniform.
+     *  array of uniforms. arrayCount must be <= the array count of the uniform.
      */
     void setSampler(UniformHandle, GrGLint texUnit) const;
     void set1f(UniformHandle, GrGLfloat v0) const;
-    void set1fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
+    void set1fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
     void set2f(UniformHandle, GrGLfloat, GrGLfloat) const;
-    void set2fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
+    void set2fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
     void set3f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat) const;
-    void set3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
+    void set3fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
     void set4f(UniformHandle, GrGLfloat, GrGLfloat, GrGLfloat, GrGLfloat) const;
-    void set4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat v[]) const;
+    void set4fv(UniformHandle, int arrayCount, const GrGLfloat v[]) const;
     // matrices are column-major, the first three upload a single matrix, the latter three upload
     // arrayCount matrices into a uniform array.
     void setMatrix3f(UniformHandle, const GrGLfloat matrix[]) const;
     void setMatrix4f(UniformHandle, const GrGLfloat matrix[]) const;
-    void setMatrix3fv(UniformHandle, int offset, int arrayCount, const GrGLfloat matrices[]) const;
-    void setMatrix4fv(UniformHandle, int offset, int arrayCount, const GrGLfloat matrices[]) const;
+    void setMatrix3fv(UniformHandle, int arrayCount, const GrGLfloat matrices[]) const;
+    void setMatrix4fv(UniformHandle, int arrayCount, const GrGLfloat matrices[]) const;
 
     // convenience method for uploading a SkMatrix to a 3x3 matrix uniform
     void setSkMatrix(UniformHandle, const SkMatrix&) const;
@@ -81,6 +81,13 @@ public:
     // name strings. Otherwise, we'd have to hand out copies.
     typedef GrTAllocator<BuilderUniform> BuilderUniformArray;
 
+    /**
+     * Called by the GrGLShaderBuilder to know if the manager is using
+     * BindUniformLocation. In that case getUniformLocations must be called
+     * before the program is linked.
+     */
+    bool isUsingBindUniform() const { return fUsingBindUniform; }
+
     /**
      * Called by the GrGLShaderBuilder to get GL locations for all uniforms.
      */
@@ -103,6 +110,7 @@ private:
         int         fArrayCount;
     };
 
+    bool fUsingBindUniform;
     SkTArray<Uniform, true> fUniforms;
     GrGpuGL* fGpu;
 };