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

Unified Diff: src/effects/gradients/SkGradientShader.cpp

Issue 1438003003: Move all ShaderBuilder files to GLSL (Closed) Base URL: https://skia.googlesource.com/skia.git@glslProgBuild
Patch Set: nits Created 5 years, 1 month 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/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkGradientShader.cpp
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 9909f310ababbe7aca43e86d27679b3f2870577e..f11d0787b9916198cfd7841972dff27c17fcaa6d 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -909,7 +909,8 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
#include "effects/GrTextureStripAtlas.h"
#include "GrInvariantOutput.h"
#include "gl/GrGLContext.h"
-#include "gl/builders/GrGLProgramBuilder.h"
+#include "glsl/GrGLSLFragmentShaderBuilder.h"
+#include "glsl/GrGLSLProgramBuilder.h"
#include "glsl/GrGLSLProgramDataManager.h"
#include "SkGr.h"
@@ -922,26 +923,26 @@ GrGLGradientEffect::~GrGLGradientEffect() { }
void GrGLGradientEffect::emitUniforms(GrGLSLFPBuilder* builder, const GrGradientEffect& ge) {
if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()) { // 2 Color case
- fColorStartUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorStartUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientStartColor");
- fColorEndUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorEndUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientEndColor");
} else if (SkGradientShaderBase::kThree_GpuColorType == ge.getColorType()) { // 3 Color Case
- fColorStartUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorStartUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientStartColor");
- fColorMidUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorMidUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientMidColor");
- fColorEndUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fColorEndUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType, kDefault_GrSLPrecision,
"GradientEndColor");
} else { // if not a fast case
- fFSYUni = builder->addUniform(GrGLProgramBuilder::kFragment_Visibility,
+ fFSYUni = builder->addUniform(GrGLSLProgramBuilder::kFragment_Visibility,
kFloat_GrSLType, kDefault_GrSLPrecision,
"GradientYCoordFS");
}
@@ -1031,7 +1032,7 @@ void GrGLGradientEffect::emitColor(GrGLSLFPBuilder* builder,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) {
- GrGLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
+ GrGLSLFragmentBuilder* fsBuilder = builder->getFragmentShaderBuilder();
if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){
fsBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0, 1.0));\n",
builder->getUniformVariable(fColorStartUni).c_str(),
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698