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

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

Issue 2221133002: Refactor various gradient effect classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Brian's suggestions Created 4 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 | « no previous file | src/effects/gradients/SkGradientShaderPriv.h » ('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 52fbe81daf454925cefdf472c07b04a5ee81efb9..710bde826ed7d59600d182866367442e00151856 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -911,12 +911,12 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
#include "glsl/GrGLSLUniformHandler.h"
#include "SkGr.h"
-GrGLGradientEffect::GrGLGradientEffect()
+GrGradientEffect::GLSLProcessor::GLSLProcessor()
: fCachedYCoord(SK_ScalarMax) {
}
-void GrGLGradientEffect::emitUniforms(GrGLSLUniformHandler* uniformHandler,
- const GrGradientEffect& ge) {
+void GrGradientEffect::GLSLProcessor::emitUniforms(GrGLSLUniformHandler* uniformHandler,
+ const GrGradientEffect& ge) {
if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()) { // 2 Color case
fColorStartUni = uniformHandler->addUniform(kFragment_GrShaderFlag,
@@ -966,8 +966,8 @@ static inline void set_mul_color_uni(const GrGLSLProgramDataManager& pdman,
a);
}
-void GrGLGradientEffect::onSetData(const GrGLSLProgramDataManager& pdman,
- const GrProcessor& processor) {
+void GrGradientEffect::GLSLProcessor::onSetData(const GrGLSLProgramDataManager& pdman,
+ const GrProcessor& processor) {
const GrGradientEffect& e = processor.cast<GrGradientEffect>();
@@ -1004,7 +1004,7 @@ void GrGLGradientEffect::onSetData(const GrGLSLProgramDataManager& pdman,
}
-uint32_t GrGLGradientEffect::GenBaseGradientKey(const GrProcessor& processor) {
+uint32_t GrGradientEffect::GLSLProcessor::GenBaseGradientKey(const GrProcessor& processor) {
const GrGradientEffect& e = processor.cast<GrGradientEffect>();
uint32_t key = 0;
@@ -1022,14 +1022,14 @@ uint32_t GrGLGradientEffect::GenBaseGradientKey(const GrProcessor& processor) {
return key;
}
-void GrGLGradientEffect::emitColor(GrGLSLFPFragmentBuilder* fragBuilder,
- GrGLSLUniformHandler* uniformHandler,
- const GrGLSLCaps* glslCaps,
- const GrGradientEffect& ge,
- const char* gradientTValue,
- const char* outputColor,
- const char* inputColor,
- const SamplerHandle* texSamplers) {
+void GrGradientEffect::GLSLProcessor::emitColor(GrGLSLFPFragmentBuilder* fragBuilder,
+ GrGLSLUniformHandler* uniformHandler,
+ const GrGLSLCaps* glslCaps,
+ const GrGradientEffect& ge,
+ const char* gradientTValue,
+ const char* outputColor,
+ const char* inputColor,
+ const SamplerHandle* texSamplers) {
if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){
fragBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0, 1.0));\n",
uniformHandler->getUniformVariable(fColorStartUni).c_str(),
« no previous file with comments | « no previous file | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698