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

Side by Side Diff: src/core/SkColorShader.cpp

Issue 2175563003: Bundle SkShader::asFragmentProcessor arguments in a struct (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix indentation to be less arbitrary 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 unified diff | Download patch
« no previous file with comments | « src/core/SkColorShader.h ('k') | src/core/SkComposeShader.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 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 "SkColorShader.h" 8 #include "SkColorShader.h"
9 #include "SkColorSpace.h" 9 #include "SkColorSpace.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 info->fColorCount = 1; 82 info->fColorCount = 1;
83 info->fTileMode = SkShader::kRepeat_TileMode; 83 info->fTileMode = SkShader::kRepeat_TileMode;
84 } 84 }
85 return kColor_GradientType; 85 return kColor_GradientType;
86 } 86 }
87 87
88 #if SK_SUPPORT_GPU 88 #if SK_SUPPORT_GPU
89 89
90 #include "SkGr.h" 90 #include "SkGr.h"
91 #include "effects/GrConstColorProcessor.h" 91 #include "effects/GrConstColorProcessor.h"
92 sk_sp<GrFragmentProcessor> SkColorShader::asFragmentProcessor(GrContext*, const SkMatrix&, 92 sk_sp<GrFragmentProcessor> SkColorShader::asFragmentProcessor(const AsFPArgs&) c onst {
93 const SkMatrix*,
94 SkFilterQuality,
95 SkSourceGammaTreat ment) const {
96 GrColor color = SkColorToPremulGrColor(fColor); 93 GrColor color = SkColorToPremulGrColor(fColor);
97 return GrConstColorProcessor::Make(color, GrConstColorProcessor::kModulateA_ InputMode); 94 return GrConstColorProcessor::Make(color, GrConstColorProcessor::kModulateA_ InputMode);
98 } 95 }
99 96
100 #endif 97 #endif
101 98
102 #ifndef SK_IGNORE_TO_STRING 99 #ifndef SK_IGNORE_TO_STRING
103 void SkColorShader::toString(SkString* str) const { 100 void SkColorShader::toString(SkString* str) const {
104 str->append("SkColorShader: ("); 101 str->append("SkColorShader: (");
105 102
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 info->fColorCount = 1; 207 info->fColorCount = 1;
211 info->fTileMode = SkShader::kRepeat_TileMode; 208 info->fTileMode = SkShader::kRepeat_TileMode;
212 } 209 }
213 return kColor_GradientType; 210 return kColor_GradientType;
214 } 211 }
215 212
216 #if SK_SUPPORT_GPU 213 #if SK_SUPPORT_GPU
217 214
218 #include "SkGr.h" 215 #include "SkGr.h"
219 #include "effects/GrConstColorProcessor.h" 216 #include "effects/GrConstColorProcessor.h"
220 sk_sp<GrFragmentProcessor> SkColor4Shader::asFragmentProcessor(GrContext*, const SkMatrix&, 217 sk_sp<GrFragmentProcessor> SkColor4Shader::asFragmentProcessor(const AsFPArgs&) const {
221 const SkMatrix*,
222 SkFilterQuality,
223 SkSourceGammaTrea tment) const {
224 // TODO: how to communicate color4f to Gr 218 // TODO: how to communicate color4f to Gr
225 GrColor color = SkColorToPremulGrColor(fCachedByteColor); 219 GrColor color = SkColorToPremulGrColor(fCachedByteColor);
226 return GrConstColorProcessor::Make(color, GrConstColorProcessor::kModulateA_ InputMode); 220 return GrConstColorProcessor::Make(color, GrConstColorProcessor::kModulateA_ InputMode);
227 } 221 }
228 222
229 #endif 223 #endif
230 224
231 #ifndef SK_IGNORE_TO_STRING 225 #ifndef SK_IGNORE_TO_STRING
232 void SkColor4Shader::toString(SkString* str) const { 226 void SkColor4Shader::toString(SkString* str) const {
233 str->append("SkColor4Shader: ("); 227 str->append("SkColor4Shader: (");
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 300 }
307 301
308 bool SkColorShader::ColorShaderContext::onChooseBlitProcs(const SkImageInfo& inf o, 302 bool SkColorShader::ColorShaderContext::onChooseBlitProcs(const SkImageInfo& inf o,
309 BlitState* state) { 303 BlitState* state) {
310 return choose_blitprocs(&fPM4f, info, state); 304 return choose_blitprocs(&fPM4f, info, state);
311 } 305 }
312 306
313 bool SkColor4Shader::Color4Context::onChooseBlitProcs(const SkImageInfo& info, B litState* state) { 307 bool SkColor4Shader::Color4Context::onChooseBlitProcs(const SkImageInfo& info, B litState* state) {
314 return choose_blitprocs(&fPM4f, info, state); 308 return choose_blitprocs(&fPM4f, info, state);
315 } 309 }
OLDNEW
« no previous file with comments | « src/core/SkColorShader.h ('k') | src/core/SkComposeShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698