mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Migrate sk_cf_obj to sk_cfp (flutter/engine#30029)
This commit is contained in:
parent
30c4de0797
commit
299cf0138d
@ -230,7 +230,7 @@ FLUTTER_ASSERT_ARC
|
||||
width:(size_t)width
|
||||
height:(size_t)height {
|
||||
GrMtlTextureInfo ySkiaTextureInfo;
|
||||
ySkiaTextureInfo.fTexture = sk_cf_obj<const void*>{(__bridge_retained const void*)yTex};
|
||||
ySkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)yTex};
|
||||
|
||||
GrBackendTexture skiaBackendTextures[2];
|
||||
skiaBackendTextures[0] = GrBackendTexture(/*width=*/width,
|
||||
@ -239,7 +239,7 @@ FLUTTER_ASSERT_ARC
|
||||
/*textureInfo=*/ySkiaTextureInfo);
|
||||
|
||||
GrMtlTextureInfo uvSkiaTextureInfo;
|
||||
uvSkiaTextureInfo.fTexture = sk_cf_obj<const void*>{(__bridge_retained const void*)uvTex};
|
||||
uvSkiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)uvTex};
|
||||
|
||||
skiaBackendTextures[1] = GrBackendTexture(/*width=*/width,
|
||||
/*height=*/height,
|
||||
@ -259,7 +259,7 @@ FLUTTER_ASSERT_ARC
|
||||
width:(size_t)width
|
||||
height:(size_t)height {
|
||||
GrMtlTextureInfo skiaTextureInfo;
|
||||
skiaTextureInfo.fTexture = sk_cf_obj<const void*>{(__bridge_retained const void*)rgbaTex};
|
||||
skiaTextureInfo.fTexture = sk_cfp<const void*>{(__bridge_retained const void*)rgbaTex};
|
||||
|
||||
GrBackendTexture skiaBackendTexture(/*width=*/width,
|
||||
/*height=*/height,
|
||||
|
||||
@ -589,7 +589,7 @@ static sk_sp<SkSurface> MakeSkSurfaceFromBackingStore(
|
||||
FML_LOG(ERROR) << "Embedder supplied null Metal texture.";
|
||||
return nullptr;
|
||||
}
|
||||
sk_cf_obj<FlutterMetalTextureHandle> mtl_texture;
|
||||
sk_cfp<FlutterMetalTextureHandle> mtl_texture;
|
||||
mtl_texture.retain(metal->texture.texture);
|
||||
texture_info.fTexture = mtl_texture;
|
||||
GrBackendTexture backend_texture(config.size.width, //
|
||||
|
||||
@ -197,7 +197,7 @@ bool EmbedderTestBackingStoreProducer::CreateMTLTexture(
|
||||
// own MTLTexture and wrapping it.
|
||||
auto surface_size = SkISize::Make(config->size.width, config->size.height);
|
||||
auto texture_info = test_metal_context_->CreateMetalTexture(surface_size);
|
||||
sk_cf_obj<FlutterMetalTextureHandle> texture;
|
||||
sk_cfp<FlutterMetalTextureHandle> texture;
|
||||
texture.retain(texture_info.texture);
|
||||
|
||||
GrMtlTextureInfo skia_texture_info;
|
||||
|
||||
@ -42,8 +42,8 @@ class TestMetalContext {
|
||||
void* command_queue_;
|
||||
sk_sp<GrDirectContext> skia_context_;
|
||||
std::mutex textures_mutex;
|
||||
int64_t texture_id_ctr_ = 1; // guarded by textures_mutex
|
||||
std::map<int64_t, sk_cf_obj<void*>> textures_; // guarded by textures_mutex
|
||||
int64_t texture_id_ctr_ = 1; // guarded by textures_mutex
|
||||
std::map<int64_t, sk_cfp<void*>> textures_; // guarded by textures_mutex
|
||||
};
|
||||
|
||||
} // namespace flutter
|
||||
|
||||
@ -82,8 +82,8 @@ TestMetalContext::TextureInfo TestMetalContext::CreateMetalTexture(const SkISize
|
||||
}
|
||||
|
||||
id<MTLDevice> device = (__bridge id<MTLDevice>)GetMetalDevice();
|
||||
sk_cf_obj<void*> texture =
|
||||
sk_cf_obj<void*>{[[device newTextureWithDescriptor:texture_descriptor.get()] retain]};
|
||||
sk_cfp<void*> texture =
|
||||
sk_cfp<void*>{[[device newTextureWithDescriptor:texture_descriptor.get()] retain]};
|
||||
|
||||
if (!texture) {
|
||||
FML_CHECK(false) << "Could not create texture from texture descriptor.";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user