From: Jaehyun Cho Date: Mon, 20 Dec 2021 09:35:53 +0000 (+0900) Subject: Merge branch 'devel/master' into tizen X-Git-Tag: accepted/tizen/unified/20211222.230343~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de73962a3145b6624f436dc9dd6a138dd346ee91;hp=0db9bb9e1353273f98444ccf30e2f8549256422b;p=platform%2Fcore%2Fuifw%2Fdali-core.git Merge branch 'devel/master' into tizen --- diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index b9f8dba..5293137 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -8595,6 +8595,31 @@ int utcDaliActorPartialUpdateTwoActors(void) DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + // Change a Renderer of actor1 + Geometry geometry = CreateQuadGeometry(); + Shader shader = CreateShader(); + Renderer newRenderer = Renderer::New(geometry, shader); + Renderer renderer = actor.GetRendererAt(0); + + actor.RemoveRenderer(renderer); + actor.AddRenderer(newRenderer); + + damagedRects.clear(); + + application.SendNotification(); + application.PreRenderWithPartialUpdate(TestApplication::DEFAULT_RENDER_INTERVAL, nullptr, damagedRects); + + DALI_TEST_CHECK(damagedRects.size() > 0); + DALI_TEST_EQUALS>(Rect(64, 672, 64, 64), damagedRects[0], TEST_LOCATION); + + // in screen coordinates, adaptor would calculate it using previous frames information + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION); + DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION); + END_TEST; } diff --git a/dali/internal/event/common/scene-impl.cpp b/dali/internal/event/common/scene-impl.cpp index 7994cdf..ba88152 100644 --- a/dali/internal/event/common/scene-impl.cpp +++ b/dali/internal/event/common/scene-impl.cpp @@ -420,11 +420,6 @@ Integration::Scene::WheelEventSignalType& Scene::WheelEventSignal() return mWheelEventSignal; } -std::vector& Scene::GetItemsDirtyRects() -{ - return mItemsDirtyRects; -} - } // namespace Internal } // namespace Dali diff --git a/dali/internal/event/common/scene-impl.h b/dali/internal/event/common/scene-impl.h index 7065c16..34ab1a8 100644 --- a/dali/internal/event/common/scene-impl.h +++ b/dali/internal/event/common/scene-impl.h @@ -38,63 +38,9 @@ struct Event; namespace Internal { -//@todo Break this dependence somehow. -namespace Render -{ -class Renderer; -} - namespace SceneGraph { class Scene; - -struct DirtyRect -{ - DirtyRect(Node* node, Render::Renderer* renderer, int32_t frame, Rect& rect) - : node(node), - renderer(renderer), - frame(frame), - rect(rect), - visited(true) - { - } - - DirtyRect() - : node(nullptr), - renderer(nullptr), - frame(0), - rect(), - visited(true) - { - } - - bool operator<(const DirtyRect& rhs) const - { - if(node == rhs.node) - { - if(renderer == rhs.renderer) - { - return frame > rhs.frame; // Most recent rects come first - } - else - { - return renderer < rhs.renderer; - } - } - else - { - return node < rhs.node; - } - } - - Node* node; - Render::Renderer* renderer; - int32_t frame; - - Rect rect; - bool visited; -}; - } // namespace SceneGraph class EventProcessor; @@ -351,13 +297,6 @@ public: */ Integration::Scene::WheelEventSignalType& WheelEventSignal(); - /** - * @brief Get ItemsDirtyRects - * - * @return the ItemsDirtyRects - */ - std::vector& GetItemsDirtyRects(); - public: /** * From RenderTaskDefaults; retrieve the default root actor. @@ -436,8 +375,6 @@ private: // The wheel event signal Integration::Scene::WheelEventSignalType mWheelEventSignal; - - std::vector mItemsDirtyRects; }; } // namespace Internal diff --git a/dali/internal/event/size-negotiation/relayout-controller-impl.cpp b/dali/internal/event/size-negotiation/relayout-controller-impl.cpp index 622db16..fbf0411 100644 --- a/dali/internal/event/size-negotiation/relayout-controller-impl.cpp +++ b/dali/internal/event/size-negotiation/relayout-controller-impl.cpp @@ -125,7 +125,15 @@ RelayoutController::~RelayoutController() RelayoutController* RelayoutController::Get() { - return &ThreadLocalStorage::Get().GetRelayoutController(); + // There was crash when destroying actors and the ResizePolicy is USE_NATURAL_SIZE + // The ThreadLocalStorage::Get() only retrieve STL without checking if it exists. + // The caller of RelayoutController::Get() should check if RelayoutController is not null. + if(ThreadLocalStorage::Created()) + { + return &ThreadLocalStorage::Get().GetRelayoutController(); + } + + return nullptr; } void RelayoutController::QueueActor(Internal::Actor* actor, RelayoutContainer& actors, Vector2 size) diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index 2d63a0a..3772183 100644 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -519,7 +519,7 @@ void RenderManager::PreRender(Integration::Scene& scene, std::vector>& // Mark previous dirty rects in the sorted array. The array is already sorted by node and renderer, frame number. // so you don't need to sort: std::stable_sort(itemsDirtyRects.begin(), itemsDirtyRects.end()); - std::vector& itemsDirtyRects = sceneInternal.GetItemsDirtyRects(); + std::vector& itemsDirtyRects = sceneObject->GetItemsDirtyRects(); for(DirtyRect& dirtyRect : itemsDirtyRects) { dirtyRect.visited = false; diff --git a/dali/internal/update/common/scene-graph-scene.cpp b/dali/internal/update/common/scene-graph-scene.cpp index 55e94c7..1ad1c93 100644 --- a/dali/internal/update/common/scene-graph-scene.cpp +++ b/dali/internal/update/common/scene-graph-scene.cpp @@ -178,10 +178,15 @@ void Scene::SetRotationCompletedAcknowledgement() bool Scene::IsRotationCompletedAcknowledgementSet() { bool setRotationCompletedAcknowledgement = mRotationCompletedAcknowledgement; - mRotationCompletedAcknowledgement = false; + mRotationCompletedAcknowledgement = false; return setRotationCompletedAcknowledgement; } +std::vector& Scene::GetItemsDirtyRects() +{ + return mItemsDirtyRects; +} + } // namespace SceneGraph } // namespace Internal diff --git a/dali/internal/update/common/scene-graph-scene.h b/dali/internal/update/common/scene-graph-scene.h index 14bcb08..f1f0f5a 100644 --- a/dali/internal/update/common/scene-graph-scene.h +++ b/dali/internal/update/common/scene-graph-scene.h @@ -30,9 +30,54 @@ namespace Dali { namespace Internal { +namespace Render +{ +class Renderer; +} + namespace SceneGraph { class RenderInstructionContainer; +class Node; + +struct DirtyRect +{ + DirtyRect(Node* node, Render::Renderer* renderer, int32_t frame, Rect& rect) + : node(node), + renderer(renderer), + frame(frame), + rect(rect), + visited(true) + { + } + + DirtyRect() = default; + + bool operator<(const DirtyRect& rhs) const + { + if(node == rhs.node) + { + if(renderer == rhs.renderer) + { + return frame > rhs.frame; // Most recent rects come first + } + else + { + return renderer < rhs.renderer; + } + } + else + { + return node < rhs.node; + } + } + + Node* node{nullptr}; + Render::Renderer* renderer{nullptr}; + int32_t frame{0}; + Rect rect{}; + bool visited{true}; +}; class Scene { @@ -213,6 +258,13 @@ public: return mClearValues; } + /** + * @brief Get ItemsDirtyRects + * + * @return the ItemsDirtyRects + */ + std::vector& GetItemsDirtyRects(); + private: // Render instructions describe what should be rendered during RenderManager::RenderScene() // Update manager updates instructions for the next frame while we render the current one @@ -224,9 +276,9 @@ private: bool mSkipRendering; ///< A flag to skip rendering - Rect mSurfaceRect; ///< The rectangle of surface which is related ot this scene. - int32_t mSurfaceOrientation; ///< The orientation of surface which is related of this scene - bool mSurfaceRectChanged; ///< The flag of surface's rectangle is changed when is resized, moved or rotated. + Rect mSurfaceRect; ///< The rectangle of surface which is related ot this scene. + int32_t mSurfaceOrientation; ///< The orientation of surface which is related of this scene + bool mSurfaceRectChanged; ///< The flag of surface's rectangle is changed when is resized, moved or rotated. bool mRotationCompletedAcknowledgement; ///< The flag of sending the acknowledgement to complete window rotation. // Render pass and render target @@ -240,8 +292,8 @@ private: Graphics::UniquePtr mRenderPassNoClear{nullptr}; ///< The render pass created to render the surface without clearing color Graphics::RenderTarget* mRenderTarget{nullptr}; ///< This is created in the event thread when surface is created/resized/replaced - // clear colors - std::vector mClearValues{}; + std::vector mClearValues{}; ///< Clear colors + std::vector mItemsDirtyRects{}; ///< Dirty rect list }; /// Messages diff --git a/dali/public-api/dali-core-version.cpp b/dali/public-api/dali-core-version.cpp index 77ff3e3..6bd15d3 100644 --- a/dali/public-api/dali-core-version.cpp +++ b/dali/public-api/dali-core-version.cpp @@ -27,7 +27,7 @@ namespace Dali { const uint32_t CORE_MAJOR_VERSION = 2; const uint32_t CORE_MINOR_VERSION = 1; -const uint32_t CORE_MICRO_VERSION = 2; +const uint32_t CORE_MICRO_VERSION = 3; const char* const CORE_BUILD_DATE = __DATE__ " " __TIME__; #ifdef DEBUG_ENABLED diff --git a/packaging/dali.spec b/packaging/dali.spec index 9026aef..63099d3 100644 --- a/packaging/dali.spec +++ b/packaging/dali.spec @@ -1,6 +1,6 @@ Name: dali2 Summary: DALi 3D Engine -Version: 2.1.2 +Version: 2.1.3 Release: 1 Group: System/Libraries License: Apache-2.0 and BSD-3-Clause and MIT