OLD | NEW |
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 "SkBlitRow.h" | 8 #include "SkBlitRow.h" |
9 #include "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 /////////////////////////////////////////////////////////////////////////////// | 65 /////////////////////////////////////////////////////////////////////////////// |
66 #if SK_SUPPORT_GPU | 66 #if SK_SUPPORT_GPU |
67 #include "GrBlend.h" | 67 #include "GrBlend.h" |
68 #include "GrInvariantOutput.h" | 68 #include "GrInvariantOutput.h" |
69 #include "effects/GrXfermodeFragmentProcessor.h" | 69 #include "effects/GrXfermodeFragmentProcessor.h" |
70 #include "effects/GrConstColorProcessor.h" | 70 #include "effects/GrConstColorProcessor.h" |
71 #include "SkGr.h" | 71 #include "SkGr.h" |
72 | 72 |
73 const GrFragmentProcessor* SkModeColorFilter::asFragmentProcessor(GrContext*) co
nst { | 73 const GrFragmentProcessor* SkModeColorFilter::asFragmentProcessor(GrContext*, |
| 74 GrRenderTarget
* dst) const { |
74 if (SkXfermode::kDst_Mode == fMode) { | 75 if (SkXfermode::kDst_Mode == fMode) { |
75 return nullptr; | 76 return nullptr; |
76 } | 77 } |
77 | 78 |
78 SkAutoTUnref<const GrFragmentProcessor> constFP( | 79 SkAutoTUnref<const GrFragmentProcessor> constFP( |
79 GrConstColorProcessor::Create(SkColorToPremulGrColor(fColor), | 80 GrConstColorProcessor::Create(SkColorToPremulGrColor(fColor), |
80 GrConstColorProcessor::kIgnore_InputMode
)); | 81 GrConstColorProcessor::kIgnore_InputMode
)); |
81 const GrFragmentProcessor* fp = | 82 const GrFragmentProcessor* fp = |
82 GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode); | 83 GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode); |
83 if (!fp) { | 84 if (!fp) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 byte_to_scale(SkColorGetG(mul)), | 188 byte_to_scale(SkColorGetG(mul)), |
188 byte_to_scale(SkColorGetB(mul)), | 189 byte_to_scale(SkColorGetB(mul)), |
189 1); | 190 1); |
190 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), | 191 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), |
191 SkIntToScalar(SkColorGetG(add)), | 192 SkIntToScalar(SkColorGetG(add)), |
192 SkIntToScalar(SkColorGetB(add)), | 193 SkIntToScalar(SkColorGetB(add)), |
193 0); | 194 0); |
194 return SkColorMatrixFilter::Create(matrix); | 195 return SkColorMatrixFilter::Create(matrix); |
195 } | 196 } |
196 | 197 |
OLD | NEW |