mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-21 04:25:28 -04:00
add rotation animation
Signed-off-by: Zhang Peng <zhangpeng280@huawei.com> Change-Id: Ia3ec75be9d0f7c0a14fcb45399ba5b199b18ec3a
This commit is contained in:
@@ -513,8 +513,8 @@ ScreenId AbstractScreenController::CreateVirtualScreen(VirtualScreenOption optio
|
||||
dmsScreenMap_.insert(std::make_pair(dmsScreenId, absScreen));
|
||||
NotifyScreenConnected(absScreen->ConvertToScreenInfo());
|
||||
if (deathRecipient_ == nullptr) {
|
||||
deathRecipient_ = new AgentDeathRecipient(
|
||||
std::bind(&AbstractScreenController::OnRemoteDied, this, std::placeholders::_1));
|
||||
deathRecipient_ =
|
||||
new AgentDeathRecipient([this](const sptr<IRemoteObject>& agent) { OnRemoteDied(agent); });
|
||||
}
|
||||
auto agIter = screenAgentMap_.find(displayManagerAgent);
|
||||
if (agIter == screenAgentMap_.end()) {
|
||||
@@ -667,6 +667,7 @@ void AbstractScreenController::SetScreenRotateAnimation(
|
||||
}
|
||||
displayNode->SetRotation(-90.0f * static_cast<uint32_t>(rotationAfter)); // 90.f is base degree
|
||||
displayNode->SetFrame(x, y, w, h);
|
||||
displayNode->SetBounds(x, y, w, h);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -674,7 +675,7 @@ bool AbstractScreenController::SetRotation(ScreenId screenId, Rotation rotationA
|
||||
{
|
||||
auto screen = GetAbstractScreen(screenId);
|
||||
if (screen == nullptr) {
|
||||
WLOGFE("SetRotation error, cannot get screen with screenId: %{public}zu", screenId);
|
||||
WLOGFE("SetRotation error, cannot get screen with screenId: %{public}" PRIu64, screenId);
|
||||
return false;
|
||||
}
|
||||
if (rotationAfter != screen->rotation_) {
|
||||
@@ -1216,7 +1217,7 @@ ScreenPowerState AbstractScreenController::GetScreenPower(ScreenId dmsScreenId)
|
||||
WLOGFE("cannot find screen %{public}" PRIu64"", dmsScreenId);
|
||||
return ScreenPowerState::INVALID_STATE;
|
||||
}
|
||||
ScreenPowerState state = static_cast<ScreenPowerState>(RSInterfaces::GetInstance().GetScreenPowerStatus(rsId));
|
||||
auto state = static_cast<ScreenPowerState>(RSInterfaces::GetInstance().GetScreenPowerStatus(rsId));
|
||||
WLOGFI("GetScreenPower:%{public}u, rsscreen:%{public}" PRIu64".", state, rsId);
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
#ifndef OHOS_ROSEN_ANIMATION_CONFIG_H
|
||||
#define OHOS_ROSEN_ANIMATION_CONFIG_H
|
||||
|
||||
#include <ui/rs_display_node.h>
|
||||
#include "animation/rs_animation_timing_curve.h"
|
||||
#include "animation/rs_animation_timing_protocol.h"
|
||||
#include "common/rs_vector3.h"
|
||||
#include "common/rs_vector4.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Rosen {
|
||||
struct AnimationConfig {
|
||||
@@ -35,6 +39,6 @@ struct AnimationConfig {
|
||||
RSAnimationTimingProtocol durationOut_ = 300;
|
||||
} keyboardAnimationConfig_;
|
||||
};
|
||||
} // Rosen
|
||||
} // OHOS
|
||||
} // namespace Rosen
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_ROSEN_ANIMATION_CONFIG_H
|
||||
@@ -93,8 +93,7 @@ void DisplayGroupController::UpdateDisplayGroupWindowTree()
|
||||
WindowRootNodeType::APP_WINDOW_NODE,
|
||||
WindowRootNodeType::BELOW_WINDOW_NODE
|
||||
};
|
||||
for (size_t index = 0; index < rootNodeType.size(); ++index) {
|
||||
auto rootType = rootNodeType[index];
|
||||
for (auto& rootType : rootNodeType) {
|
||||
auto rootNode = windowNodeContainer_->GetRootNode(rootType);
|
||||
if (rootNode == nullptr) {
|
||||
WLOGFE("rootNode is nullptr, %{public}d", rootType);
|
||||
@@ -327,8 +326,8 @@ void DisplayGroupController::ProcessNotCrossNodesOnDestroyedDisplay(DisplayId di
|
||||
WindowRootNodeType::APP_WINDOW_NODE,
|
||||
WindowRootNodeType::BELOW_WINDOW_NODE
|
||||
};
|
||||
for (size_t index = 0; index < rootNodeType.size(); ++index) {
|
||||
auto& nodesVec = *(displayGroupWindowTree_[displayId][rootNodeType[index]]);
|
||||
for (auto& type : rootNodeType) {
|
||||
auto& nodesVec = *(displayGroupWindowTree_[displayId][type]);
|
||||
for (auto& node : nodesVec) {
|
||||
if (node->GetDisplayId() != displayId || node->isShowingOnMultiDisplays_) {
|
||||
continue;
|
||||
@@ -387,17 +386,17 @@ void DisplayGroupController::ProcessDisplayDestroy(DisplayId defaultDisplayId, s
|
||||
windowNodeContainer_->GetLayoutPolicy()->ProcessDisplayDestroy(displayId, displayRectMap);
|
||||
}
|
||||
|
||||
void DisplayGroupController::UpdateNodeSizeChangeReasonWithRotation(DisplayId displayId) {
|
||||
void DisplayGroupController::UpdateNodeSizeChangeReasonWithRotation(DisplayId displayId)
|
||||
{
|
||||
std::vector<WindowRootNodeType> rootNodeType = {
|
||||
WindowRootNodeType::ABOVE_WINDOW_NODE,
|
||||
WindowRootNodeType::APP_WINDOW_NODE,
|
||||
WindowRootNodeType::BELOW_WINDOW_NODE
|
||||
};
|
||||
for (size_t index = 0; index < rootNodeType.size(); ++index) {
|
||||
auto rootType = rootNodeType[index];
|
||||
for (auto& rootType : rootNodeType) {
|
||||
std::vector<sptr<WindowNode>>* rootNodeVectorPtr = GetWindowNodesByDisplayIdAndRootType(displayId, rootType);
|
||||
if (rootNodeVectorPtr == nullptr) {
|
||||
WLOGFE("rootNodeVectorPtr is nullptr, %{public}d, displayId: %{public}zu", rootType, displayId);
|
||||
WLOGFE("rootNodeVectorPtr is nullptr, %{public}d, displayId: %{public}" PRIu64, rootType, displayId);
|
||||
return;
|
||||
}
|
||||
for (auto& node : (*rootNodeVectorPtr)) {
|
||||
|
||||
@@ -968,7 +968,7 @@ static void SetBounds(const sptr<WindowNode>& node, const Rect& winRect, const R
|
||||
WLOGFI("not need to update bounds");
|
||||
return;
|
||||
}
|
||||
// if start dragging, set resize gravity for surface node
|
||||
// set surface node gravity based on WindowSizeChangeReason
|
||||
if (node->GetWindowSizeChangeReason() == WindowSizeChangeReason::DRAG_START ||
|
||||
node->GetWindowSizeChangeReason() == WindowSizeChangeReason::DRAG ||
|
||||
node->GetWindowSizeChangeReason() == WindowSizeChangeReason::ROTATION) {
|
||||
|
||||
Reference in New Issue
Block a user