Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
PaintOptionsPriv.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_PaintOptionsPriv_DEFINED
9#define skgpu_graphite_PaintOptionsPriv_DEFINED
10
12
13namespace skgpu::graphite {
14
15class ShaderCodeDictionary;
16
17/** Class that exposes methods in PaintOptions that are only intended for use internal to Skia.
18 This class is purely a privileged window into PaintOptions. It should never have additional
19 data members or virtual methods. */
21public:
22 int numCombinations() const {
23 return fPaintOptions->numCombinations();
24 }
25
27 const KeyContext& keyContext,
28 PipelineDataGatherer* gatherer,
29 DrawTypeFlags drawTypes,
30 bool withPrimitiveBlender,
31 Coverage coverage,
32 const PaintOptions::ProcessCombination& processCombination) const {
33 fPaintOptions->buildCombinations(
34 keyContext, gatherer, drawTypes, withPrimitiveBlender, coverage, processCombination);
35 }
36
37private:
38 friend class PaintOptions; // to construct/copy this type.
39
40 explicit PaintOptionsPriv(PaintOptions* paintOptions) : fPaintOptions(paintOptions) {}
41
42 PaintOptionsPriv& operator=(const PaintOptionsPriv&) = delete;
43
44 // No taking addresses of this type.
45 const PaintOptionsPriv* operator&() const;
47
48 PaintOptions* fPaintOptions;
49};
50
52
53// NOLINTNEXTLINE(readability-const-return-type)
55 return PaintOptionsPriv(const_cast<PaintOptions *>(this));
56}
57
58} // namespace skgpu::graphite
59
60#endif // skgpu_graphite_PaintOptionsPriv_DEFINED
std::enable_if_t< sknonstd::is_bitmask_enum< E >::value, E > constexpr operator&(E l, E r)
void buildCombinations(const KeyContext &keyContext, PipelineDataGatherer *gatherer, DrawTypeFlags drawTypes, bool withPrimitiveBlender, Coverage coverage, const PaintOptions::ProcessCombination &processCombination) const
std::function< void(UniquePaintParamsID id, DrawTypeFlags, bool withPrimitiveBlender, Coverage)> ProcessCombination
Definition Precompile.h:208