Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 25b8d10

Browse files
author
George Wright
authored
Remove extraneous release of the MTLTexture in EmbedderTestBackingstoreProducer (#30955)
1 parent 24e1097 commit 25b8d10

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

shell/platform/embedder/tests/embedder_test_backingstore_producer.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,15 @@ bool EmbedderTestBackingStoreProducer::CreateMTLTexture(
197197
// own MTLTexture and wrapping it.
198198
auto surface_size = SkISize::Make(config->size.width, config->size.height);
199199
auto texture_info = test_metal_context_->CreateMetalTexture(surface_size);
200-
sk_cfp<FlutterMetalTextureHandle> texture;
201-
texture.retain(texture_info.texture);
202200

203201
GrMtlTextureInfo skia_texture_info;
204-
skia_texture_info.fTexture = texture;
202+
skia_texture_info.fTexture.reset(SkCFSafeRetain(texture_info.texture));
205203
GrBackendTexture backend_texture(surface_size.width(), surface_size.height(),
206204
GrMipmapped::kNo, skia_texture_info);
207205

208-
SkSurface::TextureReleaseProc release_mtltexture = [](void* user_data) {
209-
SkCFSafeRelease(user_data);
210-
};
211-
212206
sk_sp<SkSurface> surface = SkSurface::MakeFromBackendTexture(
213207
context_.get(), backend_texture, kTopLeft_GrSurfaceOrigin, 1,
214-
kBGRA_8888_SkColorType, nullptr, nullptr, release_mtltexture,
215-
texture_info.texture);
208+
kBGRA_8888_SkColorType, nullptr, nullptr);
216209

217210
if (!surface) {
218211
FML_LOG(ERROR) << "Could not create Skia surface from a Metal texture.";

0 commit comments

Comments
 (0)