Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Unified Diff: src/gpu/gl/GrGLXferProcessor.cpp

Issue 1132093004: Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (Closed) Base URL: https://skia.googlesource.com/skia.git@copy
Patch Set: remove asserts Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLXferProcessor.h ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/gpu/gl/GrGLXferProcessor.h ('k') | src/gpu/gl/builders/GrGLFragmentShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698