iOS: Eliminate unnecessary bridged retain casts (flutter/engine#56662)
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: https://github.com/flutter/flutter/issues/155943 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -277,14 +277,14 @@ FLUTTER_ASSERT_ARC
|
||||
return nullptr;
|
||||
#else // SLIMPELLER
|
||||
GrMtlTextureInfo ySkiaTextureInfo;
|
||||
ySkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)yTex};
|
||||
ySkiaTextureInfo.fTexture.retain((__bridge GrMTLHandle)yTex);
|
||||
|
||||
GrBackendTexture skiaBackendTextures[2];
|
||||
skiaBackendTextures[0] =
|
||||
GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped::kNo, ySkiaTextureInfo);
|
||||
|
||||
GrMtlTextureInfo uvSkiaTextureInfo;
|
||||
uvSkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)uvTex};
|
||||
uvSkiaTextureInfo.fTexture.retain((__bridge GrMTLHandle)uvTex);
|
||||
|
||||
skiaBackendTextures[1] =
|
||||
GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped::kNo, uvSkiaTextureInfo);
|
||||
@@ -308,7 +308,7 @@ FLUTTER_ASSERT_ARC
|
||||
#else // SLIMPELLER
|
||||
|
||||
GrMtlTextureInfo skiaTextureInfo;
|
||||
skiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)rgbaTex};
|
||||
skiaTextureInfo.fTexture.retain((__bridge GrMTLHandle)rgbaTex);
|
||||
|
||||
GrBackendTexture skiaBackendTexture =
|
||||
GrBackendTextures::MakeMtl(width, height, skgpu::Mipmapped ::kNo, skiaTextureInfo);
|
||||
|
||||
Reference in New Issue
Block a user