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

Unified Diff: src/effects/SkDisplacementMapEffect.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/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDisplacementMapEffect.cpp
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index fe918581c421b09ddc3fbe5a0465b60d3c25bce9..3370a76495c17d4dd28ecd48a584401c0ef9dfa7 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -19,8 +19,8 @@
#include "effects/GrTextureDomain.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
-#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLUniformHandler.h"
#endif
namespace {
@@ -549,9 +549,9 @@ GrGLDisplacementMapEffect::~GrGLDisplacementMapEffect() {
void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) {
const GrTextureDomain& domain = args.fFp.cast<GrDisplacementMapEffect>().domain();
- fScaleUni = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kVec2f_GrSLType, kDefault_GrSLPrecision, "Scale");
- const char* scaleUni = args.fBuilder->getUniformCStr(fScaleUni);
+ fScaleUni = args.fUniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kVec2f_GrSLType, kDefault_GrSLPrecision, "Scale");
+ const char* scaleUni = args.fUniformHandler->getUniformCStr(fScaleUni);
const char* dColor = "dColor";
const char* cCoords = "cCoords";
const char* nearZero = "1e-6"; // Since 6.10352e−5 is the smallest half float, use
@@ -610,6 +610,7 @@ void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) {
fragBuilder->codeAppend("-vec2(0.5));\t\t");
fGLDomain.sampleTexture(fragBuilder,
+ args.fUniformHandler,
args.fGLSLCaps,
domain,
args.fOutputColor,
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698