15#if !__has_feature(objc_arc)
16#error This file must be compiled with Arc. Use -fobjc-arc flag
26 std::string_view label)
30 SkDEBUGCODE(id<MTLTexture> mtlTexture = fTexture->mtlTexture();)
32 if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
35 SkASSERT(!mtlTexture.framebufferOnly);
36 this->registerWithCache(budgeted);
49 std::string_view label)
53 SkDEBUGCODE(id<MTLTexture> mtlTexture = fTexture->mtlTexture();)
55 if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
58 SkASSERT(!mtlTexture.framebufferOnly);
62 this->registerWithCacheWrapped(cacheable);
69 std::string_view label)
75 if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
87 std::string_view label) {
104 if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
110 "MtlAttachment_MakeWrapped");
119 cacheable, ioType,
"MtlTextureWrappedTexture"));
135 GrMtlTextureInfo
info;
147 NSString* labelStr = @(this->
getLabel().c_str());
148 fTexture->
mtlTexture().label = [
@"_Skia_" stringByAppendingString:labelStr];
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SK_ALWAYS_INLINE CF_RETURNS_RETAINED const void * GrRetainPtrFromId(id idObject)
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
#define INHERITED(method,...)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
static constexpr bool SkToBool(const T &x)
std::string getLabel() const
bool wasDestroyed() const
static sk_sp< GrMtlAttachment > MakeTexture(GrMtlGpu *gpu, SkISize dimensions, MTLPixelFormat format, uint32_t mipLevels, GrRenderable renderable, int numSamples, skgpu::Budgeted budgeted)
MTLPixelFormat mtlFormat() const
static sk_sp< GrMtlAttachment > MakeWrapped(GrMtlGpu *gpu, SkISize dimensions, id< MTLTexture >, UsageFlags attachmentUsages, GrWrapCacheable, std::string_view label)
id< MTLTexture > mtlTexture() const
GrMtlGpu * getMtlGpu() const
static sk_sp< GrMtlTexture > MakeNewTexture(GrMtlGpu *, skgpu::Budgeted budgeted, SkISize dimensions, MTLPixelFormat format, uint32_t mipLevels, GrMipmapStatus, std::string_view label)
GrBackendTexture getBackendTexture() const override
void onSetLabel() override
id< MTLTexture > mtlTexture() const
GrMtlAttachment * attachment() const
GrBackendFormat backendFormat() const override
static sk_sp< GrMtlTexture > MakeWrappedTexture(GrMtlGpu *, SkISize, id< MTLTexture >, GrWrapCacheable, GrIOType)
GrMtlTexture(GrMtlGpu *, SkISize, sk_sp< GrMtlAttachment >, GrMipmapStatus, std::string_view label)
SkISize dimensions() const
skgpu::Mipmapped mipmapped() const
GrMipmapStatus mipmapStatus() const
EMSCRIPTEN_KEEPALIVE void empty()
uint32_t uint32_t * format
SK_API GrBackendTexture MakeMtl(int width, int height, skgpu::Mipmapped, const GrMtlTextureInfo &mtlInfo, std::string_view label={})
bool MtlFormatIsCompressed(MTLPixelFormat mtlFormat)