Debian Codegraph @

include/gpu/graphite/precompile/PrecompileMaskFilter.h

raw
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_PrecompileMaskFilter_DEFINED
9 #define skgpu_graphite_precompile_PrecompileMaskFilter_DEFINED
10
11 #include "include/gpu/graphite/precompile/PrecompileBase.h"
12
13 #include "include/gpu/graphite/precompile/PaintOptions.h"
14
15 namespace skgpu::graphite {
16
17 /** \class PrecompileMaskFilter
18 This class corresponds to the SkMaskFilter class in the main API.
19 */
20 class SK_API PrecompileMaskFilter : public PrecompileBase {
21 protected:
22 friend class PaintOptions; // for createPipelines() access
23
24 PrecompileMaskFilter() : PrecompileBase(Type::kMaskFilter) {}
25 ~PrecompileMaskFilter() override;
26
27 void addToKey(const KeyContext&, int desiredCombination) const final;
28
29 virtual void createPipelines(const KeyContext&,
30 const PaintOptions&,
31 const RenderPassDesc&,
32 const PaintOptions::ProcessCombination&) const = 0;
33 };
34
35 //--------------------------------------------------------------------------------------------------
36 // This is the Precompile correlate to the SkMaskFilter class' factories in the main API
37 namespace PrecompileMaskFilters {
38
39 // This corresponds to the SkMaskFilter::MakeBlur factory in the main Skia API.
40 // The specific details of the blur have been elided since they don't impact the generated
41 // shader.
42 SK_API sk_sp<PrecompileMaskFilter> Blur();
43
44 } // namespace PrecompileMaskFilters
45
46 } // namespace skgpu::graphite
47
48
49 #endif // skgpu_graphite_precompile_PrecompileMaskFilter_DEFINED