Skip to content

Commit 5f957de

Browse files
committed
iOS: Eliminate unnecessary bridged retain casts
This replaces a few ARC bridged retain casts to regular bridge casts to CoreFoundation types, which are then CFRetained via `sk_cfp::retain` calls. This eliminates the last remaining unnecessary __bridge_retained casts in the codebase. The remaining casts have been manually vetted and are reasonable. Issue: flutter/flutter#155943
1 parent 4f6a261 commit 5f957de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shell/platform/darwin/graphics/FlutterDarwinExternalTextureMetal.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,14 @@ @implementation FlutterDarwinExternalTextureSkImageWrapper
277277
return nullptr;
278278
#else // SLIMPELLER
279279
GrMtlTextureInfo ySkiaTextureInfo;
280-
ySkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)yTex};
280+
ySkiaTextureInfo.fTexture.retain((__bridge GrMTLHandle)yTex);
281281

282282
GrBackendTexture skiaBackendTextures[2];
283283
skiaBackendTextures[0] =
284284
GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped::kNo, ySkiaTextureInfo);
285285

286286
GrMtlTextureInfo uvSkiaTextureInfo;
287-
uvSkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)uvTex};
287+
uvSkiaTextureInfo.fTexture.retain((__bridge GrMTLHandle)uvTex);
288288

289289
skiaBackendTextures[1] =
290290
GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped::kNo, uvSkiaTextureInfo);
@@ -308,7 +308,7 @@ GrYUVABackendTextures yuvaBackendTextures(yuvaInfo, skiaBackendTextures,
308308
#else // SLIMPELLER
309309

310310
GrMtlTextureInfo skiaTextureInfo;
311-
skiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)rgbaTex};
311+
skiaTextureInfo.fTexture.retain((__bridge GrMTLHandle)rgbaTex);
312312

313313
GrBackendTexture skiaBackendTexture =
314314
GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped ::kNo, skiaTextureInfo);

0 commit comments

Comments
 (0)