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

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

Issue 699943003: Move GrInvariantOutput out of GrProcessor and into its own class. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Cleanup Created 6 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 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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSweepGradient) 938 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSweepGradient)
939 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointRadialGradient) 939 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointRadialGradient)
940 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointConicalGradient) 940 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTwoPointConicalGradient)
941 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 941 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
942 942
943 /////////////////////////////////////////////////////////////////////////////// 943 ///////////////////////////////////////////////////////////////////////////////
944 944
945 #if SK_SUPPORT_GPU 945 #if SK_SUPPORT_GPU
946 946
947 #include "effects/GrTextureStripAtlas.h" 947 #include "effects/GrTextureStripAtlas.h"
948 #include "GrInvariantOutput.h"
948 #include "GrTBackendProcessorFactory.h" 949 #include "GrTBackendProcessorFactory.h"
949 #include "gl/builders/GrGLProgramBuilder.h" 950 #include "gl/builders/GrGLProgramBuilder.h"
950 #include "SkGr.h" 951 #include "SkGr.h"
951 952
952 GrGLGradientEffect::GrGLGradientEffect(const GrBackendProcessorFactory& factory) 953 GrGLGradientEffect::GrGLGradientEffect(const GrBackendProcessorFactory& factory)
953 : INHERITED(factory) 954 : INHERITED(factory)
954 , fCachedYCoord(SK_ScalarMax) { 955 , fCachedYCoord(SK_ScalarMax) {
955 } 956 }
956 957
957 GrGLGradientEffect::~GrGLGradientEffect() { } 958 GrGLGradientEffect::~GrGLGradientEffect() { }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 } 1202 }
1202 } 1203 }
1203 1204
1204 SkASSERT(this->useAtlas() == s.useAtlas()); 1205 SkASSERT(this->useAtlas() == s.useAtlas());
1205 return true; 1206 return true;
1206 } 1207 }
1207 1208
1208 return false; 1209 return false;
1209 } 1210 }
1210 1211
1211 void GrGradientEffect::onComputeInvariantOutput(InvariantOutput* inout) const { 1212 void GrGradientEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
1212 if (fIsOpaque) { 1213 if (fIsOpaque) {
1213 inout->mulByUnknownOpaqueColor(); 1214 inout->mulByUnknownOpaqueColor();
1214 } else { 1215 } else {
1215 inout->mulByUnknownColor(); 1216 inout->mulByUnknownColor();
1216 } 1217 }
1217 } 1218 }
1218 1219
1219 int GrGradientEffect::RandomGradientParams(SkRandom* random, 1220 int GrGradientEffect::RandomGradientParams(SkRandom* random,
1220 SkColor colors[], 1221 SkColor colors[],
1221 SkScalar** stops, 1222 SkScalar** stops,
(...skipping 12 matching lines...) Expand all
1234 (*stops)[i] = stop; 1235 (*stops)[i] = stop;
1235 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1236 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1236 } 1237 }
1237 } 1238 }
1238 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1239 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1239 1240
1240 return outColors; 1241 return outColors;
1241 } 1242 }
1242 1243
1243 #endif 1244 #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