diff --git a/adapter/ohos/osal/log_wrapper.cpp b/adapter/ohos/osal/log_wrapper.cpp index 851044ebac012717f93a37dbea92b0c844a11e6f..07e173c837698b7dd184d1f1c07d46ad456043d7 100644 --- a/adapter/ohos/osal/log_wrapper.cpp +++ b/adapter/ohos/osal/log_wrapper.cpp @@ -125,6 +125,7 @@ const std::unordered_map g_DOMAIN_CONTENTS_MAP = { { AceLogTag::ACE_APPBAR, "AceAppBar" }, { AceLogTag::ACE_SELECT_OVERLAY, "AceSelectOverlay" }, { AceLogTag::ACE_CLIPBOARD, "AceClipBoard" }, + { AceLogTag::ACE_VISUAL_EFFECT, "AceVisualEffect" }, { AceLogTag::ACE_SECURITY_COMPONENT, "AceSecurityComponent" }, { AceLogTag::ACE_MEDIA_QUERY, "AceMediaQuery" }, { AceLogTag::ACE_LAYOUT_INSPECTOR, "AceLayoutInspector" }, diff --git a/frameworks/bridge/declarative_frontend/jsview/js_view_context.cpp b/frameworks/bridge/declarative_frontend/jsview/js_view_context.cpp index 495c388341583c7d5015bd8a1515be99f8fc6afb..a9522a322a67e32cb340a9cc26375cd481787568 100644 --- a/frameworks/bridge/declarative_frontend/jsview/js_view_context.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/js_view_context.cpp @@ -112,18 +112,17 @@ void PrintAnimationInfo(const AnimationOption& option, AnimationInterface interf if (option.GetIteration() == ANIMATION_REPEAT_INFINITE) { if (interface == AnimationInterface::KEYFRAME_ANIMATE_TO) { TAG_LOGI(AceLogTag::ACE_ANIMATION, - "keyframeAnimateTo iteration is infinite, remember to stop it. total duration:%{public}d", - option.GetDuration()); + "keyframe inf iteration. dur:%{public}d", option.GetDuration()); } else { TAG_LOGI(AceLogTag::ACE_ANIMATION, - "%{public}s iteration is infinite. duration:%{public}d, curve:%{public}s", + "%{public}s inf iteration. dur:%{public}d, curve:%{public}s", animationInterfaceName, option.GetDuration(), option.GetCurve()->ToString().c_str()); } return; } if (cnt) { - TAG_LOGI(AceLogTag::ACE_ANIMATION, "%{public}s starts, [%{public}s], finish cnt:%{public}d", - animationInterfaceName, option.ToString().c_str(), cnt.value()); + TAG_LOGI(AceLogTag::ACE_ANIMATION, "%{public}s starts, %{public}s, cnt:%{public}d", + animationInterfaceName, option.ToSimpleString().c_str(), cnt.value()); } } @@ -208,7 +207,7 @@ void FlushDirtyNodesWhenExist(const RefPtr& pipelineContext, if (flushCount >= MAX_FLUSH_COUNT || option.GetIteration() != ANIMATION_REPEAT_INFINITE) { TAG_LOGD(AceLogTag::ACE_ANIMATION, "%{public}s, option:%{public}s, finish cnt:%{public}d," "dirtyNodes is empty:%{public}d, dirtyLayoutNodes is empty:%{public}d", - animationInterfaceName, option.ToString().c_str(), count.value_or(-1), + animationInterfaceName, option.ToSimpleString().c_str(), count.value_or(-1), isDirtyNodesEmpty, isDirtyLayoutNodesEmpty); break; } diff --git a/frameworks/core/animation/cubic_curve.cpp b/frameworks/core/animation/cubic_curve.cpp index b8f7d7ae5105fef5f1405ac8e6f51b8c1746e6d5..9c12a4864026e5a3e8299c04b2dd98d8990fb50f 100644 --- a/frameworks/core/animation/cubic_curve.cpp +++ b/frameworks/core/animation/cubic_curve.cpp @@ -63,6 +63,16 @@ const std::string CubicCurve::ToString() return curveString; } +const std::string CubicCurve::ToSimpleString() +{ + const int32_t precision = 2; + std::stringstream ss; + std::string comma(","); + ss << "cubic(" << std::fixed << std::setprecision(precision) << x0_ + << comma << y0_ << comma << x1_ << comma << y1_ << ")"; + return ss.str(); +} + bool CubicCurve::IsEqual(const RefPtr& curve) const { auto other = DynamicCast(curve); diff --git a/frameworks/core/animation/spring_curve.cpp b/frameworks/core/animation/spring_curve.cpp index 59c5d68326bdb9f8b40756d3eec0b68ebe0583a4..57ad0b5c86ef64f83fe87658232d232f7d6391aa 100644 --- a/frameworks/core/animation/spring_curve.cpp +++ b/frameworks/core/animation/spring_curve.cpp @@ -121,4 +121,13 @@ const std::string SpringCurve::ToString() return curveString; } +const std::string SpringCurve::ToSimpleString() +{ + const int32_t precision = 2; + std::stringstream ss; + std::string comma(","); + ss << "spring(" << std::fixed << std::setprecision(precision) << velocity_ + << comma << mass_ << comma << stiffness_ << comma << damping_ << ")"; + return ss.str(); +} } // namespace OHOS::Ace \ No newline at end of file diff --git a/frameworks/core/animation/spring_curve.h b/frameworks/core/animation/spring_curve.h index cc4902ca73ff60ca37a6cf6f604c13a26d88d24a..d94f2a70ad0fcc1b02311ccbb8c9f1a6964c672d 100644 --- a/frameworks/core/animation/spring_curve.h +++ b/frameworks/core/animation/spring_curve.h @@ -30,6 +30,7 @@ public: float MoveInternal(float time) override; const std::string ToString() override; + const std::string ToSimpleString() override; void UpdateVelocity(float velocity) { diff --git a/frameworks/core/interfaces/native/node/node_animate.cpp b/frameworks/core/interfaces/native/node/node_animate.cpp index d91b3034e1304818e7a782e8389a2f862fc6b9e3..856f4e8220c8da16927381e060f775700ac58903 100644 --- a/frameworks/core/interfaces/native/node/node_animate.cpp +++ b/frameworks/core/interfaces/native/node/node_animate.cpp @@ -70,20 +70,19 @@ void PrintNodeAnimationInfo(const AnimationOption& option, if (option.GetIteration() == ANIMATION_REPEAT_INFINITE) { if (interface == AnimationInterface::KEYFRAME_ANIMATE_TO) { TAG_LOGI(AceLogTag::ACE_ANIMATION, - "nodeAnimate:keyframeAnimateTo iteration is infinite, remember to stop it. total duration:%{public}d", + "nodeAnimate:keyframe inf iteration. dur:%{public}d", option.GetDuration()); } else { TAG_LOGI(AceLogTag::ACE_ANIMATION, - "nodeAnimate:%{public}s iteration is infinite." - "duration:%{public}d, curve:%{public}s", + "nodeAnimate:%{public}s inf iteration. dur:%{public}d, curve:%{public}s", animationInterfaceName, - option.GetDuration(), option.GetCurve()->ToString().c_str()); + option.GetDuration(), option.GetCurve()->ToSimpleString().c_str()); } return; } if (cnt) { - TAG_LOGI(AceLogTag::ACE_ANIMATION, "nodeAnimate:%{public}s starts, [%{public}s], finish cnt:%{public}d", - animationInterfaceName, option.ToString().c_str(), cnt.value()); + TAG_LOGI(AceLogTag::ACE_ANIMATION, "nodeAnimate:%{public}s starts, %{public}s, cnt:%{public}d", + animationInterfaceName, option.ToSimpleString().c_str(), cnt.value()); } } @@ -136,7 +135,7 @@ void AnimateToInner(ArkUIContext* context, AnimationOption& option, const std::f if (!ViewStackModel::GetInstance()->IsEmptyStack()) { TAG_LOGW(AceLogTag::ACE_ANIMATION, "node_animate:when call animateTo, node stack is not empty, not suitable for animateTo." - "param is [option:%{public}s]", option.ToString().c_str()); + "param is [option:%{public}s]", option.ToSimpleString().c_str()); } NG::ScopedViewStackProcessor scopedProcessor; auto triggerId = context->id; diff --git a/interfaces/inner_api/ace_kit/include/ui/animation/animation_option.h b/interfaces/inner_api/ace_kit/include/ui/animation/animation_option.h index 5b85cf29569b434b274efc8a364ef123a89ae625..9cf7bd68b4b3a4647a3942033610db3321d1b0a1 100644 --- a/interfaces/inner_api/ace_kit/include/ui/animation/animation_option.h +++ b/interfaces/inner_api/ace_kit/include/ui/animation/animation_option.h @@ -202,6 +202,26 @@ public: return result; } + std::string ToSimpleString() const + { + std::stringstream ss; + ss << "dur:" << duration_ << ", curve:" + << (curve_ ? curve_->ToSimpleString() : ""); + if (iteration_ != 1) { + ss << ", iter:" << iteration_; + } + if (delay_) { + ss << ", delay:" << delay_; + } + if (!NearEqual(tempo_, 1.0f)) { + ss << ", tempo:" << tempo_; + } + if (direction_ != AnimationDirection::NORMAL) { + ss << ", mode:" << static_cast(direction_); + } + return ss.str(); + } + private: int32_t duration_ = 0; int32_t delay_ = 0; diff --git a/interfaces/inner_api/ace_kit/include/ui/animation/cubic_curve.h b/interfaces/inner_api/ace_kit/include/ui/animation/cubic_curve.h index 8df26d8328437d0df6f3148aaacddc5d6bf7a220..2e729e8fdacc69028a2be556d1fdca2de0461d98 100644 --- a/interfaces/inner_api/ace_kit/include/ui/animation/cubic_curve.h +++ b/interfaces/inner_api/ace_kit/include/ui/animation/cubic_curve.h @@ -36,6 +36,7 @@ public: float MoveInternal(float time) override; const std::string ToString() override; + const std::string ToSimpleString() override; float GetX0() const { diff --git a/interfaces/inner_api/ace_kit/include/ui/animation/curve.h b/interfaces/inner_api/ace_kit/include/ui/animation/curve.h index 91ee1dbe47677eef161e08aa33a88717ced9844f..4fbd74e520c78dccef79a20c57ceb738d8114c44 100644 --- a/interfaces/inner_api/ace_kit/include/ui/animation/curve.h +++ b/interfaces/inner_api/ace_kit/include/ui/animation/curve.h @@ -17,7 +17,9 @@ #define FOUNDATION_ACE_INTERFACES_INNER_API_ACE_KIT_INCLUDE_ANIMATION_CURVE_H #include +#include #include +#include #include "ui/base/ace_type.h" #include "ui/base/macros.h" @@ -27,6 +29,7 @@ namespace OHOS::Ace { class NativeCurveHelper; constexpr double SQUARE = 2.0; +constexpr int32_t PRECISION = 2; // The running time of the curve needs to be normalized to the interval of 0.0 to 1.0; // Relatively, the corresponding value of the curve also needs to be normalized to the interval of 0.0 to 1.0; @@ -52,6 +55,11 @@ public: return ""; } + virtual const std::string ToSimpleString() + { + return ""; + } + virtual bool IsEqual(const RefPtr& curve) const { return false; @@ -137,6 +145,11 @@ public: return curveString; } + const std::string ToSimpleString() override + { + return ToString(); + } + bool IsEqual(const RefPtr& curve) const override { return AceType::InstanceOf(curve); @@ -231,6 +244,11 @@ public: return curveString; } + const std::string ToSimpleString() override + { + return ToString(); + } + bool IsEqual(const RefPtr& curve) const override { auto other = AceType::DynamicCast(curve); @@ -273,6 +291,10 @@ public: { return "customCallback"; } + const std::string ToSimpleString() override + { + return ToString(); + } private: std::function interpolateFunc_; @@ -301,6 +323,15 @@ public: comma + std::to_string(blendDuration_) + std::string(")")); return curveString; } + const std::string ToSimpleString() override + { + const int32_t precision = 3; + std::stringstream ss; + std::string comma(","); + ss << "responsiveSpring(" << std::fixed << std::setprecision(precision) << response_ + << comma << dampingRatio_ << comma << blendDuration_ << ")"; + return ss.str(); + } bool IsEqual(const RefPtr& curve) const override { auto other = AceType::DynamicCast(curve); @@ -368,6 +399,15 @@ public: return curveString; } + const std::string ToSimpleString() override + { + std::stringstream ss; + std::string comma(","); + ss << "interSpring(" << std::fixed << std::setprecision(PRECISION) << velocity_ + << comma << mass_ << comma << stiffness_ << comma << damping_ << ")"; + return ss.str(); + } + bool IsEqual(const RefPtr& curve) const override { auto other = AceType::DynamicCast(curve);