Flutter Engine
The Flutter Engine
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 using ProcessCombination = PaintOptions::ProcessCombination;
23
25
27 fPaintOptions->setClipShaders(std::move(clipShaders));
28 }
29
30 int numCombinations() const {
31 return fPaintOptions->numCombinations();
32 }
33
35 const KeyContext& keyContext,
36 PipelineDataGatherer* gatherer,
37 DrawTypeFlags drawTypes,
38 bool withPrimitiveBlender,
40 const ProcessCombination& processCombination) const {
41 fPaintOptions->buildCombinations(
42 keyContext, gatherer, drawTypes, withPrimitiveBlender, coverage, processCombination);
43 }
44
45private:
46 friend class PaintOptions; // to construct/copy this type.
47
48 explicit PaintOptionsPriv(PaintOptions* paintOptions) : fPaintOptions(paintOptions) {}
49
50 PaintOptionsPriv& operator=(const PaintOptionsPriv&) = delete;
51
52 // No taking addresses of this type.
53 const PaintOptionsPriv* operator&() const;
55
56 PaintOptions* fPaintOptions;
57};
58
60
61// NOLINTNEXTLINE(readability-const-return-type)
63 return PaintOptionsPriv(const_cast<PaintOptions *>(this));
64}
65
66} // namespace skgpu::graphite
67
68#endif // skgpu_graphite_PaintOptionsPriv_DEFINED
void setClipShaders(SkSpan< const sk_sp< PrecompileShader > > clipShaders)
void addColorFilter(sk_sp< PrecompileColorFilter > cf)
PaintOptions::ProcessCombination ProcessCombination
void buildCombinations(const KeyContext &keyContext, PipelineDataGatherer *gatherer, DrawTypeFlags drawTypes, bool withPrimitiveBlender, Coverage coverage, const ProcessCombination &processCombination) const
constexpr Mask< EnumType > operator&(const EnumType &lhs, const EnumType &rhs)
Definition: mask.h:139