Key shader on whether frag pos read is relative to top-left or bottom-left
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/14633007
git-svn-id: http://skia.googlecode.com/svn/trunk@9113 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index a1cd85e..532923a 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -76,6 +76,7 @@
}
bool readsDst = false;
+ bool readFragPosition = false;
int lastEnabledStage = -1;
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
@@ -90,6 +91,9 @@
if (effect->willReadDstColor()) {
readsDst = true;
}
+ if (effect->willReadFragmentPosition()) {
+ readFragPosition = true;
+ }
} else {
desc->fEffectKeys[s] = 0;
}
@@ -101,10 +105,17 @@
if (NULL != dstCopy) {
dstCopyTexture = dstCopy->texture();
}
- desc->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstCopyTexture, gpu->glCaps());
- GrAssert(0 != desc->fDstRead);
+ desc->fDstReadKey = GrGLShaderBuilder::KeyForDstRead(dstCopyTexture, gpu->glCaps());
+ GrAssert(0 != desc->fDstReadKey);
} else {
- desc->fDstRead = 0;
+ desc->fDstReadKey = 0;
+ }
+
+ if (readFragPosition) {
+ desc->fFragPosKey = GrGLShaderBuilder::KeyForFragmentPosition(drawState.getRenderTarget(),
+ gpu->glCaps());
+ } else {
+ desc->fFragPosKey = 0;
}
desc->fCoverageOutput = kModulate_CoverageOutput;