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

Side by Side Diff: src/effects/gradients/SkGradientShader.cpp

Issue 1709153002: Add more specialized fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make MSVC happy Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkGradientShaderPriv.h" 8 #include "SkGradientShaderPriv.h"
9 #include "SkLinearGradient.h" 9 #include "SkLinearGradient.h"
10 #include "SkRadialGradient.h" 10 #include "SkRadialGradient.h"
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 key |= kThreeColorKey; 1013 key |= kThreeColorKey;
1014 } 1014 }
1015 1015
1016 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { 1016 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) {
1017 key |= kPremulBeforeInterpKey; 1017 key |= kPremulBeforeInterpKey;
1018 } 1018 }
1019 1019
1020 return key; 1020 return key;
1021 } 1021 }
1022 1022
1023 void GrGLGradientEffect::emitColor(GrGLSLFragmentBuilder* fragBuilder, 1023 void GrGLGradientEffect::emitColor(GrGLSLFPFragmentBuilder* fragBuilder,
1024 GrGLSLUniformHandler* uniformHandler, 1024 GrGLSLUniformHandler* uniformHandler,
1025 const GrGLSLCaps* glslCaps, 1025 const GrGLSLCaps* glslCaps,
1026 const GrGradientEffect& ge, 1026 const GrGradientEffect& ge,
1027 const char* gradientTValue, 1027 const char* gradientTValue,
1028 const char* outputColor, 1028 const char* outputColor,
1029 const char* inputColor, 1029 const char* inputColor,
1030 const TextureSamplerArray& samplers) { 1030 const TextureSamplerArray& samplers) {
1031 if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){ 1031 if (SkGradientShaderBase::kTwo_GpuColorType == ge.getColorType()){
1032 fragBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0, 1.0));\n", 1032 fragBuilder->codeAppendf("\tvec4 colorTemp = mix(%s, %s, clamp(%s, 0.0, 1.0));\n",
1033 uniformHandler->getUniformVariable(fColorStartU ni).c_str(), 1033 uniformHandler->getUniformVariable(fColorStartU ni).c_str(),
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 (*stops)[i] = stop; 1203 (*stops)[i] = stop;
1204 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1204 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1205 } 1205 }
1206 } 1206 }
1207 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1207 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1208 1208
1209 return outColors; 1209 return outColors;
1210 } 1210 }
1211 1211
1212 #endif 1212 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698