Flutter Engine
The Flutter Engine
GrD3DCommandSignature.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 GrD3DCommandSignature_DEFINED
9#define GrD3DCommandSignature_DEFINED
10
13
14class GrD3DGpu;
15
17public:
18 enum class ForIndexed : bool {
19 kYes = true,
20 kNo = false
21 };
22 static sk_sp<GrD3DCommandSignature> Make(GrD3DGpu* gpu, ForIndexed indexed, unsigned int slot);
23
24 bool isCompatible(ForIndexed indexed, unsigned int slot) const {
25 return (fIndexed == indexed && fSlot == slot);
26 }
27
28 ID3D12CommandSignature* commandSignature() const { return fCommandSignature.get(); }
29
30#ifdef SK_TRACE_MANAGED_RESOURCES
31 /** Output a human-readable dump of this resource's information
32 */
33 void dumpInfo() const override {
34 SkDebugf("GrD3DCommandSignature: %p, (%d refs)\n",
35 fCommandSignature.get(), this->getRefCnt());
36 }
37#endif
38
39private:
41 unsigned int slot)
42 : fCommandSignature(commandSignature)
43 , fIndexed(indexed)
44 , fSlot(slot) {}
45
46 // This will be called right before this class is destroyed and there is no reason to explicitly
47 // release the fCommandSignature cause the gr_cp will handle that in the dtor.
48 void freeGPUData() const override {}
49
50 gr_cp<ID3D12CommandSignature> fCommandSignature;
51 ForIndexed fIndexed;
52 unsigned int fSlot;
53};
54
55#endif
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
bool isCompatible(ForIndexed indexed, unsigned int slot) const
ID3D12CommandSignature * commandSignature() const
static sk_sp< GrD3DCommandSignature > Make(GrD3DGpu *gpu, ForIndexed indexed, unsigned int slot)
T * get() const
Definition: GrD3DTypes.h:108