!43339 新增窗口缩放动效统计

Merge pull request !43339 from link/master
This commit is contained in:
openharmony_ci 2024-09-18 06:32:50 +00:00 committed by Gitee
commit 1f8ec9cd90
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 19 additions and 0 deletions

View File

@ -2404,6 +2404,8 @@ void UIContentImpl::UpdateViewportConfig(const ViewportConfig& config, OHOS::Ros
const std::shared_ptr<OHOS::Rosen::RSTransaction>& rsTransaction,
const std::map<OHOS::Rosen::AvoidAreaType, OHOS::Rosen::AvoidArea>& avoidAreas)
{
PerfMonitor::GetPerfMonitor()->RecordWindowRectResize(static_cast<OHOS::Ace::WindowSizeChangeReason>(reason),
bundleName_);
UpdateViewportConfigWithAnimation(config, reason, {}, rsTransaction, avoidAreas);
}

View File

@ -668,4 +668,18 @@ int32_t PerfMonitor::GetFilterType() const
return filterType;
}
void PerfMonitor::RecordWindowRectResize(OHOS::Ace::WindowSizeChangeReason reason, const std::string& bundleName)
{
switch (reason) {
case OHOS::Ace::WindowSizeChangeReason::DRAG_START:
Start(PerfConstants::WINDOW_RECT_RESIZE, PerfActionType::LAST_DOWN, bundleName.c_str());
break;
case OHOS::Ace::WindowSizeChangeReason::DRAG_END:
End(PerfConstants::WINDOW_RECT_RESIZE, true);
break;
default:
break;
}
}
} // namespace OHOS::Ace

View File

@ -23,6 +23,7 @@
#include <algorithm>
#include "base/utils/macros.h"
#include "core/common/window_animation_config.h"
namespace OHOS::Ace {
constexpr int32_t US_TO_MS = 1000;
@ -147,6 +148,8 @@ public:
static PerfMonitor* pMonitor;
void ReportPageShowMsg(const std::string& pageUrl, const std::string& bundleName,
const std::string& pageName);
void RecordWindowRectResize(OHOS::Ace::WindowSizeChangeReason reason,
const std::string& bundleName);
private:
SceneRecord* GetRecord(const std::string& sceneId);