Flutter Engine
The Flutter Engine
PrecompileBlenderPriv.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_PrecompileBlenderPriv_DEFINED
9#define skgpu_graphite_PrecompileBlenderPriv_DEFINED
10
12
13namespace skgpu::graphite {
14
15/** Class that exposes methods in PrecompileBlender that are only intended for use internal to Skia.
16 This class is purely a privileged window into PrecompileBlender. It should never have additional
17 data members or virtual methods. */
19public:
20 std::optional<SkBlendMode> asBlendMode() const { return fPrecompileBlender->asBlendMode(); }
21
22 // The remaining methods make this a viable standin for PrecompileBasePriv
23 int numChildCombinations() const { return fPrecompileBlender->numChildCombinations(); }
24
25 int numCombinations() const { return fPrecompileBlender->numCombinations(); }
26
27 void addToKey(const KeyContext& keyContext,
29 PipelineDataGatherer* gatherer,
30 int desiredCombination) const {
31 fPrecompileBlender->addToKey(keyContext, builder, gatherer, desiredCombination);
32 }
33
34private:
35 friend class PrecompileBlender; // to construct/copy this type.
36
37 explicit PrecompileBlenderPriv(PrecompileBlender* precompileBlender)
38 : fPrecompileBlender(precompileBlender) {}
39
40 PrecompileBlenderPriv& operator=(const PrecompileBlenderPriv&) = delete;
41
42 // No taking addresses of this type.
43 const PrecompileBlenderPriv* operator&() const;
45
46 PrecompileBlender* fPrecompileBlender;
47};
48
50
51// NOLINTNEXTLINE(readability-const-return-type)
53 return PrecompileBlenderPriv(const_cast<PrecompileBlender *>(this));
54}
55
56} // namespace skgpu::graphite
57
58#endif // skgpu_graphite_PrecompileBlenderPriv_DEFINED
virtual int numChildCombinations() const
virtual void addToKey(const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, int desiredCombination) const =0
std::optional< SkBlendMode > asBlendMode() const
void addToKey(const KeyContext &keyContext, PaintParamsKeyBuilder *builder, PipelineDataGatherer *gatherer, int desiredCombination) const
virtual std::optional< SkBlendMode > asBlendMode() const
constexpr Mask< EnumType > operator&(const EnumType &lhs, const EnumType &rhs)
Definition: mask.h:139