Added support for Chrome's gpu command buffer extension BindUniformLocation.
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
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 613163e..8ef9edf 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -260,7 +260,7 @@
const ModeColorFilterEffect& colorModeFilter = drawEffect.castEffect<ModeColorFilterEffect>();
GrGLfloat c[4];
GrColorToRGBAFloat(colorModeFilter.color(), c);
- uman.set4fv(fFilterColorUni, 0, 1, c);
+ uman.set4fv(fFilterColorUni, 1, c);
}
}
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index d8eb1f1..5b36a8f 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -441,8 +441,8 @@
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:
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index dd23532..db3a1a0 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -36,7 +36,7 @@
#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) {
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 4864aec..6f213d7 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -537,9 +537,9 @@
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();
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 9665dcb..c9855c9 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -434,7 +434,7 @@
default:
GrCrash("Unknown filter direction.");
}
- uman.set2fv(fImageIncrementUni, 0, 1, imageIncrement);
+ uman.set2fv(fImageIncrementUni, 1, imageIncrement);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 94eb72f..2a822e4 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -655,7 +655,7 @@
SkScalarToFloat(diffRadius)
};
- uman.set1fv(fParamUni, 0, 6, values);
+ uman.set1fv(fParamUni, 6, values);
fCachedCenter = centerX1;
fCachedRadius = radius0;
fCachedDiffRadius = diffRadius;
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index 923ed1e..207f3db 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -638,7 +638,7 @@
data.isPosRoot() ? 1.f : -1.f
};
- uman.set1fv(fParamUni, 0, 6, values);
+ uman.set1fv(fParamUni, 6, values);
fCachedCenter = centerX1;
fCachedRadius = radius0;
fCachedPosRoot = data.isPosRoot();