!38381 增加截图失败关键日志

Merge pull request !38381 from zhangfanfan2/master
This commit is contained in:
openharmony_ci 2024-07-22 16:48:11 +00:00 committed by Gitee
commit c7a4fabb6e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1650,16 +1650,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 thumbnail pixelMap failed!");
}
if (callback_ == nullptr) {
std::unique_lock<std::mutex> lock(g_mutex);
thumbnailGet.notify_all();
return;
}
@ -1684,10 +1684,12 @@ RefPtr<PixelMap> RosenRenderContext::GetThumbnailPixelMap(bool needScale)
auto ret =
RSInterfaces::GetInstance().TakeSurfaceCaptureForUI(rsNode_, drawDragThumbnailCallback, scaleX, scaleY, true);
if (!ret) {
LOGE("TakeSurfaceCaptureForUI failed!");
return nullptr;
}
std::unique_lock<std::mutex> lock(g_mutex);
if (thumbnailGet.wait_for(lock, PIXELMAP_TIMEOUT_DURATION) == std::cv_status::timeout) {
LOGE("get thumbnail pixelMap timeout!");
return nullptr;
}
return g_pixelMap;