/* * 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_graphite_MtlTexture_DEFINED #define skgpu_graphite_MtlTexture_DEFINED #include "include/core/SkRefCnt.h" #include "include/ports/SkCFObject.h" #include "src/gpu/graphite/Texture.h" #import namespace skgpu::graphite { class MtlSharedContext; class MtlTexture : public Texture { public: static sk_cfp> MakeMtlTexture(const MtlSharedContext*, SkISize dimensions, const TextureInfo&); static sk_sp Make(const MtlSharedContext*, SkISize dimensions, const TextureInfo&, skgpu::Budgeted); static sk_sp MakeWrapped(const MtlSharedContext*, SkISize dimensions, const TextureInfo&, sk_cfp>); ~MtlTexture() override {} id mtlTexture() const { return fTexture.get(); } private: MtlTexture(const MtlSharedContext* sharedContext, SkISize dimensions, const TextureInfo& info, sk_cfp>, Ownership, skgpu::Budgeted); void freeGpuData() override; void setBackendLabel(char const* label) override; sk_cfp> fTexture; }; } // namepsace skgpu::graphite #endif // skgpu_graphite_MtlTexture_DEFINED