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

Unified Diff: src/effects/SkAlphaThresholdFilter.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/GrCircleBlurFragmentProcessor.cpp ('k') | src/effects/SkArithmeticMode_gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkAlphaThresholdFilter.cpp
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index e6f1f088cbae9f1ca8775643ade00ad1f9bacaa6..661d0d362ad2eed7ca3ce72b991d8f34d7ff6a19 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -59,8 +59,8 @@ SkImageFilter* SkAlphaThresholdFilter::Create(const SkRegion& region,
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
-#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
+#include "glsl/GrGLSLUniformHandler.h"
class AlphaThresholdEffect : public GrFragmentProcessor {
@@ -139,12 +139,13 @@ private:
};
void GrGLAlphaThresholdEffect::emitCode(EmitArgs& args) {
- fInnerThresholdVar = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType, kDefault_GrSLPrecision,
- "inner_threshold");
- fOuterThresholdVar = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType, kDefault_GrSLPrecision,
- "outer_threshold");
+ GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
+ fInnerThresholdVar = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kFloat_GrSLType, kDefault_GrSLPrecision,
+ "inner_threshold");
+ fOuterThresholdVar = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kFloat_GrSLType, kDefault_GrSLPrecision,
+ "outer_threshold");
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0);
@@ -160,9 +161,9 @@ void GrGLAlphaThresholdEffect::emitCode(EmitArgs& args) {
fragBuilder->codeAppend(";\n");
fragBuilder->codeAppendf("\t\tfloat inner_thresh = %s;\n",
- args.fBuilder->getUniformCStr(fInnerThresholdVar));
+ uniformHandler->getUniformCStr(fInnerThresholdVar));
fragBuilder->codeAppendf("\t\tfloat outer_thresh = %s;\n",
- args.fBuilder->getUniformCStr(fOuterThresholdVar));
+ uniformHandler->getUniformCStr(fOuterThresholdVar));
fragBuilder->codeAppend("\t\tfloat mask = mask_color.a;\n");
fragBuilder->codeAppend("vec4 color = input_color;\n");
« no previous file with comments | « src/effects/GrCircleBlurFragmentProcessor.cpp ('k') | src/effects/SkArithmeticMode_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698