15#if !__has_feature(objc_arc)
16#error This file must be compiled with Arc. Use -fobjc-arc flag
21GrMtlTextureRenderTarget::GrMtlTextureRenderTarget(
GrMtlGpu* gpu,
28 std::string_view label)
32 std::move(resolveAttachment), label) {
33 this->registerWithCache(budgeted);
36GrMtlTextureRenderTarget::GrMtlTextureRenderTarget(
GrMtlGpu* gpu,
43 std::string_view label)
47 std::move(resolveAttachment), label) {
48 this->registerWithCacheWrapped(cacheable);
57 rp->makeMSAAAttachment(dimensions,
62 if (!msaaAttachment) {
67 *resolveAttachment = std::move(
texture);
69 *colorAttachment = std::move(
texture);
82 std::string_view label) {
86 if (!textureAttachment) {
89 if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
90 SkASSERT((MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget) &
115 if (@available(macOS 10.11, iOS 9.0, tvOS 9.0, *)) {
116 SkASSERT((MTLTextureUsageShaderRead | MTLTextureUsageRenderTarget) &
texture.usage);
125 "MtlAttachment_TextureAttachment");
126 if (!textureAttachment) {
142 "MtlWrappedTextureRenderTarget"));
145size_t GrMtlTextureRenderTarget::onGpuMemorySize()
const {
171void GrMtlTextureRenderTarget::onSetLabel() {
bool create_rt_attachments(GrMtlGpu *gpu, SkISize dimensions, MTLPixelFormat format, int sampleCnt, sk_sp< GrMtlAttachment > texture, sk_sp< GrMtlAttachment > *colorAttachment, sk_sp< GrMtlAttachment > *resolveAttachment)
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
GrResourceProvider * resourceProvider()
GrDirectContextPriv priv()
size_t gpuMemorySize() const
GrDirectContext * getContext()
static sk_sp< GrMtlAttachment > MakeTexture(GrMtlGpu *gpu, SkISize dimensions, MTLPixelFormat format, uint32_t mipLevels, GrRenderable renderable, int numSamples, skgpu::Budgeted budgeted)
static sk_sp< GrMtlAttachment > MakeWrapped(GrMtlGpu *gpu, SkISize dimensions, id< MTLTexture >, UsageFlags attachmentUsages, GrWrapCacheable, std::string_view label)
id< MTLTexture > mtlTexture() const
GrMtlAttachment * colorAttachment() const
GrMtlAttachment * nonMSAAAttachment() const
void onSetLabel() override
GrMtlAttachment * resolveAttachment() const
static sk_sp< GrMtlTextureRenderTarget > MakeNewTextureRenderTarget(GrMtlGpu *, skgpu::Budgeted, SkISize, int sampleCnt, MTLPixelFormat, uint32_t mipLevels, GrMipmapStatus, std::string_view label)
GrBackendFormat backendFormat() const override
static sk_sp< GrMtlTextureRenderTarget > MakeWrappedTextureRenderTarget(GrMtlGpu *, SkISize, int sampleCnt, id< MTLTexture >, GrWrapCacheable)
void onSetLabel() override
SkISize dimensions() const
static size_t ComputeSize(const GrBackendFormat &, SkISize dimensions, int colorSamplesPerPixel, skgpu::Mipmapped, bool binSize=false)
skgpu::Mipmapped mipmapped() const
GrMipmapStatus mipmapStatus() const
uint32_t uint32_t * format