Flutter Engine
The Flutter Engine
third_party
skia
include
gpu
GrBackendSemaphore.h
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Google Inc.
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 GrBackendSemaphore_DEFINED
9
#define GrBackendSemaphore_DEFINED
10
11
#include "
include/gpu/GrTypes.h
"
// IWYU pragma: keep
12
#include "
include/private/base/SkAPI.h
"
13
#include "
include/private/base/SkAnySubclass.h
"
14
15
#ifdef SK_DIRECT3D
16
#include "
include/private/gpu/ganesh/GrD3DTypesMinimal.h
"
17
#endif
18
19
#include <cstddef>
20
21
class
GrBackendSemaphoreData
;
22
23
/**
24
* Wrapper class for passing into and receiving data from Ganesh about a backend semaphore object.
25
*/
26
class
SK_API
GrBackendSemaphore
{
27
public
:
28
// The GrBackendSemaphore cannot be used until either init* is called, which will set the
29
// appropriate GrBackend.
30
GrBackendSemaphore
();
31
~GrBackendSemaphore
();
32
GrBackendSemaphore
(
const
GrBackendSemaphore
&);
33
GrBackendSemaphore
& operator=(
const
GrBackendSemaphore
&);
34
35
#ifdef SK_DIRECT3D
36
void
initDirect3D(
const
GrD3DFenceInfo
&
info
) {
37
fBackend =
GrBackendApi::kDirect3D
;
38
this->assignD3DFenceInfo(
info
);
39
fIsInitialized =
true
;
40
}
41
#endif
42
43
bool
isInitialized
()
const
{
return
fIsInitialized; }
44
GrBackendApi
backend
()
const
{
return
fBackend; }
45
46
#ifdef SK_DIRECT3D
47
bool
getD3DFenceInfo(
GrD3DFenceInfo
* outInfo)
const
;
48
#endif
49
50
private
:
51
friend
class
GrBackendSemaphorePriv
;
52
friend
class
GrBackendSemaphoreData
;
53
// Size determined by looking at the GrBackendSemaphoreData subclasses, then
54
// guessing-and-checking. Compiler will complain if this is too small - in that case,
55
// just increase the number.
56
inline
constexpr
static
size_t
kMaxSubclassSize = 24;
57
using
AnySemaphoreData
=
SkAnySubclass<GrBackendSemaphoreData, kMaxSubclassSize>
;
58
59
template
<
typename
SemaphoreData>
60
GrBackendSemaphore
(
GrBackendApi
api, SemaphoreData
data
) : fBackend(api), fIsInitialized(
true
) {
61
fSemaphoreData.emplace<SemaphoreData>(
data
);
62
}
63
64
#ifdef SK_DIRECT3D
65
void
assignD3DFenceInfo(
const
GrD3DFenceInfo
&
info
);
66
#endif
67
68
GrBackendApi
fBackend;
69
AnySemaphoreData
fSemaphoreData;
70
71
union
{
72
void
*
fPlaceholder
;
// TODO(293490566)
73
#ifdef SK_DIRECT3D
74
GrD3DFenceInfo
* fD3DFenceInfo;
75
#endif
76
};
77
bool
fIsInitialized;
78
};
79
80
#endif
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
DM.cpp:213
GrD3DTypesMinimal.h
GrTypes.h
GrBackendApi
GrBackendApi
Definition:
GrTypes.h:95
GrBackendApi::kDirect3D
@ kDirect3D
SkAPI.h
SK_API
#define SK_API
Definition:
SkAPI.h:35
SkAnySubclass.h
GrBackendSemaphoreData
Definition:
GrBackendSemaphorePriv.h:16
GrBackendSemaphoreData::GrBackendSemaphore
friend class GrBackendSemaphore
Definition:
GrBackendSemaphorePriv.h:30
GrBackendSemaphoreData::AnySemaphoreData
GrBackendSemaphore::AnySemaphoreData AnySemaphoreData
Definition:
GrBackendSemaphorePriv.h:27
GrBackendSemaphorePriv
Definition:
GrBackendSemaphorePriv.h:34
GrBackendSemaphore
Definition:
GrBackendSemaphore.h:26
GrBackendSemaphore::fPlaceholder
void * fPlaceholder
Definition:
GrBackendSemaphore.h:72
GrBackendSemaphore::backend
GrBackendApi backend() const
Definition:
GrBackendSemaphore.h:44
GrBackendSemaphore::isInitialized
bool isInitialized() const
Definition:
GrBackendSemaphore.h:43
SkAnySubclass< GrBackendSemaphoreData, kMaxSubclassSize >
GrD3DFenceInfo
Definition:
GrD3DTypes.h:229
data
std::shared_ptr< const fml::Mapping > data
Definition:
texture_gles.cc:63
true
true
Definition:
verylargebitmap.cpp:163
Generated on Sun Jun 23 2024 21:56:02 for Flutter Engine by
1.9.4