Flutter Engine
The Flutter Engine
third_party
skia
include
private
gpu
ganesh
GrD3DTypesMinimal.h
Go to the documentation of this file.
1
/*
2
* Copyright 2020 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 GrD3DTypesMinimal_DEFINED
9
#define GrD3DTypesMinimal_DEFINED
10
11
// Minimal definitions of Direct3D types, without including d3d12.h
12
13
#include "
include/core/SkRefCnt.h
"
14
15
#include <dxgiformat.h>
16
17
#include "
include/gpu/GrTypes.h
"
18
19
struct
ID3D12Resource;
20
class
GrD3DResourceState
;
21
typedef
int
GrD3DResourceStateEnum
;
22
struct
GrD3DSurfaceInfo
;
23
struct
GrD3DTextureResourceInfo
;
24
struct
GrD3DTextureResourceSpec
;
25
struct
GrD3DFenceInfo
;
26
27
// This struct is to used to store the the actual information about the Direct3D backend image on
28
// GrBackendTexture and GrBackendRenderTarget. When a client calls getD3DTextureInfo on a
29
// GrBackendTexture/RenderTarget, we use the GrD3DBackendSurfaceInfo to create a snapshot
30
// GrD3DTextureResourceInfo object. Internally, this uses a ref count GrD3DResourceState object to
31
// track the current D3D12_RESOURCE_STATES which can be shared with an internal GrD3DTextureResource
32
// so that state updates can be seen by all users of the texture.
33
struct
GrD3DBackendSurfaceInfo
{
34
GrD3DBackendSurfaceInfo
(
const
GrD3DTextureResourceInfo
&
info
,
GrD3DResourceState
*
state
);
35
36
void
cleanup
();
37
38
GrD3DBackendSurfaceInfo
&
operator=
(
const
GrD3DBackendSurfaceInfo
&) =
delete
;
39
40
// Assigns the passed in GrD3DBackendSurfaceInfo to this object. if isValid is true we will also
41
// attempt to unref the old fLayout on this object.
42
void
assign
(
const
GrD3DBackendSurfaceInfo
&,
bool
isValid);
43
44
void
setResourceState
(
GrD3DResourceStateEnum
state
);
45
46
sk_sp<GrD3DResourceState>
getGrD3DResourceState
()
const
;
47
48
GrD3DTextureResourceInfo
snapTextureResourceInfo
()
const
;
49
50
bool
isProtected
()
const
;
51
#if defined(GR_TEST_UTILS)
52
bool
operator==
(
const
GrD3DBackendSurfaceInfo
& that)
const
;
53
#endif
54
55
private
:
56
GrD3DTextureResourceInfo
* fTextureResourceInfo;
57
GrD3DResourceState
* fResourceState;
58
};
59
60
struct
GrD3DTextureResourceSpecHolder
{
61
public
:
62
GrD3DTextureResourceSpecHolder
(
const
GrD3DSurfaceInfo
&);
63
64
void
cleanup
();
65
66
GrD3DSurfaceInfo
getSurfaceInfo
(uint32_t sampleCount,
67
uint32_t levelCount,
68
skgpu::Protected
isProtected)
const
;
69
70
private
:
71
GrD3DTextureResourceSpec
* fSpec;
72
};
73
74
#endif
info
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition:
DM.cpp:213
GrD3DResourceStateEnum
int GrD3DResourceStateEnum
Definition:
GrD3DTypesMinimal.h:21
GrTypes.h
SkRefCnt.h
GrD3DResourceState
Definition:
GrD3DResourceState.h:14
sk_sp< GrD3DResourceState >
state
AtkStateType state
Definition:
fl_accessible_node.cc:10
fml::operator==
bool operator==(C p1, const scoped_nsprotocol< C > &p2)
Definition:
scoped_nsobject.h:142
skgpu::Protected
Protected
Definition:
GpuTypes.h:61
GrD3DBackendSurfaceInfo
Definition:
GrD3DTypesMinimal.h:33
GrD3DBackendSurfaceInfo::GrD3DBackendSurfaceInfo
GrD3DBackendSurfaceInfo(const GrD3DTextureResourceInfo &info, GrD3DResourceState *state)
Definition:
GrD3DTypesMinimal.cpp:14
GrD3DBackendSurfaceInfo::assign
void assign(const GrD3DBackendSurfaceInfo &, bool isValid)
Definition:
GrD3DTypesMinimal.cpp:26
GrD3DBackendSurfaceInfo::setResourceState
void setResourceState(GrD3DResourceStateEnum state)
Definition:
GrD3DTypesMinimal.cpp:37
GrD3DBackendSurfaceInfo::snapTextureResourceInfo
GrD3DTextureResourceInfo snapTextureResourceInfo() const
Definition:
GrD3DTypesMinimal.cpp:47
GrD3DBackendSurfaceInfo::operator=
GrD3DBackendSurfaceInfo & operator=(const GrD3DBackendSurfaceInfo &)=delete
GrD3DBackendSurfaceInfo::getGrD3DResourceState
sk_sp< GrD3DResourceState > getGrD3DResourceState() const
Definition:
GrD3DTypesMinimal.cpp:42
GrD3DBackendSurfaceInfo::cleanup
void cleanup()
Definition:
GrD3DTypesMinimal.cpp:19
GrD3DBackendSurfaceInfo::isProtected
bool isProtected() const
Definition:
GrD3DTypesMinimal.cpp:53
GrD3DFenceInfo
Definition:
GrD3DTypes.h:229
GrD3DSurfaceInfo
Definition:
GrD3DTypes.h:239
GrD3DTextureResourceInfo
Definition:
GrD3DTypes.h:179
GrD3DTextureResourceSpecHolder
Definition:
GrD3DTypesMinimal.h:60
GrD3DTextureResourceSpecHolder::getSurfaceInfo
GrD3DSurfaceInfo getSurfaceInfo(uint32_t sampleCount, uint32_t levelCount, skgpu::Protected isProtected) const
Definition:
GrD3DTypesMinimal.cpp:73
GrD3DTextureResourceSpecHolder::GrD3DTextureResourceSpecHolder
GrD3DTextureResourceSpecHolder(const GrD3DSurfaceInfo &)
Definition:
GrD3DTypesMinimal.cpp:70
GrD3DTextureResourceSpecHolder::cleanup
void cleanup()
Definition:
GrD3DTypesMinimal.cpp:80
GrD3DTextureResourceSpec
Definition:
GrD3DTypesPriv.h:13
Generated on Sun Jun 23 2024 21:56:03 for Flutter Engine by
1.9.4