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

Unified Diff: src/effects/SkBlurMaskFilter.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/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkColorCubeFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 8dd82c5ac369851076dc21ef424e28d699dc655e..ca0b18042b390b956dd6e2a3ce920667588686c6 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -29,9 +29,9 @@
#include "effects/GrSimpleTextureEffect.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
-#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "glsl/GrGLSLTextureSampler.h"
+#include "glsl/GrGLSLUniformHandler.h"
#endif
SkScalar SkBlurMaskFilter::ConvertRadiusToSigma(SkScalar radius) {
@@ -720,21 +720,22 @@ void GrGLRectBlurEffect::GenKey(GrSLPrecision precision, GrProcessorKeyBuilder*
void GrGLRectBlurEffect::emitCode(EmitArgs& args) {
+ GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
const char *rectName;
const char *profileSizeName;
const char* precisionString = GrGLSLShaderVar::PrecisionString(args.fGLSLCaps, fPrecision);
- fProxyRectUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType,
- fPrecision,
- "proxyRect",
- &rectName);
- fProfileSizeUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType,
- kDefault_GrSLPrecision,
- "profileSize",
- &profileSizeName);
+ fProxyRectUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kVec4f_GrSLType,
+ fPrecision,
+ "proxyRect",
+ &rectName);
+ fProfileSizeUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kFloat_GrSLType,
+ kDefault_GrSLPrecision,
+ "profileSize",
+ &profileSizeName);
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
const char *fragmentPos = fragBuilder->fragmentPosition();
@@ -1063,24 +1064,25 @@ void GrGLRRectBlurEffect::emitCode(EmitArgs& args) {
const char *cornerRadiusName;
const char *blurRadiusName;
+ GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
// The proxy rect has left, top, right, and bottom edges correspond to
// components x, y, z, and w, respectively.
- fProxyRectUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kVec4f_GrSLType,
- kDefault_GrSLPrecision,
- "proxyRect",
- &rectName);
- fCornerRadiusUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType,
- kDefault_GrSLPrecision,
- "cornerRadius",
- &cornerRadiusName);
- fBlurRadiusUniform = args.fBuilder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
- kFloat_GrSLType,
+ fProxyRectUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kVec4f_GrSLType,
kDefault_GrSLPrecision,
- "blurRadius",
- &blurRadiusName);
+ "proxyRect",
+ &rectName);
+ fCornerRadiusUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kFloat_GrSLType,
+ kDefault_GrSLPrecision,
+ "cornerRadius",
+ &cornerRadiusName);
+ fBlurRadiusUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
+ kFloat_GrSLType,
+ kDefault_GrSLPrecision,
+ "blurRadius",
+ &blurRadiusName);
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
const char* fragmentPos = fragBuilder->fragmentPosition();
« no previous file with comments | « src/effects/SkArithmeticMode_gpu.cpp ('k') | src/effects/SkColorCubeFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698