73 std::scoped_lock lock(textures_mutex_);
75 [[MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatBGRA8Unorm
78 mipmapped:NO] retain]};
83 texture_descriptor.
get().usage = MTLTextureUsageUnknown;
85 if (!texture_descriptor) {
86 FML_CHECK(
false) <<
"Invalid texture descriptor.";
87 return {.texture_id = -1, .texture =
nullptr};
91 sk_cfp<void*>
texture = sk_cfp<void*>{[
device newTextureWithDescriptor:texture_descriptor.get()]};
94 FML_CHECK(
false) <<
"Could not create texture from texture descriptor.";
95 return {.texture_id = -1, .texture =
nullptr};
SK_API sk_sp< GrDirectContext > MakeMetal(const GrMtlBackendContext &, const GrContextOptions &)
sk_cfp< GrMTLHandle > fDevice
sk_cfp< GrMTLHandle > fQueue