!42250 修复gesture_event_hub_test_ng测试套异常

Merge pull request !42250 from bd/20240902
This commit is contained in:
openharmony_ci 2024-09-03 02:06:42 +00:00 committed by Gitee
commit 5a358028b1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 0 deletions

View File

@ -660,6 +660,8 @@ RefPtr<PixelMap> GestureEventHub::GetPreScaledPixelMapIfExist(float targetScale,
if (!NearEqual(targetScale, 1.0f)) {
preScaledPixelMap->Scale(targetScale, targetScale, AceAntiAliasingOption::HIGH);
}
#else
preScaledPixelMap = defaultPixelMap;
#endif
return preScaledPixelMap;
}
@ -1065,6 +1067,7 @@ void GestureEventHub::OnDragStart(const GestureEvent& info, const RefPtr<Pipelin
RefPtr<PixelMap> pixelMapDuplicated = GetPreScaledPixelMapIfExist(scale, pixelMap);
dragEventActuator_->ResetPreScaledPixelMapForDragThroughTouch();
dragPreviewPixelMap_ = nullptr;
CHECK_NULL_VOID(pixelMapDuplicated);
auto width = pixelMapDuplicated->GetWidth();
auto height = pixelMapDuplicated->GetHeight();
auto pixelMapOffset = GetPixelMapOffset(info, SizeF(width, height), scale, IsPixelMapNeedScale());

View File

@ -875,6 +875,7 @@ void OnComplete(std::shared_ptr<DragControllerAsyncCtx> asyncCtx)
void ExecuteHandleOnDragStart(std::shared_ptr<DragControllerAsyncCtx> asyncCtx)
{
CHECK_NULL_VOID(asyncCtx);
{
std::lock_guard<std::mutex> lock(asyncCtx->dragStateMutex);
if (asyncCtx->dragState == DragState::SENDING) {
@ -891,6 +892,7 @@ void ExecuteHandleOnDragStart(std::shared_ptr<DragControllerAsyncCtx> asyncCtx)
void GetParams(std::shared_ptr<DragControllerAsyncCtx> asyncCtx, int32_t& dataSize,
std::string& udKey, std::map<std::string, int64_t>& summary)
{
CHECK_NULL_VOID(asyncCtx);
if (asyncCtx->unifiedData) {
int32_t ret = UdmfClient::GetInstance()->SetData(asyncCtx->unifiedData, udKey);
if (ret != 0) {