/src/skia/src/gpu/MutableTextureState.cpp
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 | | #include "include/gpu/MutableTextureState.h" |
8 | | |
9 | | #include "include/gpu/GpuTypes.h" |
10 | | #include "src/gpu/MutableTextureStatePriv.h" |
11 | | |
12 | | namespace skgpu { |
13 | | |
14 | | MutableTextureState::MutableTextureState(): |
15 | | fBackend(BackendApi::kUnsupported), |
16 | 0 | fIsValid(false) {} |
17 | 0 | MutableTextureState::~MutableTextureState() = default; |
18 | | |
19 | 0 | MutableTextureState::MutableTextureState(const MutableTextureState& that): fIsValid(false) { |
20 | 0 | this->set(that); |
21 | 0 | } |
22 | | |
23 | 0 | MutableTextureState& MutableTextureState::operator=(const MutableTextureState& that) { |
24 | 0 | if (this != &that) { |
25 | 0 | this->set(that); |
26 | 0 | } |
27 | 0 | return *this; |
28 | 0 | } |
29 | | |
30 | 0 | void MutableTextureState::set(const MutableTextureState& that) { |
31 | 0 | SkASSERT(!fIsValid || this->fBackend == that.fBackend); |
32 | 0 | fIsValid = that.fIsValid; |
33 | 0 | fBackend = that.fBackend; |
34 | 0 | if (!fIsValid) { |
35 | 0 | return; |
36 | 0 | } |
37 | 0 | fStateData.reset(); |
38 | 0 | switch (fBackend) { |
39 | 0 | case BackendApi::kVulkan: |
40 | 0 | that.fStateData->copyTo(fStateData); |
41 | 0 | break; |
42 | 0 | default: |
43 | 0 | SK_ABORT("Unknown BackendApi"); |
44 | 0 | } |
45 | 0 | } Unexecuted instantiation: skgpu::MutableTextureState::set(skgpu::MutableTextureState const&) Unexecuted instantiation: skgpu::MutableTextureState::set(skgpu::MutableTextureState const&) |
46 | | |
47 | 0 | MutableTextureStateData::~MutableTextureStateData() = default; |
48 | | |
49 | | } // namespace skgpu |