Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
MutableTextureState.cpp
Go to the documentation of this file.
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
fIsValid(
false
) {}
17
MutableTextureState::~MutableTextureState
() =
default
;
18
19
MutableTextureState::MutableTextureState
(
const
MutableTextureState
& that): fIsValid(
false
) {
20
this->
set
(that);
21
}
22
23
MutableTextureState
&
MutableTextureState::operator=
(
const
MutableTextureState
& that) {
24
if
(
this
!= &that) {
25
this->
set
(that);
26
}
27
return
*
this
;
28
}
29
30
void
MutableTextureState::set
(
const
MutableTextureState
& that) {
31
SkASSERT
(!fIsValid || this->fBackend == that.fBackend);
32
fIsValid = that.fIsValid;
33
fBackend = that.fBackend;
34
if
(!fIsValid) {
35
return
;
36
}
37
fStateData.
reset
();
38
switch
(fBackend) {
39
case
BackendApi::kVulkan
:
40
that.fStateData->copyTo(fStateData);
41
break
;
42
default
:
43
SK_ABORT
(
"Unknown BackendApi"
);
44
}
45
}
46
47
MutableTextureStateData::~MutableTextureStateData
() =
default
;
48
49
}
// namespace skgpu
GpuTypes.h
MutableTextureStatePriv.h
MutableTextureState.h
SK_ABORT
#define SK_ABORT(message,...)
Definition:
SkAssert.h:70
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkAnySubclass::reset
void reset()
Definition:
SkAnySubclass.h:48
skgpu::MutableTextureStateData::~MutableTextureStateData
virtual ~MutableTextureStateData()
skgpu::MutableTextureState
Definition:
MutableTextureState.h:30
skgpu::MutableTextureState::operator=
MutableTextureState & operator=(const MutableTextureState &that)
Definition:
MutableTextureState.cpp:23
skgpu::MutableTextureState::~MutableTextureState
~MutableTextureState() override
skgpu::MutableTextureState::MutableTextureState
MutableTextureState()
Definition:
MutableTextureState.cpp:14
skgpu::MutableTextureState::set
void set(const MutableTextureState &that)
Definition:
MutableTextureState.cpp:30
dart::false
false
Definition:
isolate_reload.cc:58
skgpu
Definition:
GpuTools.h:21
skgpu::BackendApi
BackendApi
Definition:
GpuTypes.h:22
skgpu::BackendApi::kUnsupported
@ kUnsupported
skgpu::BackendApi::kVulkan
@ kVulkan
Generated on Sun Jun 23 2024 21:56:28 for Flutter Engine by
1.9.4