| OLD | NEW |
| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 const GrFragmentProcessor* SkColorShader::asFragmentProcessor(GrContext*, const
SkMatrix&, | 92 const GrFragmentProcessor* SkColorShader::asFragmentProcessor(GrContext*, const
SkMatrix&, |
| 93 const SkMatrix*, | 93 const SkMatrix*, |
| 94 SkFilterQuality) c
onst { | 94 SkFilterQuality, |
| 95 SkSourceGammaTreat
ment) const { |
| 95 GrColor color = SkColorToPremulGrColor(fColor); | 96 GrColor color = SkColorToPremulGrColor(fColor); |
| 96 return GrConstColorProcessor::Create(color, GrConstColorProcessor::kModulate
A_InputMode); | 97 return GrConstColorProcessor::Create(color, GrConstColorProcessor::kModulate
A_InputMode); |
| 97 } | 98 } |
| 98 | 99 |
| 99 #endif | 100 #endif |
| 100 | 101 |
| 101 #ifndef SK_IGNORE_TO_STRING | 102 #ifndef SK_IGNORE_TO_STRING |
| 102 void SkColorShader::toString(SkString* str) const { | 103 void SkColorShader::toString(SkString* str) const { |
| 103 str->append("SkColorShader: ("); | 104 str->append("SkColorShader: ("); |
| 104 | 105 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 } | 212 } |
| 212 return kColor_GradientType; | 213 return kColor_GradientType; |
| 213 } | 214 } |
| 214 | 215 |
| 215 #if SK_SUPPORT_GPU | 216 #if SK_SUPPORT_GPU |
| 216 | 217 |
| 217 #include "SkGr.h" | 218 #include "SkGr.h" |
| 218 #include "effects/GrConstColorProcessor.h" | 219 #include "effects/GrConstColorProcessor.h" |
| 219 const GrFragmentProcessor* SkColor4Shader::asFragmentProcessor(GrContext*, const
SkMatrix&, | 220 const GrFragmentProcessor* SkColor4Shader::asFragmentProcessor(GrContext*, const
SkMatrix&, |
| 220 const SkMatrix*, | 221 const SkMatrix*, |
| 221 SkFilterQuality)
const { | 222 SkFilterQuality, |
| 223 SkSourceGammaTrea
tment) const { |
| 222 // TODO: how to communicate color4f to Gr | 224 // TODO: how to communicate color4f to Gr |
| 223 GrColor color = SkColorToPremulGrColor(fCachedByteColor); | 225 GrColor color = SkColorToPremulGrColor(fCachedByteColor); |
| 224 return GrConstColorProcessor::Create(color, GrConstColorProcessor::kModulate
A_InputMode); | 226 return GrConstColorProcessor::Create(color, GrConstColorProcessor::kModulate
A_InputMode); |
| 225 } | 227 } |
| 226 | 228 |
| 227 #endif | 229 #endif |
| 228 | 230 |
| 229 #ifndef SK_IGNORE_TO_STRING | 231 #ifndef SK_IGNORE_TO_STRING |
| 230 void SkColor4Shader::toString(SkString* str) const { | 232 void SkColor4Shader::toString(SkString* str) const { |
| 231 str->append("SkColor4Shader: ("); | 233 str->append("SkColor4Shader: ("); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 306 } |
| 305 | 307 |
| 306 bool SkColorShader::ColorShaderContext::onChooseBlitProcs(const SkImageInfo& inf
o, | 308 bool SkColorShader::ColorShaderContext::onChooseBlitProcs(const SkImageInfo& inf
o, |
| 307 BlitState* state) { | 309 BlitState* state) { |
| 308 return choose_blitprocs(&fPM4f, info, state); | 310 return choose_blitprocs(&fPM4f, info, state); |
| 309 } | 311 } |
| 310 | 312 |
| 311 bool SkColor4Shader::Color4Context::onChooseBlitProcs(const SkImageInfo& info, B
litState* state) { | 313 bool SkColor4Shader::Color4Context::onChooseBlitProcs(const SkImageInfo& info, B
litState* state) { |
| 312 return choose_blitprocs(&fPM4f, info, state); | 314 return choose_blitprocs(&fPM4f, info, state); |
| 313 } | 315 } |
| OLD | NEW |