Flutter Engine
The Flutter Engine
GrMtlPipeline.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 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 GrMtlPipeline_DEFINED
9#define GrMtlPipeline_DEFINED
10
12
13#import <Metal/Metal.h>
14
15/**
16 * Wraps a MTLRenderPipelineState object
17 */
19public:
20 static sk_sp<GrMtlRenderPipeline> Make(id<MTLRenderPipelineState> pso) {
22 }
23#ifdef SK_TRACE_MANAGED_RESOURCES
24 /** output a human-readable dump of this resource's information
25 */
26 void dumpInfo() const override {
27 SkDebugf("GrMtlRenderPipeline: %p (%ld refs)\n", fPipelineState,
28 CFGetRetainCount((CFTypeRef)fPipelineState));
29 }
30#endif
31
32 void freeGPUData() const override {
33 fPipelineState = nil;
34 }
35
36 id<MTLRenderPipelineState> mtlPipelineState() const { return fPipelineState; }
37
38private:
39 GrMtlRenderPipeline(id<MTLRenderPipelineState> pso)
41 , fPipelineState(pso) {
42 }
43
44 mutable id<MTLRenderPipelineState> fPipelineState;
45};
46
47#endif
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static sk_sp< GrMtlRenderPipeline > Make(id< MTLRenderPipelineState > pso)
Definition: GrMtlPipeline.h:20
id< MTLRenderPipelineState > mtlPipelineState() const
Definition: GrMtlPipeline.h:36
void freeGPUData() const override
Definition: GrMtlPipeline.h:32