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*, | 73 const GrFragmentProcessor* SkModeColorFilter::asFragmentProcessor(GrContext*) co
nst { |
74 GrProcessorDat
aManager*) const { | |
75 if (SkXfermode::kDst_Mode == fMode) { | 74 if (SkXfermode::kDst_Mode == fMode) { |
76 return nullptr; | 75 return nullptr; |
77 } | 76 } |
78 | 77 |
79 SkAutoTUnref<const GrFragmentProcessor> constFP( | 78 SkAutoTUnref<const GrFragmentProcessor> constFP( |
80 GrConstColorProcessor::Create(SkColorToPremulGrColor(fColor), | 79 GrConstColorProcessor::Create(SkColorToPremulGrColor(fColor), |
81 GrConstColorProcessor::kIgnore_InputMode
)); | 80 GrConstColorProcessor::kIgnore_InputMode
)); |
82 const GrFragmentProcessor* fp = | 81 const GrFragmentProcessor* fp = |
83 GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode); | 82 GrXfermodeFragmentProcessor::CreateFromSrcProcessor(constFP, fMode); |
84 if (!fp) { | 83 if (!fp) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 byte_to_scale(SkColorGetG(mul)), | 187 byte_to_scale(SkColorGetG(mul)), |
189 byte_to_scale(SkColorGetB(mul)), | 188 byte_to_scale(SkColorGetB(mul)), |
190 1); | 189 1); |
191 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), | 190 matrix.postTranslate(SkIntToScalar(SkColorGetR(add)), |
192 SkIntToScalar(SkColorGetG(add)), | 191 SkIntToScalar(SkColorGetG(add)), |
193 SkIntToScalar(SkColorGetB(add)), | 192 SkIntToScalar(SkColorGetB(add)), |
194 0); | 193 0); |
195 return SkColorMatrixFilter::Create(matrix); | 194 return SkColorMatrixFilter::Create(matrix); |
196 } | 195 } |
197 | 196 |
OLD | NEW |