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

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

Issue 1287023009: Added tree structure to GrGLFragmentProcessor, i.e. GL instances (Closed) Base URL: https://skia.googlesource.com/skia@cs3_isequal_nonrecursive
Patch Set: moved onSetData from public to protected, onCreateGLInstance from public to private in subclasses Created 5 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 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 const SkColor* color){ 933 const SkColor* color){
934 float a = SkColorGetA(*color) / 255.f; 934 float a = SkColorGetA(*color) / 255.f;
935 float aDiv255 = a / 255.f; 935 float aDiv255 = a / 255.f;
936 pdman.set4f(uni, 936 pdman.set4f(uni,
937 SkColorGetR(*color) * aDiv255, 937 SkColorGetR(*color) * aDiv255,
938 SkColorGetG(*color) * aDiv255, 938 SkColorGetG(*color) * aDiv255,
939 SkColorGetB(*color) * aDiv255, 939 SkColorGetB(*color) * aDiv255,
940 a); 940 a);
941 } 941 }
942 942
943 void GrGLGradientEffect::setData(const GrGLProgramDataManager& pdman, 943 void GrGLGradientEffect::onSetData(const GrGLProgramDataManager& pdman,
944 const GrProcessor& processor) { 944 const GrProcessor& processor) {
945 945
946 const GrGradientEffect& e = processor.cast<GrGradientEffect>(); 946 const GrGradientEffect& e = processor.cast<GrGradientEffect>();
947 947
948 948
949 if (SkGradientShaderBase::kTwo_GpuColorType == e.getColorType()){ 949 if (SkGradientShaderBase::kTwo_GpuColorType == e.getColorType()){
950 950
951 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) { 951 if (GrGradientEffect::kBeforeInterp_PremulType == e.getPremulType()) {
952 set_mul_color_uni(pdman, fColorStartUni, e.getColors(0)); 952 set_mul_color_uni(pdman, fColorStartUni, e.getColors(0));
953 set_mul_color_uni(pdman, fColorEndUni, e.getColors(1)); 953 set_mul_color_uni(pdman, fColorEndUni, e.getColors(1));
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1178 (*stops)[i] = stop; 1178 (*stops)[i] = stop;
1179 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1179 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1180 } 1180 }
1181 } 1181 }
1182 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1182 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1183 1183
1184 return outColors; 1184 return outColors;
1185 } 1185 }
1186 1186
1187 #endif 1187 #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