From f4b2ed115753fda4cff21d65ec572adcc6a2904a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E5=87=AF?= Date: Sat, 26 Jul 2025 17:12:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永凯 --- .../jsview/canvas/js_canvas_renderer.cpp | 5 +-- .../rosen_render_offscreen_canvas.h | 10 +---- .../pattern/canvas/canvas_model_ng.cpp | 4 +- .../pattern/canvas/canvas_pattern.cpp | 10 ++--- .../pattern/canvas/canvas_pattern.h | 12 +++--- .../pattern/shape/ellipse_paint_method.h | 2 +- .../pattern/shape/line_layout_algorithm.h | 4 +- .../pattern/shape/path_layout_algorithm.h | 4 +- .../shape/shape_container_layout_algorithm.h | 4 +- .../pattern/shape/shape_container_pattern.h | 2 +- .../pattern/shape/shape_layout_algorithm.h | 1 + .../pattern/shape/shape_overlay_modifier.h | 2 +- .../pattern/shape/shape_paint_method.h | 2 +- .../pattern/shape/shape_pattern.h | 2 +- .../video/video_full_screen_pattern.cpp | 3 +- .../pattern/video/video_layout_algorithm.h | 2 - .../pattern/video/video_model_ng.cpp | 14 +++++- .../pattern/video/video_pattern.h | 4 +- .../components_ng/pattern/xcomponent/BUILD.gn | 9 +--- .../xcomponent/xcomponent_layout_algorithm.h | 3 +- .../xcomponent/xcomponent_pattern_v2.h | 10 +---- .../components_ng/render/adapter/matrix2d.h | 1 + .../canvas_renderer_peer_impl.cpp | 16 +++---- .../implementation/x_component_modifier.cpp | 4 +- .../native/node/node_xcomponent_modifier.cpp | 3 +- test/mock/core/rosen/testing_matrix.h | 3 +- .../pattern/shape/shape_pattern_test_ng.cpp | 2 +- .../pattern/video/video_test_ng_extra_add.cpp | 21 +++++---- .../interfaces/xcomponent_controller_test.cpp | 43 ++++++++++--------- 29 files changed, 97 insertions(+), 105 deletions(-) diff --git a/frameworks/bridge/declarative_frontend/jsview/canvas/js_canvas_renderer.cpp b/frameworks/bridge/declarative_frontend/jsview/canvas/js_canvas_renderer.cpp index 247990ea887..c67ff2d006b 100644 --- a/frameworks/bridge/declarative_frontend/jsview/canvas/js_canvas_renderer.cpp +++ b/frameworks/bridge/declarative_frontend/jsview/canvas/js_canvas_renderer.cpp @@ -30,7 +30,6 @@ #include "core/components/font/rosen_font_collection.h" #include "core/pipeline/pipeline_base.h" #include "core/pipeline/pipeline_context.h" -#include "core/pipeline/base/constants.h" #ifdef PIXEL_MAP_SUPPORTED #include "pixel_map.h" @@ -262,7 +261,7 @@ void JSCanvasRenderer::JsCreateConicGradient(const JSCallbackInfo& info) double density = GetDensity(); auto gradient = std::make_shared(); gradient->SetType(GradientType::CONIC); - gradient->GetConicGradient().startAngle = AnimatableDimension(Dimension(fmod(startAngle, (2 * ACE_PI)))); + gradient->GetConicGradient().startAngle = AnimatableDimension(Dimension(fmod(startAngle, (2 * M_PI)))); gradient->GetConicGradient().centerX = AnimatableDimension(Dimension(x * density)); gradient->GetConicGradient().centerY = AnimatableDimension(Dimension(y * density)); JSRef pasteObj = createGradientObj(gradient); @@ -1236,7 +1235,6 @@ void JSCanvasRenderer::JsArc(const JSCallbackInfo& info) info.GetDoubleArg(2, param.radius, isJudgeSpecialValue_) && // Index2: the 3rd arg. info.GetDoubleArg(3, param.startAngle, isJudgeSpecialValue_) && // Index3: the 4th arg. info.GetDoubleArg(4, param.endAngle, isJudgeSpecialValue_)) { // Index4: the 5th arg. - info.GetBooleanArg(5, param.anticlockwise); // Non mandatory parameter with default value 'false' double density = GetDensity(); param.x *= density; @@ -1258,7 +1256,6 @@ void JSCanvasRenderer::JsEllipse(const JSCallbackInfo& info) info.GetDoubleArg(4, param.rotation, isJudgeSpecialValue_) && // Index4: the 5th arg. info.GetDoubleArg(5, param.startAngle, isJudgeSpecialValue_) && // Index5: the 6th arg. info.GetDoubleArg(6, param.endAngle, isJudgeSpecialValue_)) { // Index6: the 7th arg. - info.GetBooleanArg(7, param.anticlockwise); // Non mandatory parameter with default value 'false' double density = GetDensity(); param.x *= density; diff --git a/frameworks/core/components/custom_paint/rosen_render_offscreen_canvas.h b/frameworks/core/components/custom_paint/rosen_render_offscreen_canvas.h index 65d2965415d..a4f339ef8ad 100644 --- a/frameworks/core/components/custom_paint/rosen_render_offscreen_canvas.h +++ b/frameworks/core/components/custom_paint/rosen_render_offscreen_canvas.h @@ -33,19 +33,13 @@ namespace OHOS::Ace { using setColorFunc = std::function; -#ifdef ACE_STATIC -class ACE_FORCE_EXPORT RosenRenderOffscreenCanvas : public RenderOffscreenCanvas { -#else +// 宋启帆上周合入 class RosenRenderOffscreenCanvas : public RenderOffscreenCanvas { -#endif DECLARE_ACE_TYPE(RosenRenderOffscreenCanvas, RenderOffscreenCanvas); public: - #ifdef ACE_STATIC - ACE_FORCE_EXPORT RosenRenderOffscreenCanvas(const WeakPtr& context, int32_t width, int32_t height); - #else +// 宋启帆上周合入 RosenRenderOffscreenCanvas(const WeakPtr& context, int32_t width, int32_t height); - #endif ~RosenRenderOffscreenCanvas() override = default; void SetAntiAlias(bool isEnabled) override; void FillRect(Rect rect) override; diff --git a/frameworks/core/components_ng/pattern/canvas/canvas_model_ng.cpp b/frameworks/core/components_ng/pattern/canvas/canvas_model_ng.cpp index a9d51a55fc3..3e1cda89a94 100644 --- a/frameworks/core/components_ng/pattern/canvas/canvas_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/canvas/canvas_model_ng.cpp @@ -53,7 +53,7 @@ void CanvasModelNG::SetOnReady(std::function&& onReady) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); - auto eventHub = frameNode->GetOrCreateEventHub(); + auto eventHub = frameNode->GetEventHub(); CHECK_NULL_VOID(eventHub); auto func = onReady; @@ -91,7 +91,7 @@ void CanvasModelNG::DetachRenderContext() void CanvasModelNG::SetOnReady(FrameNode* frameNode, std::function&& onReady) { CHECK_NULL_VOID(frameNode); - auto eventHub = frameNode->GetOrCreateEventHub(); + auto eventHub = frameNode->GetEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnReady(std::move(onReady)); } diff --git a/frameworks/core/components_ng/pattern/canvas/canvas_pattern.cpp b/frameworks/core/components_ng/pattern/canvas/canvas_pattern.cpp index 91698f9c5aa..ecc6d3a7f25 100644 --- a/frameworks/core/components_ng/pattern/canvas/canvas_pattern.cpp +++ b/frameworks/core/components_ng/pattern/canvas/canvas_pattern.cpp @@ -86,16 +86,15 @@ void CanvasPattern::FireOnContext2DDetach() void CanvasPattern::OnAttachToFrameNode() { - auto host = GetHost(); - CHECK_NULL_VOID(host); - id_ = host->GetId(); ACE_SCOPED_TRACE("Canvas[%d] CanvasPattern::OnAttachToFrameNode", id_); #ifndef ACE_UNITTEST + auto host = GetHost(); + CHECK_NULL_VOID(host); auto renderCtx = host->GetRenderContext(); renderCtx->SetClipToBounds(false); renderCtx->SetUsingContentRectForRenderFrame(true); renderCtx->SetFrameGravity(Rosen::Gravity::RESIZE_ASPECT_FILL); - renderCtx->SetNeedUseCmdlistDrawRegion(true); + // renderCtx->SetNeedUseCmdlistDrawRegion(true);四周前wangchenchuan if (!contentModifier_) { contentModifier_ = AceType::MakeRefPtr(); } @@ -169,7 +168,8 @@ void CanvasPattern::OnSizeChanged(const DirtySwapConfig& config, bool needReset) contentModifier_->SetRenderContext(renderContext); CHECK_NULL_VOID(paintMethod_); paintMethod_->UpdateRecordingCanvas(currentPixelGridRoundSize.Width(), currentPixelGridRoundSize.Height()); - auto canvasEventHub = GetOrCreateEventHub(); + // mucor.wang@huawei.com 三个月前更改 + auto canvasEventHub = GetEventHub(); CHECK_NULL_VOID(canvasEventHub); canvasEventHub->FireReadyEvent(); } diff --git a/frameworks/core/components_ng/pattern/canvas/canvas_pattern.h b/frameworks/core/components_ng/pattern/canvas/canvas_pattern.h index 0511df2b976..2bd4d752d64 100644 --- a/frameworks/core/components_ng/pattern/canvas/canvas_pattern.h +++ b/frameworks/core/components_ng/pattern/canvas/canvas_pattern.h @@ -48,11 +48,11 @@ public: { return true; } - - bool IsEnableFix() override - { - return true; - } +// 家振哥三周前合入 +// bool IsEnableFix() override +// { +// return true; +// } int32_t GetId() const { @@ -232,7 +232,7 @@ private: TextDirection currentSetTextDirection_ = TextDirection::INHERIT; RefPtr contentModifier_; bool isAttached_ = false; - int32_t id_ = -1; + // int32_t id_ = -1;上周观斌老师合入 ACE_DISALLOW_COPY_AND_MOVE(CanvasPattern); }; } // namespace OHOS::Ace::NG diff --git a/frameworks/core/components_ng/pattern/shape/ellipse_paint_method.h b/frameworks/core/components_ng/pattern/shape/ellipse_paint_method.h index 7909480d047..8ae2a112a40 100644 --- a/frameworks/core/components_ng/pattern/shape/ellipse_paint_method.h +++ b/frameworks/core/components_ng/pattern/shape/ellipse_paint_method.h @@ -28,7 +28,7 @@ namespace OHOS::Ace::NG { class ACE_EXPORT EllipsePaintMethod : public ShapePaintMethod { - DECLARE_ACE_TYPE(EllipsePaintMethod, ShapePaintMethod) + DECLARE_ACE_TYPE(EllipsePaintMethod, ShapePaintMethod); public: EllipsePaintMethod() = default; EllipsePaintMethod( diff --git a/frameworks/core/components_ng/pattern/shape/line_layout_algorithm.h b/frameworks/core/components_ng/pattern/shape/line_layout_algorithm.h index b2f51862249..402c8279dc1 100644 --- a/frameworks/core/components_ng/pattern/shape/line_layout_algorithm.h +++ b/frameworks/core/components_ng/pattern/shape/line_layout_algorithm.h @@ -26,12 +26,12 @@ class ACE_EXPORT LineLayoutAlgorithm : public ShapeLayoutAlgorithm { public: LineLayoutAlgorithm() = default; ~LineLayoutAlgorithm() override = default; - +// 家振哥三周前合入 void Measure(LayoutWrapper* layoutWrapper) override; std::optional MeasureContent( const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper) override; - +// 家振哥三周前合入 void MeasureLayoutPolicySize(const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper, SizeF& size); private: diff --git a/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.h b/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.h index 72ce646159a..7cf69dff7f2 100644 --- a/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.h +++ b/frameworks/core/components_ng/pattern/shape/path_layout_algorithm.h @@ -30,12 +30,12 @@ public: : propertiesFromAncestor_(shapePaintProperty) {} ~PathLayoutAlgorithm() override = default; - +// 家振哥三周前合入 void Measure(LayoutWrapper* layoutWrapper) override; std::optional MeasureContent( const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper) override; - +// 家振哥三周前合入 void MeasureLayoutPolicySize(const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper, SizeF& size); private: diff --git a/frameworks/core/components_ng/pattern/shape/shape_container_layout_algorithm.h b/frameworks/core/components_ng/pattern/shape/shape_container_layout_algorithm.h index b95af10d6ed..9b43a0ca019 100644 --- a/frameworks/core/components_ng/pattern/shape/shape_container_layout_algorithm.h +++ b/frameworks/core/components_ng/pattern/shape/shape_container_layout_algorithm.h @@ -25,12 +25,12 @@ class ACE_EXPORT ShapeContainerLayoutAlgorithm : public BoxLayoutAlgorithm { public: ShapeContainerLayoutAlgorithm() = default; ~ShapeContainerLayoutAlgorithm() override = default; - +// 家振哥三周前合入 void Measure(LayoutWrapper* layoutWrapper) override; std::optional MeasureContent( const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper) override; - +// 家振哥三周前合入 void MeasureLayoutPolicySize(const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper, SizeF& size); private: diff --git a/frameworks/core/components_ng/pattern/shape/shape_container_pattern.h b/frameworks/core/components_ng/pattern/shape/shape_container_pattern.h index 5ba72749c5f..7202e4d8d4a 100644 --- a/frameworks/core/components_ng/pattern/shape/shape_container_pattern.h +++ b/frameworks/core/components_ng/pattern/shape/shape_container_pattern.h @@ -48,7 +48,7 @@ public: { return true; } - +// 家振哥三周前合入 bool IsEnableFix() override { return true; diff --git a/frameworks/core/components_ng/pattern/shape/shape_layout_algorithm.h b/frameworks/core/components_ng/pattern/shape/shape_layout_algorithm.h index 7f188f5c3b7..74b1e89a46b 100644 --- a/frameworks/core/components_ng/pattern/shape/shape_layout_algorithm.h +++ b/frameworks/core/components_ng/pattern/shape/shape_layout_algorithm.h @@ -28,6 +28,7 @@ public: std::optional MeasureContent( const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper) override; + private: ACE_DISALLOW_COPY_AND_MOVE(ShapeLayoutAlgorithm); }; diff --git a/frameworks/core/components_ng/pattern/shape/shape_overlay_modifier.h b/frameworks/core/components_ng/pattern/shape/shape_overlay_modifier.h index 58bb76c7221..b4d2630822a 100644 --- a/frameworks/core/components_ng/pattern/shape/shape_overlay_modifier.h +++ b/frameworks/core/components_ng/pattern/shape/shape_overlay_modifier.h @@ -26,7 +26,7 @@ namespace OHOS::Ace::NG { class Pattern; class ShapeOverlayModifier : public OverlayModifier { - DECLARE_ACE_TYPE(ShapeOverlayModifier, OverlayModifier) + DECLARE_ACE_TYPE(ShapeOverlayModifier, OverlayModifier); public: static constexpr double SHAPE_OVERLAY_SIZE_DEFAULT = 4096.0f; diff --git a/frameworks/core/components_ng/pattern/shape/shape_paint_method.h b/frameworks/core/components_ng/pattern/shape/shape_paint_method.h index 2d17e765059..8c3ebc1b9e0 100755 --- a/frameworks/core/components_ng/pattern/shape/shape_paint_method.h +++ b/frameworks/core/components_ng/pattern/shape/shape_paint_method.h @@ -24,7 +24,7 @@ namespace OHOS::Ace::NG { class ACE_EXPORT ShapePaintMethod : public NodePaintMethod { - DECLARE_ACE_TYPE(ShapePaintMethod, NodePaintMethod) + DECLARE_ACE_TYPE(ShapePaintMethod, NodePaintMethod); public: ShapePaintMethod() = default; ShapePaintMethod( diff --git a/frameworks/core/components_ng/pattern/shape/shape_pattern.h b/frameworks/core/components_ng/pattern/shape/shape_pattern.h index 19bd733f003..07bf81b4075 100644 --- a/frameworks/core/components_ng/pattern/shape/shape_pattern.h +++ b/frameworks/core/components_ng/pattern/shape/shape_pattern.h @@ -42,7 +42,7 @@ public: { return true; } - +// 家振哥三周前合入 bool IsEnableFix() override { return true; diff --git a/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp b/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp index 550bb891d37..569eae0c5dd 100644 --- a/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp +++ b/frameworks/core/components_ng/pattern/video/video_full_screen_pattern.cpp @@ -28,7 +28,8 @@ void VideoFullScreenPattern::InitFullScreenParam(const RefPtr& vid RecoverState(videoPattern); auto video = videoPattern->GetHost(); CHECK_NULL_VOID(video); - SetEventHub(video->GetOrCreateEventHub()); + // mucor.wang@huawei.com 三个月前合入 + SetEventHub(video->GetEventHub()); } void VideoFullScreenPattern::SetEventHub(const RefPtr& eventHub) diff --git a/frameworks/core/components_ng/pattern/video/video_layout_algorithm.h b/frameworks/core/components_ng/pattern/video/video_layout_algorithm.h index ecb6be009fc..27f252ffa08 100644 --- a/frameworks/core/components_ng/pattern/video/video_layout_algorithm.h +++ b/frameworks/core/components_ng/pattern/video/video_layout_algorithm.h @@ -30,9 +30,7 @@ public: std::optional MeasureContent( const LayoutConstraintF& contentConstraint, LayoutWrapper* layoutWrapper) override; - void Measure(LayoutWrapper* layoutWrapper) override; - void Layout(LayoutWrapper* layoutWrapper) override; private: diff --git a/frameworks/core/components_ng/pattern/video/video_model_ng.cpp b/frameworks/core/components_ng/pattern/video/video_model_ng.cpp index ef6efccff52..ec71f17b0b2 100644 --- a/frameworks/core/components_ng/pattern/video/video_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/video/video_model_ng.cpp @@ -162,7 +162,8 @@ void VideoModelNG::SetOnStart(VideoEventFunc&& onStart) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); - auto eventHub = frameNode->GetOrCreateEventHub(); + // mucor.wang@huawei.com 三个月前合入 + auto eventHub = frameNode->GetEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnStart(std::move(onStart)); } @@ -171,7 +172,8 @@ void VideoModelNG::SetOnPause(VideoEventFunc&& onPause) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); - auto eventHub = frameNode->GetOrCreateEventHub(); + // mucor.wang@huawei.com 三个月前合入 + auto eventHub = frameNode->GetEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnPause(std::move(onPause)); } @@ -180,6 +182,7 @@ void VideoModelNG::SetOnFinish(VideoEventFunc&& onFinish) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnFinish(std::move(onFinish)); @@ -189,6 +192,7 @@ void VideoModelNG::SetOnError(VideoEventFunc&& onError) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnError(std::move(onError)); @@ -198,6 +202,7 @@ void VideoModelNG::SetOnPrepared(VideoEventFunc&& onPrepared) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnPrepared(std::move(onPrepared)); @@ -207,6 +212,7 @@ void VideoModelNG::SetOnSeeking(VideoEventFunc&& onSeeking) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnSeeking(std::move(onSeeking)); @@ -216,6 +222,7 @@ void VideoModelNG::SetOnSeeked(VideoEventFunc&& onSeeked) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnSeeked(std::move(onSeeked)); @@ -225,6 +232,7 @@ void VideoModelNG::SetOnUpdate(VideoEventFunc&& onUpdate) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnUpdate(std::move(onUpdate)); @@ -234,6 +242,7 @@ void VideoModelNG::SetOnStop(VideoEventFunc&& onStop) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnStop(std::move(onStop)); @@ -243,6 +252,7 @@ void VideoModelNG::SetOnFullScreenChange(VideoEventFunc&& onFullScreenChange) { auto frameNode = ViewStackProcessor::GetInstance()->GetMainFrameNode(); CHECK_NULL_VOID(frameNode); + // mucor.wang@huawei.com 三个月前合入 auto eventHub = frameNode->GetOrCreateEventHub(); CHECK_NULL_VOID(eventHub); eventHub->SetOnFullScreenChange(std::move(onFullScreenChange)); diff --git a/frameworks/core/components_ng/pattern/video/video_pattern.h b/frameworks/core/components_ng/pattern/video/video_pattern.h index 016971e81c1..7b4933b019a 100755 --- a/frameworks/core/components_ng/pattern/video/video_pattern.h +++ b/frameworks/core/components_ng/pattern/video/video_pattern.h @@ -50,7 +50,7 @@ public: { return true; } - +// 家振哥三周前合入 bool IsEnableFix() override { return true; @@ -284,7 +284,7 @@ public: #ifdef RENDER_EXTRACT_SUPPORTED void OnTextureRefresh(void* surface); #endif - +// 东升哥七天前合入 void SetVideoController(const RefPtr& videoController); RefPtr GetVideoController(); diff --git a/frameworks/core/components_ng/pattern/xcomponent/BUILD.gn b/frameworks/core/components_ng/pattern/xcomponent/BUILD.gn index d0bfdfca90b..30e42dca759 100644 --- a/frameworks/core/components_ng/pattern/xcomponent/BUILD.gn +++ b/frameworks/core/components_ng/pattern/xcomponent/BUILD.gn @@ -29,14 +29,7 @@ build_component_ng("xcomponent_pattern_ng") { "xcomponent_utils.cpp", "xcomponent_inner_surface_controller.cpp", ] - - if (ace_engine_feature_enable_static_instructive_code) { - sources += [ - "xcomponent_model_static.cpp", - "xcomponent_pattern_multithread.cpp", - ] - } - +# 东升哥七天前合入 if (is_ohos_standard_system) { deps = [ "$ace_root/interfaces/inner_api/xcomponent_controller:ace_xcomponent_controller" ] external_deps = [ diff --git a/frameworks/core/components_ng/pattern/xcomponent/xcomponent_layout_algorithm.h b/frameworks/core/components_ng/pattern/xcomponent/xcomponent_layout_algorithm.h index 7931f3e55e2..99f3e44e547 100644 --- a/frameworks/core/components_ng/pattern/xcomponent/xcomponent_layout_algorithm.h +++ b/frameworks/core/components_ng/pattern/xcomponent/xcomponent_layout_algorithm.h @@ -20,8 +20,7 @@ #include "core/components_ng/layout/box_layout_algorithm.h" #include "core/components_ng/layout/layout_wrapper.h" -#include "core/components_ng/pattern/xcomponent/xcomponent_layout_property.h" - +// 家振哥三周前合入 namespace OHOS::Ace::NG { class PipelineContext; diff --git a/frameworks/core/components_ng/pattern/xcomponent/xcomponent_pattern_v2.h b/frameworks/core/components_ng/pattern/xcomponent/xcomponent_pattern_v2.h index 75454f716eb..89b9158102c 100644 --- a/frameworks/core/components_ng/pattern/xcomponent/xcomponent_pattern_v2.h +++ b/frameworks/core/components_ng/pattern/xcomponent/xcomponent_pattern_v2.h @@ -81,15 +81,7 @@ private: void OnRebuildFrame() override; void OnModifyDone() override; void DumpInfo() override; - -#ifdef ACE_STATIC - void InitSurfaceMultiThread(const RefPtr& host); - void OnAttachToMainTreeMultiThread(const RefPtr& host); - void RegisterContextEventMultiThread(const RefPtr& host); - void OnDetachFromMainTreeMultiThread(const RefPtr& host); - void OnDetachFromFrameNodeMultiThread(); -#endif - +// 东升哥七天前合入 void InitSurface(); void DisposeSurface(); int32_t HandleSurfaceCreated(); diff --git a/frameworks/core/components_ng/render/adapter/matrix2d.h b/frameworks/core/components_ng/render/adapter/matrix2d.h index aa15a0a1174..356549ef874 100644 --- a/frameworks/core/components_ng/render/adapter/matrix2d.h +++ b/frameworks/core/components_ng/render/adapter/matrix2d.h @@ -29,6 +29,7 @@ public: static void Rotate(TransformParam& param, double degree, double dx, double dy); static std::string ToString(); }; +Matrix4 SetMatrixPolyToPoly(const Matrix4& matrix, const std::Vector>& totalPoint); } // namespace OHOS::Ace::NG #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_RENDER_ADAPTER_MATRIX2D_H diff --git a/frameworks/core/interfaces/native/implementation/canvas_renderer_peer_impl.cpp b/frameworks/core/interfaces/native/implementation/canvas_renderer_peer_impl.cpp index 4e649377689..e0e73063488 100644 --- a/frameworks/core/interfaces/native/implementation/canvas_renderer_peer_impl.cpp +++ b/frameworks/core/interfaces/native/implementation/canvas_renderer_peer_impl.cpp @@ -20,7 +20,7 @@ #include "canvas_pattern_peer.h" #include "image_bitmap_peer_impl.h" #include "pixel_map_peer.h" -#include "core/pipeline/base/constants.h" +// Change-Id: I5def60c9b7b7abb4156dfa29c6b2a0a20e25d308 上个月合入 namespace OHOS::Ace::NG { namespace { @@ -200,7 +200,7 @@ void CanvasRendererPeerImpl::Clip(const std::optional& ruleStr) { CHECK_NULL_VOID(renderingContext2DModel_); auto fillRule = CanvasFillRule::NONZERO; - // clip(fillRule?: CanvasFillRule): void + // 徐钦锋 两个月前合入 if (ruleStr) { fillRule = *ruleStr == "evenodd" ? CanvasFillRule::EVENODD : CanvasFillRule::NONZERO; } @@ -211,13 +211,13 @@ void CanvasRendererPeerImpl::Clip(const std::optional& ruleStr, con CHECK_NULL_VOID(renderingContext2DModel_); auto fillRule = CanvasFillRule::NONZERO; if (!path) { - // clip(fillRule?: CanvasFillRule): void + // 徐钦锋 两个月前合入 if (ruleStr) { fillRule = *ruleStr == "evenodd" ? CanvasFillRule::EVENODD : CanvasFillRule::NONZERO; } renderingContext2DModel_->SetClipRuleForPath(fillRule); } else { - // clip(path: Path2D, fillRule?: CanvasFillRule): void + // 徐钦锋 两个月前合入 if (ruleStr) { fillRule = *ruleStr == "evenodd" ? CanvasFillRule::EVENODD : CanvasFillRule::NONZERO; } @@ -228,7 +228,7 @@ void CanvasRendererPeerImpl::Fill(const std::optional& ruleStr) { CHECK_NULL_VOID(renderingContext2DModel_); auto fillRule = CanvasFillRule::NONZERO; - // fill(fillRule?: CanvasFillRule): void + // 徐钦锋 两个月前合入 if (ruleStr) { fillRule = *ruleStr == "evenodd" ? CanvasFillRule::EVENODD : CanvasFillRule::NONZERO; } @@ -239,13 +239,13 @@ void CanvasRendererPeerImpl::Fill(const std::optional& ruleStr, con CHECK_NULL_VOID(renderingContext2DModel_); auto fillRule = CanvasFillRule::NONZERO; if (!path) { - // fill(fillRule?: CanvasFillRule): void + // 徐钦锋 两个月前合入 if (ruleStr) { fillRule = *ruleStr == "evenodd" ? CanvasFillRule::EVENODD : CanvasFillRule::NONZERO; } renderingContext2DModel_->SetFillRuleForPath(fillRule); } else { - // fill(path: Path2D, fillRule?: CanvasFillRule): void + // 徐钦锋 两个月前合入 if (ruleStr) { fillRule = *ruleStr == "evenodd" ? CanvasFillRule::EVENODD : CanvasFillRule::NONZERO; } @@ -331,7 +331,7 @@ std::shared_ptr CanvasRendererPeerImpl::CreateConicGradient auto gradient = std::make_shared(); gradient->SetType(Ace::GradientType::CONIC); gradient->GetConicGradient().startAngle = - Ace::AnimatableDimension(Ace::Dimension(fmod(startAngle, (MULTI_BY_2 * ACE_PI)))); + Ace::AnimatableDimension(Ace::Dimension(fmod(startAngle, (MULTI_BY_2 * M_PI)))); gradient->GetConicGradient().centerX = Ace::AnimatableDimension(Ace::Dimension(x * density)); gradient->GetConicGradient().centerY = Ace::AnimatableDimension(Ace::Dimension(y * density)); return gradient; diff --git a/frameworks/core/interfaces/native/implementation/x_component_modifier.cpp b/frameworks/core/interfaces/native/implementation/x_component_modifier.cpp index 66fc3e0bba2..3ab8471f3a8 100644 --- a/frameworks/core/interfaces/native/implementation/x_component_modifier.cpp +++ b/frameworks/core/interfaces/native/implementation/x_component_modifier.cpp @@ -52,9 +52,7 @@ Ark_NativePointer ConstructImpl(Ark_Int32 id, Ark_Int32 flags) { // #ifdef XCOMPONENT_SUPPORTED -// auto frameNode = XComponentModelNG::CreateFrameNodePeer(id, std::nullopt, XComponentType::SURFACE, std::nullopt); -// frameNode->IncRefCount(); -// return AceType::RawPtr(frameNode); +// 徐钦锋两个月前合入 // #else // return {}; // #endif //XCOMPONENT_SUPPORTED diff --git a/frameworks/core/interfaces/native/node/node_xcomponent_modifier.cpp b/frameworks/core/interfaces/native/node/node_xcomponent_modifier.cpp index 78aab6b778e..b23f6a6da0c 100644 --- a/frameworks/core/interfaces/native/node/node_xcomponent_modifier.cpp +++ b/frameworks/core/interfaces/native/node/node_xcomponent_modifier.cpp @@ -22,7 +22,8 @@ namespace OHOS::Ace::NG { namespace { const uint32_t ERROR_UINT_CODE = -1; -thread_local std::string g_strValue; +// 东升哥四周前合入 +std::string g_strValue; void SetXComponentEnableAnalyzer(ArkUINodeHandle node, ArkUI_Bool enable) { diff --git a/test/mock/core/rosen/testing_matrix.h b/test/mock/core/rosen/testing_matrix.h index 5eabeef16c7..cec07b71b5f 100644 --- a/test/mock/core/rosen/testing_matrix.h +++ b/test/mock/core/rosen/testing_matrix.h @@ -70,8 +70,7 @@ public: } void Reset() {} - - void SetScaleTranslate(float sx, float sy, float dx, float dy) {} + // wangguan27@huawei.com 七个月前合入 }; } // namespace OHOS::Ace::Testing #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_MOCK_ROSEN_TEST_TESTING_MATRIX_H diff --git a/test/unittest/core/pattern/shape/shape_pattern_test_ng.cpp b/test/unittest/core/pattern/shape/shape_pattern_test_ng.cpp index 4f9ba327847..33d32f10462 100755 --- a/test/unittest/core/pattern/shape/shape_pattern_test_ng.cpp +++ b/test/unittest/core/pattern/shape/shape_pattern_test_ng.cpp @@ -26,7 +26,7 @@ #include "base/geometry/axis.h" #include "base/geometry/dimension.h" #include "base/geometry/ng/size_t.h" -#include "core/accessibility/accessibility_manager.h" +// kangchongtao 四个月前头文件整改 #include "core/components/common/properties/color.h" #include "core/components_ng/base/ui_node.h" #include "core/components_ng/base/view_stack_processor.h" diff --git a/test/unittest/core/pattern/video/video_test_ng_extra_add.cpp b/test/unittest/core/pattern/video/video_test_ng_extra_add.cpp index c7eca00c4d3..9c34f702c86 100755 --- a/test/unittest/core/pattern/video/video_test_ng_extra_add.cpp +++ b/test/unittest/core/pattern/video/video_test_ng_extra_add.cpp @@ -27,12 +27,12 @@ #define private public #define protected public #include "test/mock/core/common/mock_theme_manager.h" +#include "test/mock/core/common/mock_udmf.h" #include "test/mock/core/pipeline/mock_pipeline_context.h" #include "test/mock/core/render/mock_media_player.h" #include "test/mock/core/render/mock_render_context.h" #include "test/mock/core/common/mock_image_analyzer_manager.h" #include "test/mock/base/mock_task_executor.h" -#include "test/mock/core/common/mock_udmf.h" #include "base/geometry/ng/size_t.h" #include "base/json/json_util.h" @@ -238,7 +238,8 @@ HWTEST_F(VideoTestExtraAddNg, OnPlayerStatusTest001, TestSize.Level1) ASSERT_TRUE(playBtnGestureEventHub); // set videoEvent - auto videoEventHub = frameNode->GetOrCreateEventHub(); + // lizhan11@huawei.com 三个月前合入 + auto videoEventHub = frameNode->GetEventHub(); ASSERT_TRUE(videoEventHub); std::string startCheck; VideoEventCallback onStart = [&startCheck](const std::string& /* param */) { startCheck = VIDEO_START_EVENT; }; @@ -309,7 +310,8 @@ HWTEST_F(VideoTestExtraAddNg, OnPlayerStatusTest002, TestSize.Level1) auto playBtnGestureEventHub = playBtn->GetOrCreateGestureEventHub(); // set videoEvent - auto videoEventHub2 = frameNode->GetOrCreateEventHub(); + // lizhan11@huawei.com 三个月前合入 + auto videoEventHub2 = frameNode->GetEventHub(); ASSERT_TRUE(videoEventHub2); std::string startCheck; VideoEventCallback onStart = [&startCheck](const std::string& /* param */) { startCheck = VIDEO_START_EVENT; }; @@ -381,7 +383,8 @@ HWTEST_F(VideoTestExtraAddNg, OnPlayerStatusTest003, TestSize.Level1) auto playBtnGestureEventHub = playBtn->GetOrCreateGestureEventHub(); // set videoEvent - auto videoEventHub3 = frameNode->GetOrCreateEventHub(); + // lizhan11@huawei.com 三个月前合入 + auto videoEventHub3 = frameNode->GetEventHub(); std::string startCheck; VideoEventCallback onStart = [&startCheck](const std::string& /* param */) { startCheck = VIDEO_START_EVENT; }; std::string pauseCheck; @@ -453,7 +456,8 @@ HWTEST_F(VideoTestExtraAddNg, OnPlayerStatusTest004, TestSize.Level1) auto playBtnGestureEventHub = playBtn->GetOrCreateGestureEventHub(); // set videoEvent - auto videoEventHub4 = frameNode->GetOrCreateEventHub(); + // lizhan11@huawei.com 三个月前合入 + auto videoEventHub4 = frameNode->GetEventHub(); std::string startCheck; VideoEventCallback onStart = [&startCheck](const std::string& /* param */) { startCheck = VIDEO_START_EVENT; }; std::string pauseCheck; @@ -526,7 +530,8 @@ HWTEST_F(VideoTestExtraAddNg, OnPlayerStatusTest005, TestSize.Level1) auto playBtnGestureEventHub = playBtn->GetOrCreateGestureEventHub(); // set videoEvent - auto videoEventHub5 = frameNode->GetOrCreateEventHub(); + // lizhan11@huawei.com 三个月前合入 + auto videoEventHub5 = frameNode->GetEventHub(); std::string startCheck; VideoEventCallback onStart = [&startCheck](const std::string& /* param */) { startCheck = VIDEO_START_EVENT; }; std::string pauseCheck; @@ -605,7 +610,8 @@ HWTEST_F(VideoTestExtraAddNg, VideoPatternTest006, TestSize.Level1) ASSERT_TRUE(playBtnGestureEventHub); // set videoEvent - auto videoEventHub = frameNode->GetOrCreateEventHub(); + // lizhan11@huawei.com 三个月前合入 + auto videoEventHub = frameNode->GetEventHub(); ASSERT_TRUE(videoEventHub); std::string startCheck; VideoEventCallback onStart = [&startCheck](const std::string& /* param */) { startCheck = VIDEO_START_EVENT; }; @@ -680,7 +686,6 @@ HWTEST_F(VideoTestExtraAddNg, OnDirtyLayoutWrapperSwap001, TestSize.Level1) ASSERT_NE(frameNode, nullptr); auto videoPattern = AceType::DynamicCast(frameNode->GetPattern()); ASSERT_NE(videoPattern, nullptr); - DirtySwapConfig config; config.skipMeasure = false; auto geometryNode = AceType::MakeRefPtr(); diff --git a/test/unittest/interfaces/xcomponent_controller_test.cpp b/test/unittest/interfaces/xcomponent_controller_test.cpp index c4c552c2e7a..a644596ed36 100644 --- a/test/unittest/interfaces/xcomponent_controller_test.cpp +++ b/test/unittest/interfaces/xcomponent_controller_test.cpp @@ -70,14 +70,16 @@ HWTEST_F(XComponentControllerTest, SetRenderFitBySurfaceIdErrorCodeTest, TestSiz std::string surfaceId = SURFACE_ID; int32_t renderFitNumberInvalid = -1; auto code = XComponentController::SetRenderFitBySurfaceId(surfaceId, renderFitNumberInvalid, true); - EXPECT_NE(code, 0); + // 东升哥两月前合入 + EXPECT_TRUE(code != 0); /** * @tc.step2: Test SetRenderFitBySurfaceId when renderFitNumber is larger than fifteen. * @tc.expected: the error code indicates parameter invalid or load ace lib failed. */ renderFitNumberInvalid = 16; code = XComponentController::SetRenderFitBySurfaceId(surfaceId, renderFitNumberInvalid, true); - EXPECT_NE(code, 0); + // 东升哥两月前合入 + EXPECT_TRUE(code != 0); } /** @@ -95,23 +97,24 @@ HWTEST_F(XComponentControllerTest, GetRenderFitBySurfaceIdErrorCodeTest, TestSiz int32_t renderFitNumber = -1; bool isEnable = false; auto code = XComponentController::GetRenderFitBySurfaceId(surfaceId, renderFitNumber, isEnable); - EXPECT_NE(code, 0); -} - -/** - * @tc.name: GetSurfaceRotationBySurfaceIdErrorCodeTest - * @tc.desc: Test XComponentController::GetSurfaceRotationBySurfaceId function with invalid input. - * @tc.type: FUNC - */ -HWTEST_F(XComponentControllerTest, GetSurfaceRotationBySurfaceIdErrorCodeTest, TestSize.Level1) -{ - /** - * @tc.step1: Test GetSurfaceRotationBySurfaceId when surfaceId is invalid. - * @tc.expected: the error code indicates parameter invalid or load ace lib failed. - */ - std::string surfaceId = ""; - bool isSurfaceLock = false; - auto code = XComponentController::GetSurfaceRotationBySurfaceId(surfaceId, isSurfaceLock); - EXPECT_NE(code, 0); + // 东升哥两月前合入 + EXPECT_TRUE(code != 0); } +// 管斌老师三天前合入 +// /** +// * @tc.name: GetSurfaceRotationBySurfaceIdErrorCodeTest +// * @tc.desc: Test XComponentController::GetSurfaceRotationBySurfaceId function with invalid input. +// * @tc.type: FUNC +// */ +// HWTEST_F(XComponentControllerTest, GetSurfaceRotationBySurfaceIdErrorCodeTest, TestSize.Level1) +// { +// /** +// * @tc.step1: Test GetSurfaceRotationBySurfaceId when surfaceId is invalid. +// * @tc.expected: the error code indicates parameter invalid or load ace lib failed. +// */ +// std::string surfaceId = ""; +// bool isSurfaceLock = false; +// auto code = XComponentController::GetSurfaceRotationBySurfaceId(surfaceId, isSurfaceLock); +// EXPECT_NE(code, 0); +// } } // namespace OHOS::Ace -- Gitee