• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_MtlTexture_DEFINED
9 #define skgpu_MtlTexture_DEFINED
10 
11 #include "experimental/graphite/src/Texture.h"
12 
13 #import <Metal/Metal.h>
14 
15 namespace skgpu::mtl {
16 
17 class Gpu;
18 
19 class Texture : public skgpu::Texture {
20 public:
21     static sk_sp<Texture> Make(const Gpu* gpu,
22                                SkISize dimensions,
23                                const skgpu::TextureInfo&);
24 
~Texture()25     ~Texture() override {}
26 
mtlTexture()27     id<MTLTexture> mtlTexture() const { return fTexture.get(); }
28 
29 private:
30     Texture(SkISize dimensions,
31             const skgpu::TextureInfo& info,
32             sk_cfp<id<MTLTexture>> texture);
33 
34     sk_cfp<id<MTLTexture>> fTexture;
35 };
36 
37 } // namepsace skgpu::mtl
38 
39 #endif // skgpu_MtlTexture_DEFINED
40