/src/skia/src/gpu/MutableTextureStatePriv.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2023 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_MutableTextureStatePriv_DEFINED |
9 | | #define skgpu_MutableTextureStatePriv_DEFINED |
10 | | |
11 | | #include "include/core/SkTypes.h" |
12 | | #include "include/gpu/MutableTextureState.h" |
13 | | |
14 | | namespace skgpu { |
15 | | enum class BackendApi : unsigned int; |
16 | | |
17 | | class MutableTextureStateData { |
18 | | public: |
19 | | virtual ~MutableTextureStateData(); |
20 | | |
21 | | #if defined(SK_DEBUG) |
22 | | virtual BackendApi type() const = 0; |
23 | | #endif |
24 | | protected: |
25 | 0 | MutableTextureStateData() = default; |
26 | 0 | MutableTextureStateData(const MutableTextureStateData&) = default; |
27 | | |
28 | | using AnyStateData = MutableTextureState::AnyStateData; |
29 | | |
30 | | private: |
31 | | friend class MutableTextureState; |
32 | | virtual void copyTo(AnyStateData&) const = 0; |
33 | | }; |
34 | | |
35 | | class MutableTextureStatePriv final { |
36 | | public: |
37 | | template <typename StateData> |
38 | | static MutableTextureState MakeMutableTextureState(BackendApi backend, |
39 | 0 | const StateData& data) { |
40 | 0 | return MutableTextureState(backend, data); |
41 | 0 | } |
42 | | |
43 | 0 | static const MutableTextureStateData* GetStateData(const MutableTextureState& mts) { |
44 | 0 | return mts.fStateData.get(); |
45 | 0 | } |
46 | | |
47 | 0 | static const MutableTextureStateData* GetStateData(const MutableTextureState* mts) { |
48 | 0 | SkASSERT(mts); |
49 | 0 | return mts->fStateData.get(); |
50 | 0 | } Unexecuted instantiation: skgpu::MutableTextureStatePriv::GetStateData(skgpu::MutableTextureState const*) Unexecuted instantiation: skgpu::MutableTextureStatePriv::GetStateData(skgpu::MutableTextureState const*) |
51 | | |
52 | 0 | static MutableTextureStateData* GetStateData(MutableTextureState* mts) { |
53 | 0 | SkASSERT(mts); |
54 | 0 | return mts->fStateData.get(); |
55 | 0 | } Unexecuted instantiation: skgpu::MutableTextureStatePriv::GetStateData(skgpu::MutableTextureState*) Unexecuted instantiation: skgpu::MutableTextureStatePriv::GetStateData(skgpu::MutableTextureState*) |
56 | | }; |
57 | | } // namespace skgpu |
58 | | |
59 | | #endif |