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

Unified Diff: src/gpu/effects/GrTextureDomain.cpp

Issue 1490283004: Create GLSLUniformHandler class for gpu backend (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up public api of uniformhandler Created 5 years 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/effects/GrTextureDomain.h ('k') | src/gpu/effects/GrXfermodeFragmentProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrTextureDomain.cpp
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index c0902c617609f6aa0ba9c5331be45536c061cdc1..00e8e82c8eba4dad51b0cbe46596ff427cc0329f 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -10,9 +10,11 @@
#include "GrSimpleTextureEffect.h"
#include "SkFloatingPoint.h"
#include "glsl/GrGLSLFragmentProcessor.h"
-#include "glsl/GrGLSLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLShaderBuilder.h"
#include "glsl/GrGLSLTextureSampler.h"
+#include "glsl/GrGLSLUniformHandler.h"
GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index)
: fIndex(index) {
@@ -42,6 +44,7 @@ GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index)
//////////////////////////////////////////////////////////////////////////////
void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
+ GrGLSLUniformHandler* uniformHandler,
const GrGLSLCaps* glslCaps,
const GrTextureDomain& textureDomain,
const char* outColor,
@@ -51,17 +54,15 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
SkASSERT((Mode)-1 == fMode || textureDomain.mode() == fMode);
SkDEBUGCODE(fMode = textureDomain.mode();)
- GrGLSLProgramBuilder* program = builder->getProgramBuilder();
-
if (textureDomain.mode() != kIgnore_Mode && !fDomainUni.isValid()) {
const char* name;
SkString uniName("TexDom");
if (textureDomain.fIndex >= 0) {
uniName.appendS32(textureDomain.fIndex);
}
- fDomainUni = program->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType, kDefault_GrSLPrecision,
- uniName.c_str(), &name);
+ fDomainUni = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kVec4f_GrSLType, kDefault_GrSLPrecision,
+ uniName.c_str(), &name);
fDomainName = name;
}
@@ -199,6 +200,7 @@ void GrGLTextureDomainEffect::emitCode(EmitArgs& args) {
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0);
fGLDomain.sampleTexture(fragBuilder,
+ args.fUniformHandler,
args.fGLSLCaps,
domain,
args.fOutputColor,
« no previous file with comments | « src/gpu/effects/GrTextureDomain.h ('k') | src/gpu/effects/GrXfermodeFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698