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

Unified Diff: src/effects/SkColorFilters.cpp

Issue 491673002: Initial refactor of shaderbuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkColorFilters.cpp
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index bcaabf6c9bbf51105d26e0f1ccb231e7d75c659c..e825695d58554367b5bc334a37124cf9f9f76d48 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -127,7 +127,7 @@ SkFlattenable* SkModeColorFilter::CreateProc(SkReadBuffer& buffer) {
#include "GrEffectUnitTest.h"
#include "GrTBackendEffectFactory.h"
#include "gl/GrGLEffect.h"
-#include "gl/GrGLShaderBuilder.h"
+#include "gl/builders/GrGLProgramBuilder.h"
#include "SkGr.h"
namespace {
@@ -222,7 +222,7 @@ public:
: INHERITED(factory) {
}
- virtual void emitCode(GrGLShaderBuilder* builder,
+ virtual void emitCode(GrGLProgramBuilder* builder,
const GrDrawEffect& drawEffect,
const GrEffectKey& key,
const char* outputColor,
@@ -234,7 +234,7 @@ public:
SkASSERT(SkXfermode::kDst_Mode != mode);
const char* colorFilterColorUniName = NULL;
if (drawEffect.castEffect<ModeColorFilterEffect>().willUseFilterColor()) {
- fFilterColorUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
+ fFilterColorUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, "FilterColor",
&colorFilterColorUniName);
}
@@ -242,7 +242,8 @@ public:
GrGLSLExpr4 filter =
color_filter_expression(mode, GrGLSLExpr4(colorFilterColorUniName), GrGLSLExpr4(inputColor));
- builder->fsCodeAppendf("\t%s = %s;\n", outputColor, filter.c_str());
+ builder->getFragmentShaderBuilder()->
+ codeAppendf("\t%s = %s;\n", outputColor, filter.c_str());
}
static void GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
« no previous file with comments | « src/effects/SkBlurMaskFilter.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698