Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrD3DPipeline.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 GrD3DPipeline_DEFINED
9#define GrD3DPipeline_DEFINED
10
13
15public:
17 if (!pipelineState) {
18 return nullptr;
19 }
20 return sk_sp<GrD3DPipeline>(new GrD3DPipeline(std::move(pipelineState)));
21 }
22#ifdef SK_TRACE_MANAGED_RESOURCES
23 /** Output a human-readable dump of this resource's information
24 */
25 void dumpInfo() const override {
26 SkDebugf("GrD3DPipeline: %p (%d refs)\n", fPipelineState.get(), this->getRefCnt());
27 }
28#endif
29
30 // This will be called right before this class is destroyed and there is no reason to explicitly
31 // release the fPipelineState cause the gr_cp will handle that in the dtor.
32 void freeGPUData() const override {}
33
34 ID3D12PipelineState* d3dPipelineState() const { return fPipelineState.get(); }
35
36private:
38 : fPipelineState(std::move(pipelineState)) {
39 }
40
41 gr_cp<ID3D12PipelineState> fPipelineState;
42
43 using INHERITED = GrManagedResource;
44};
45
46#endif
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
ID3D12PipelineState * d3dPipelineState() const
static sk_sp< GrD3DPipeline > Make(gr_cp< ID3D12PipelineState > pipelineState)
void freeGPUData() const override
T * get() const
Definition GrD3DTypes.h:108
Definition ref_ptr.h:256