update frameworks/core/components_ng/render/adapter/rosen_render_context.cpp.

Signed-off-by: zhangfanfan2 <zhangfanfan2@huawei.com>
This commit is contained in:
zhangfanfan2 2024-07-21 09:35:26 +00:00 committed by Gitee
parent f52b2c1931
commit ab3fd84c67
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1651,16 +1651,16 @@ public:
void OnSurfaceCapture(std::shared_ptr<Media::PixelMap> pixelMap) override
{
if (pixelMap) {
std::unique_lock<std::mutex> lock(g_mutex);
#ifdef PIXEL_MAP_SUPPORTED
g_pixelMap = PixelMap::CreatePixelMap(reinterpret_cast<void*>(&pixelMap));
#endif // PIXEL_MAP_SUPPORTED
} else {
g_pixelMap = nullptr;
TAG_LOGW(AceLogTag::ACE_DRAG, "get drag thumbnail pixelMap failed!");
TAG_LOGE(AceLogTag::ACE_DRAG, "get drag thumbnail pixelMap failed!");
}
if (callback_ == nullptr) {
std::unique_lock<std::mutex> lock(g_mutex);
thumbnailGet.notify_all();
return;
}
@ -1685,6 +1685,7 @@ RefPtr<PixelMap> RosenRenderContext::GetThumbnailPixelMap(bool needScale)
auto ret =
RSInterfaces::GetInstance().TakeSurfaceCaptureForUI(rsNode_, drawDragThumbnailCallback, scaleX, scaleY, true);
if (!ret) {
TAG_LOGE(AceLogTag::ACE_DRAG, "TakeSurfaceCaptureForUI failed!");
return nullptr;
}
std::unique_lock<std::mutex> lock(g_mutex);