/* * Copyright 2021 Google LLC * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef skgpu_MtlTexture_DEFINED #define skgpu_MtlTexture_DEFINED #include "experimental/graphite/src/Texture.h" #include "include/core/SkRefCnt.h" #import namespace skgpu::mtl { class Gpu; class Texture : public skgpu::Texture { public: static sk_cfp> MakeMtlTexture(const Gpu*, SkISize dimensions, const skgpu::TextureInfo&); static sk_sp Make(const Gpu*, SkISize dimensions, const skgpu::TextureInfo&); static sk_sp MakeWrapped(const Gpu*, SkISize dimensions, const skgpu::TextureInfo&, sk_cfp>); ~Texture() override {} id mtlTexture() const { return fTexture.get(); } private: Texture(const Gpu* gpu, SkISize dimensions, const skgpu::TextureInfo& info, sk_cfp>, Ownership); void onFreeGpuData() override; sk_cfp> fTexture; }; } // namepsace skgpu::mtl #endif // skgpu_MtlTexture_DEFINED