Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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_PrecompileBasePriv_DEFINED
9#define skgpu_graphite_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:
20 bool isALocalMatrixShader() const {
21 return fPrecompileBase->isALocalMatrixShader();
22 }
23
24 void addToKey(const KeyContext& keyContext,
25 PaintParamsKeyBuilder* builder,
26 PipelineDataGatherer* gatherer,
27 int desiredCombination) const {
28 fPrecompileBase->addToKey(keyContext, builder, gatherer, desiredCombination);
29 }
30
31private:
32 friend class PrecompileBase; // to construct/copy this type.
33
34 explicit PrecompileBasePriv(PrecompileBase* precompileBase)
35 : fPrecompileBase(precompileBase) {
36 }
37
38 PrecompileBasePriv& operator=(const PrecompileBasePriv&) = delete;
39
40 // No taking addresses of this type.
41 const PrecompileBasePriv* operator&() const;
43
44 PrecompileBase* fPrecompileBase;
45};
46
48
49// NOLINTNEXTLINE(readability-const-return-type)
51 return PrecompileBasePriv(const_cast<PrecompileBase *>(this));
52}
53
54} // namespace skgpu::graphite
55
56#endif // skgpu_graphite_PrecompileBasePriv_DEFINED
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator&(E l, E r)
void addToKey(const KeyContext &keyContext, PaintParamsKeyBuilder *builder, PipelineDataGatherer *gatherer, int desiredCombination) const
virtual bool isALocalMatrixShader() const
Definition Precompile.h:86
virtual void addToKey(const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, int desiredCombination) const =0