Flutter Engine
The Flutter Engine
PrecompileColorFilter.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef skgpu_graphite_precompile_PrecompileColorFilter_DEFINED
9#define skgpu_graphite_precompile_PrecompileColorFilter_DEFINED
10
12
13namespace skgpu::graphite {
14
15/** \class PrecompileColorFilter
16 This class corresponds to the SkColorFilter class in the main API.
17*/
19public:
20 /**
21 * This is the Precompile correlate to SkColorFilter::makeComposed.
22 *
23 * The PrecompileColorFilters::Compose factory can be used to generate a set of color filters
24 * that would've been generated via multiple makeComposed calls. That is, rather than
25 * performing:
26 * sk_sp<PrecompileColorFilter> option1 = outer->makeComposed(colorFilter1);
27 * sk_sp<PrecompileColorFilter> option2 = outer->makeComposed(colorFilter2);
28 * one could call:
29 * sk_sp<PrecompileColorFilter> combinedOptions = Compose({ outer },
30 * { colorFilter1, colorFilter2 });
31 * With an alternative use case one could also use the Compose factory thusly:
32 * sk_sp<PrecompileColorFilter> combinedOptions = Compose({ outer1, outer2 },
33 * { innerColorFilter });
34 */
36
37protected:
40};
41
42//--------------------------------------------------------------------------------------------------
43// This is the Precompile correlate to the SkColorFilters namespace in the main API
44namespace PrecompileColorFilters {
45
46 // --- The next 9 entries match those in include/core/SkColorFilter.h
49
50 // This encompasses both variants of SkColorFilters::Blend
52
53 // This encompasses both variants of SkColorFilters::Matrix
55
56 // This encompasses both variants of SkColorFilters::HSLAMatrix
58
62 SkSpan<const sk_sp<PrecompileColorFilter>> srcOptions);
63
64 // This encompases both the SkColorFilters::Table and TableARGB variants
66
68
69 // This matches the main API's factory in include/effects/SkHighContrastFilter.h
71
72 // This matches the main API's factory in include/effects/SkLumaColorFilter.h
74
75 // This matches the main API's factory in include/effects/SkOverdrawColorFilter.h
77
78} // namespace PrecompileColorFilters
79
80} // namespace skgpu::graphite
81
82#endif // skgpu_graphite_precompile_PrecompileColorFilter_DEFINED
#define SK_API
Definition: SkAPI.h:35
SK_API sk_sp< PrecompileColorFilter > HSLAMatrix()
SK_API sk_sp< PrecompileColorFilter > Blend()
SK_API sk_sp< PrecompileColorFilter > Matrix()
SK_API sk_sp< PrecompileColorFilter > Overdraw()
SK_API sk_sp< PrecompileColorFilter > Lighting()
SK_API sk_sp< PrecompileColorFilter > Luma()
SK_API sk_sp< PrecompileColorFilter > Compose(SkSpan< const sk_sp< PrecompileColorFilter > > outer, SkSpan< const sk_sp< PrecompileColorFilter > > inner)
SK_API sk_sp< PrecompileColorFilter > HighContrast()
SK_API sk_sp< PrecompileColorFilter > SRGBToLinearGamma()
SK_API sk_sp< PrecompileColorFilter > LinearToSRGBGamma()
SK_API sk_sp< PrecompileColorFilter > Table()
SK_API sk_sp< PrecompileColorFilter > Lerp(SkSpan< const sk_sp< PrecompileColorFilter > > dstOptions, SkSpan< const sk_sp< PrecompileColorFilter > > srcOptions)