Flutter Engine
The Flutter Engine
MtlTexture.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 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 skgpu_graphite_MtlTexture_DEFINED
9#define skgpu_graphite_MtlTexture_DEFINED
10
13
14#import <Metal/Metal.h>
15
16namespace skgpu::graphite {
17class MtlSharedContext;
18
19class MtlTexture : public Texture {
20public:
21 static sk_cfp<id<MTLTexture>> MakeMtlTexture(const MtlSharedContext*,
23 const TextureInfo&);
24
27 const TextureInfo&,
29
32 const TextureInfo&,
33 sk_cfp<id<MTLTexture>>);
34
35 ~MtlTexture() override {}
36
37 id<MTLTexture> mtlTexture() const { return fTexture.get(); }
38
39private:
42 const TextureInfo& info,
43 sk_cfp<id<MTLTexture>>,
46
47 void freeGpuData() override;
48
49 void setBackendLabel(char const* label) override;
50
51 sk_cfp<id<MTLTexture>> fTexture;
52};
53
54} // namepsace skgpu::graphite
55
56#endif // skgpu_graphite_MtlTexture_DEFINED
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
static sk_sp< Texture > Make(const MtlSharedContext *, SkISize dimensions, const TextureInfo &, skgpu::Budgeted)
Definition: MtlTexture.mm:80
static sk_cfp< id< MTLTexture > > MakeMtlTexture(const MtlSharedContext *, SkISize dimensions, const TextureInfo &)
Definition: MtlTexture.mm:20
static sk_sp< Texture > MakeWrapped(const MtlSharedContext *, SkISize dimensions, const TextureInfo &, sk_cfp< id< MTLTexture > >)
Definition: MtlTexture.mm:96
id< MTLTexture > mtlTexture() const
Definition: MtlTexture.h:37
const SharedContext * sharedContext() const
Definition: Resource.h:189
SkISize dimensions() const
Definition: Texture.h:31
Budgeted
Definition: GpuTypes.h:35
Definition: SkSize.h:16