Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
14
15#include <dxgiformat.h>
16
17#include "include/gpu/GrTypes.h"
18
19struct ID3D12Resource;
22struct GrD3DSurfaceInfo;
25struct 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.
35
36 void cleanup();
37
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
45
47
49
50 bool isProtected() const;
51#if defined(GR_TEST_UTILS)
52 bool operator==(const GrD3DBackendSurfaceInfo& that) const;
53#endif
54
55private:
56 GrD3DTextureResourceInfo* fTextureResourceInfo;
57 GrD3DResourceState* fResourceState;
58};
59
61public:
63
64 void cleanup();
65
66 GrD3DSurfaceInfo getSurfaceInfo(uint32_t sampleCount,
67 uint32_t levelCount,
68 skgpu::Protected isProtected) const;
69
70private:
72};
73
74#endif
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
int GrD3DResourceStateEnum
bool operator==(const FlutterPoint &a, const FlutterPoint &b)
AtkStateType state
Protected
Definition GpuTypes.h:61
void assign(const GrD3DBackendSurfaceInfo &, bool isValid)
void setResourceState(GrD3DResourceStateEnum state)
GrD3DTextureResourceInfo snapTextureResourceInfo() const
GrD3DBackendSurfaceInfo & operator=(const GrD3DBackendSurfaceInfo &)=delete
sk_sp< GrD3DResourceState > getGrD3DResourceState() const
GrD3DSurfaceInfo getSurfaceInfo(uint32_t sampleCount, uint32_t levelCount, skgpu::Protected isProtected) const