OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkLumaColorFilter.h" | 8 #include "SkLumaColorFilter.h" |
9 | 9 |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
11 #include "SkString.h" | 11 #include "SkString.h" |
12 | 12 |
13 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
14 #include "GrContext.h" | 14 #include "GrContext.h" |
15 #include "GrInvariantOutput.h" | 15 #include "GrInvariantOutput.h" |
16 #include "glsl/GrGLSLFragmentProcessor.h" | 16 #include "glsl/GrGLSLFragmentProcessor.h" |
17 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 17 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
18 #include "glsl/GrGLSLProgramBuilder.h" | |
19 #endif | 18 #endif |
20 | 19 |
21 void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count, | 20 void SkLumaColorFilter::filterSpan(const SkPMColor src[], int count, |
22 SkPMColor dst[]) const { | 21 SkPMColor dst[]) const { |
23 for (int i = 0; i < count; ++i) { | 22 for (int i = 0; i < count; ++i) { |
24 SkPMColor c = src[i]; | 23 SkPMColor c = src[i]; |
25 | 24 |
26 /* | 25 /* |
27 * While LuminanceToAlpha is defined to operate on un-premultiplied | 26 * While LuminanceToAlpha is defined to operate on un-premultiplied |
28 * inputs, due to the final alpha scaling it can be computed based on | 27 * inputs, due to the final alpha scaling it can be computed based on |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
), | 107 inout->setToOther(kRGB_GrColorComponentFlags, GrColorPackRGBA(0, 0, 0, 0
), |
109 GrInvariantOutput::kWill_ReadInput); | 108 GrInvariantOutput::kWill_ReadInput); |
110 } | 109 } |
111 }; | 110 }; |
112 | 111 |
113 const GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) co
nst { | 112 const GrFragmentProcessor* SkLumaColorFilter::asFragmentProcessor(GrContext*) co
nst { |
114 | 113 |
115 return LumaColorFilterEffect::Create(); | 114 return LumaColorFilterEffect::Create(); |
116 } | 115 } |
117 #endif | 116 #endif |
OLD | NEW |