Flutter Engine
The Flutter Engine
PrecompileBasePriv.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 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_PrecompileBasePriv_DEFINED
9#define skgpu_graphite_precompile_PrecompileBasePriv_DEFINED
10
12
13namespace skgpu::graphite {
14
15/** Class that exposes methods to PrecompileBase that are only intended for use internal to Skia.
16 This class is purely a privileged window into PrecompileBase. It should never have additional
17 data members or virtual methods. */
19public:
21 return fPrecompileBase->numChildCombinations();
22 }
23
24 int numCombinations() const {
25 return fPrecompileBase->numCombinations();
26 }
27
28 void addToKey(const KeyContext& keyContext,
30 PipelineDataGatherer* gatherer,
31 int desiredCombination) const {
32 fPrecompileBase->addToKey(keyContext, builder, gatherer, desiredCombination);
33 }
34
35private:
36 friend class PrecompileBase; // to construct/copy this type.
37
38 explicit PrecompileBasePriv(PrecompileBase* precompileBase)
39 : fPrecompileBase(precompileBase) {
40 }
41
42 PrecompileBasePriv& operator=(const PrecompileBasePriv&) = delete;
43
44 // No taking addresses of this type.
45 const PrecompileBasePriv* operator&() const;
47
48 PrecompileBase* fPrecompileBase;
49};
50
52
53// NOLINTNEXTLINE(readability-const-return-type)
55 return PrecompileBasePriv(const_cast<PrecompileBase *>(this));
56}
57
58} // namespace skgpu::graphite
59
60#endif // skgpu_graphite_precompile_PrecompileBasePriv_DEFINED
void addToKey(const KeyContext &keyContext, PaintParamsKeyBuilder *builder, PipelineDataGatherer *gatherer, int desiredCombination) const
virtual int numChildCombinations() const
virtual void addToKey(const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, int desiredCombination) const =0
constexpr Mask< EnumType > operator&(const EnumType &lhs, const EnumType &rhs)
Definition: mask.h:139