Index: src/gpu/gl/GrGLXferProcessor.cpp |
diff --git a/src/gpu/gl/GrGLXferProcessor.cpp b/src/gpu/gl/GrGLXferProcessor.cpp |
index 657da41274af0d8f3a7e19c559340d79d7afa668..b707a3f632047d4892518d42f55f1b2454bcc83f 100644 |
--- a/src/gpu/gl/GrGLXferProcessor.cpp |
+++ b/src/gpu/gl/GrGLXferProcessor.cpp |
@@ -12,8 +12,8 @@ |
#include "gl/builders/GrGLProgramBuilder.h" |
void GrGLXferProcessor::emitCode(const EmitArgs& args) { |
- if (args.fXP.getDstCopyTexture()) { |
- bool topDown = kTopLeft_GrSurfaceOrigin == args.fXP.getDstCopyTexture()->origin(); |
+ if (args.fXP.getDstTexture()) { |
+ bool topDown = kTopLeft_GrSurfaceOrigin == args.fXP.getDstTexture()->origin(); |
GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
@@ -27,24 +27,24 @@ void GrGLXferProcessor::emitCode(const EmitArgs& args) { |
const char* dstColor = fsBuilder->dstColor(); |
- const char* dstCopyTopLeftName; |
- const char* dstCopyCoordScaleName; |
+ const char* dstTopLeftName; |
+ const char* dstCoordScaleName; |
- fDstCopyTopLeftUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
- kVec2f_GrSLType, |
- kDefault_GrSLPrecision, |
- "DstCopyUpperLeft", |
- &dstCopyTopLeftName); |
- fDstCopyScaleUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
- kVec2f_GrSLType, |
- kDefault_GrSLPrecision, |
- "DstCopyCoordScale", |
- &dstCopyCoordScaleName); |
+ fDstTopLeftUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
+ kVec2f_GrSLType, |
+ kDefault_GrSLPrecision, |
+ "DstTextureUpperLeft", |
+ &dstTopLeftName); |
+ fDstScaleUni = args.fPB->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
+ kVec2f_GrSLType, |
+ kDefault_GrSLPrecision, |
+ "DstTextureCoordScale", |
+ &dstCoordScaleName); |
const char* fragPos = fsBuilder->fragmentPosition(); |
fsBuilder->codeAppend("// Read color from copy of the destination.\n"); |
fsBuilder->codeAppendf("vec2 _dstTexCoord = (%s.xy - %s) * %s;", |
- fragPos, dstCopyTopLeftName, dstCopyCoordScaleName); |
+ fragPos, dstTopLeftName, dstCoordScaleName); |
if (!topDown) { |
fsBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); |
@@ -59,18 +59,18 @@ void GrGLXferProcessor::emitCode(const EmitArgs& args) { |
} |
void GrGLXferProcessor::setData(const GrGLProgramDataManager& pdm, const GrXferProcessor& xp) { |
- if (xp.getDstCopyTexture()) { |
- if (fDstCopyTopLeftUni.isValid()) { |
- pdm.set2f(fDstCopyTopLeftUni, static_cast<GrGLfloat>(xp.dstCopyTextureOffset().fX), |
- static_cast<GrGLfloat>(xp.dstCopyTextureOffset().fY)); |
- pdm.set2f(fDstCopyScaleUni, 1.f / xp.getDstCopyTexture()->width(), |
- 1.f / xp.getDstCopyTexture()->height()); |
+ if (xp.getDstTexture()) { |
+ if (fDstTopLeftUni.isValid()) { |
+ pdm.set2f(fDstTopLeftUni, static_cast<GrGLfloat>(xp.dstTextureOffset().fX), |
+ static_cast<GrGLfloat>(xp.dstTextureOffset().fY)); |
+ pdm.set2f(fDstScaleUni, 1.f / xp.getDstTexture()->width(), |
+ 1.f / xp.getDstTexture()->height()); |
} else { |
- SkASSERT(!fDstCopyScaleUni.isValid()); |
+ SkASSERT(!fDstScaleUni.isValid()); |
} |
} else { |
- SkASSERT(!fDstCopyTopLeftUni.isValid()); |
- SkASSERT(!fDstCopyScaleUni.isValid()); |
+ SkASSERT(!fDstTopLeftUni.isValid()); |
+ SkASSERT(!fDstScaleUni.isValid()); |
} |
this->onSetData(pdm, xp); |
} |