Make GrGLProgram be responsible for calling setData on custom stages.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6752044
git-svn-id: http://skia.googlecode.com/svn/trunk@6027 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 3c3d852..fcf00af 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -971,3 +971,16 @@
return glStage;
}
+
+void GrGLProgram::setData(const GrDrawState& drawState) const {
+ for (int s = 0; s < GrDrawState::kNumStages; ++s) {
+ if (NULL != fProgramStage[s]) {
+ const GrSamplerState& sampler = drawState.getSampler(s);
+ GrAssert(NULL != sampler.getCustomStage());
+ fProgramStage[s]->setData(fUniformManager,
+ *sampler.getCustomStage(),
+ drawState.getRenderTarget(),
+ s);
+ }
+ }
+}