OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #ifndef GrXfermodeFragmentProcessor_DEFINED | 8 #ifndef GrXfermodeFragmentProcessor_DEFINED |
9 #define GrXfermodeFragmentProcessor_DEFINED | 9 #define GrXfermodeFragmentProcessor_DEFINED |
10 | 10 |
11 #include "SkXfermode.h" | 11 #include "SkXfermode.h" |
12 | 12 |
13 class GrFragmentProcessor; | 13 class GrFragmentProcessor; |
14 | 14 |
15 namespace GrXfermodeFragmentProcessor { | 15 namespace GrXfermodeFragmentProcessor { |
16 /** The color input to the returned processor is treated as the src and the
passed in processor | 16 /** The color input to the returned processor is treated as the src and the
passed in processor |
17 is the dst. */ | 17 is the dst. */ |
18 const GrFragmentProcessor* CreateFromDstProcessor(const GrFragmentProcessor*
dst, | 18 sk_sp<GrFragmentProcessor> MakeFromDstProcessor(sk_sp<GrFragmentProcessor> d
st, |
19 SkXfermode::Mode mode); | 19 SkXfermode::Mode mode); |
20 | 20 |
21 /** The color input to the returned processor is treated as the dst and the
passed in processor | 21 /** The color input to the returned processor is treated as the dst and the
passed in processor |
22 is the src. */ | 22 is the src. */ |
23 const GrFragmentProcessor* CreateFromSrcProcessor(const GrFragmentProcessor*
src, | 23 sk_sp<GrFragmentProcessor> MakeFromSrcProcessor(sk_sp<GrFragmentProcessor> s
rc, |
24 SkXfermode::Mode mode); | 24 SkXfermode::Mode mode); |
25 | 25 |
26 /** Takes the input color, which is assumed to be unpremultiplied, passes it
as an opaque color | 26 /** Takes the input color, which is assumed to be unpremultiplied, passes it
as an opaque color |
27 to both src and dst. The outputs of a src and dst are blended using mode
and the original | 27 to both src and dst. The outputs of a src and dst are blended using mode
and the original |
28 input's alpha is applied to the blended color to produce a premul output
. */ | 28 input's alpha is applied to the blended color to produce a premul output
. */ |
29 const GrFragmentProcessor* CreateFromTwoProcessors(const GrFragmentProcessor
* src, | 29 sk_sp<GrFragmentProcessor> MakeFromTwoProcessors(sk_sp<GrFragmentProcessor>
src, |
30 const GrFragmentProcessor
* dst, | 30 sk_sp<GrFragmentProcessor>
dst, |
31 SkXfermode::Mode mode); | 31 SkXfermode::Mode mode); |
32 }; | 32 }; |
33 | 33 |
34 #endif | 34 #endif |
OLD | NEW |