Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
vk
GrVkBackendSemaphore.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/ganesh/vk/GrVkBackendSemaphore.h
"
8
9
#include "
include/gpu/GrTypes.h
"
10
#include "
include/private/base/SkAssert.h
"
11
#include "
src/gpu/ganesh/GrBackendSemaphorePriv.h
"
12
13
class
GrVkBackendSemaphoreData
final :
public
GrBackendSemaphoreData
{
14
public
:
15
GrVkBackendSemaphoreData
(VkSemaphore
semaphore
) : fSemaphore(
semaphore
) {}
16
17
VkSemaphore
semaphore
()
const
{
return
fSemaphore; }
18
19
private
:
20
void
copyTo(
AnySemaphoreData
&
data
)
const override
{
21
data
.emplace<
GrVkBackendSemaphoreData
>(fSemaphore);
22
}
23
24
#if defined(SK_DEBUG)
25
GrBackendApi
type
()
const override
{
return
GrBackendApi::kVulkan
; }
26
#endif
27
28
VkSemaphore fSemaphore;
29
};
30
31
static
const
GrVkBackendSemaphoreData
*
get_and_cast_data
(
const
GrBackendSemaphore
& sem) {
32
auto
data
=
GrBackendSemaphorePriv::GetBackendData
(sem);
33
SkASSERT
(!
data
||
data
->type() ==
GrBackendApi::kVulkan
);
34
return
static_cast<
const
GrVkBackendSemaphoreData
*
>
(
data
);
35
}
36
37
namespace
GrBackendSemaphores
{
38
GrBackendSemaphore
MakeVk
(VkSemaphore semaphore) {
39
GrVkBackendSemaphoreData
data
(semaphore);
40
return
GrBackendSemaphorePriv::MakeGrBackendSemaphore
(
GrBackendApi::kVulkan
,
data
);
41
}
42
43
VkSemaphore
GetVkSemaphore
(
const
GrBackendSemaphore
& sem) {
44
SkASSERT
(sem.
backend
() ==
GrBackendApi::kVulkan
);
45
const
GrVkBackendSemaphoreData
*
data
=
get_and_cast_data
(sem);
46
SkASSERT
(
data
);
47
return
data
->semaphore();
48
}
49
}
// namespace GrBackendSemaphores
GrBackendSemaphorePriv.h
GrTypes.h
GrBackendApi
GrBackendApi
Definition:
GrTypes.h:95
GrBackendApi::kVulkan
@ kVulkan
get_and_cast_data
static const GrVkBackendSemaphoreData * get_and_cast_data(const GrBackendSemaphore &sem)
Definition:
GrVkBackendSemaphore.cpp:31
GrVkBackendSemaphore.h
SkAssert.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
type
GLenum type
Definition:
blit_command_gles.cc:126
GrBackendSemaphoreData
Definition:
GrBackendSemaphorePriv.h:16
GrBackendSemaphoreData::AnySemaphoreData
GrBackendSemaphore::AnySemaphoreData AnySemaphoreData
Definition:
GrBackendSemaphorePriv.h:27
GrBackendSemaphorePriv::GetBackendData
static const GrBackendSemaphoreData * GetBackendData(const GrBackendSemaphore &sem)
Definition:
GrBackendSemaphorePriv.h:42
GrBackendSemaphorePriv::MakeGrBackendSemaphore
static GrBackendSemaphore MakeGrBackendSemaphore(GrBackendApi backend, const SemaphoreData &data)
Definition:
GrBackendSemaphorePriv.h:37
GrBackendSemaphore
Definition:
GrBackendSemaphore.h:26
GrBackendSemaphore::backend
GrBackendApi backend() const
Definition:
GrBackendSemaphore.h:44
GrVkBackendSemaphoreData
Definition:
GrVkBackendSemaphore.cpp:13
GrVkBackendSemaphoreData::GrVkBackendSemaphoreData
GrVkBackendSemaphoreData(VkSemaphore semaphore)
Definition:
GrVkBackendSemaphore.cpp:15
GrVkBackendSemaphoreData::semaphore
VkSemaphore semaphore() const
Definition:
GrVkBackendSemaphore.cpp:17
GrBackendSemaphores
Definition:
GrMtlBackendSemaphore.h:15
GrBackendSemaphores::MakeVk
SK_API GrBackendSemaphore MakeVk(VkSemaphore semaphore)
Definition:
GrVkBackendSemaphore.cpp:38
GrBackendSemaphores::GetVkSemaphore
SK_API VkSemaphore GetVkSemaphore(const GrBackendSemaphore &)
Definition:
GrVkBackendSemaphore.cpp:43
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
Generated on Sun Jun 23 2024 21:56:24 for Flutter Engine by
1.9.4