X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fscene-impl.h;h=67d08d542750e4164333c57913cccf3881e08ed8;hb=4be1d329142e23af0999f2362e101047c4628ad2;hp=2c93c84b13faebe6007649e8279fbd4110cae9c0;hpb=e2d69d69eb0dcdd6c0ad8f7faafb8b7115086e3c;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/scene-impl.h b/dali/internal/event/common/scene-impl.h old mode 100644 new mode 100755 index 2c93c84..67d08d5 --- a/dali/internal/event/common/scene-impl.h +++ b/dali/internal/event/common/scene-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -35,13 +34,66 @@ namespace Dali namespace Integration { -class Event; +struct Event; } namespace Internal { +namespace SceneGraph +{ +class Scene; + +struct DirtyRect +{ + DirtyRect(Node* node, Render::Renderer* renderer, int 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; + int frame; + + Rect rect; + bool visited; +}; + +} + class EventProcessor; class Layer; class LayerList; @@ -62,12 +114,12 @@ public: /** * @copydoc Dali::Integration::Scene::New */ - static ScenePtr New( Integration::RenderSurface& surface ); + static ScenePtr New( Size size ); /** * virtual destructor */ - virtual ~Scene(); + ~Scene() override; /** * @copydoc Dali::Integration::Scene::Add @@ -115,19 +167,17 @@ public: Dali::Layer GetLayer(uint32_t depth) const; /** - * @copydoc Dali::Integration::Scene::SetSurface - */ - void SetSurface( Integration::RenderSurface& surface ); - - /** * Notify the surface has been resized. + * + * @param[in] width The new width of the set surface + * @param[in] height The new height of the set surface */ - void SurfaceResized(); + void SurfaceResized( float width, float height ); /** - * Notify the surface has been deleted. + * @copydoc Dali::Integration::Scene::SurfaceReplaced */ - void SurfaceDeleted(); + void SurfaceReplaced(); /** * @copydoc Dali::Integration::Scene::Discard @@ -135,12 +185,6 @@ public: void Discard(); /** - * Retrieve the render surface the scene is binded to. - * @return The render surface. - */ - Integration::RenderSurface* GetSurface() const; - - /** * Retrieve the ordered list of on-scene layers. * @return The layer-list. */ @@ -181,10 +225,24 @@ public: Vector4 GetBackgroundColor() const; /** + * @brief Get the Scene scene graph object + * + * @return the Scene scene graph object + */ + SceneGraph::Scene* GetSceneObject() const; + + /** * Used by the EventProcessor to emit key event signals. * @param[in] event The key event. */ - void EmitKeyEventSignal(const KeyEvent& event); + void EmitKeyEventSignal(const Dali::KeyEvent& event); + + /** + * Used by the KeyEventProcessor to emit KeyEventGenerated signals. + * @param[in] event The key event. + * @return The return is true if KeyEvent is consumed, otherwise false. + */ + bool EmitKeyEventGeneratedSignal(const Dali::KeyEvent& event); /** * Emits the event processing finished signal. @@ -195,58 +253,81 @@ public: /** * Emits the touched signal. - * @param[in] touchEvent The touch event details (Old API). * @param[in] touch The touch event details. */ - void EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch ); + void EmitTouchedSignal( const Dali::TouchEvent& touch ); /** * Used by the EventProcessor to emit wheel event signals. * @param[in] event The wheel event. */ - void EmitWheelEventSignal( const WheelEvent& event ); + void EmitWheelEventSignal( const Dali::WheelEvent& event ); /** - * @copydoc Integration::Scene::KeyEventSignal() + * @copydoc Dali::Integration::Scene::AddFrameRenderedCallback */ - Integration::Scene::KeyEventSignalType& KeyEventSignal(); + void AddFrameRenderedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId ); /** - * @copydoc Integration::Scene::SignalEventProcessingFinished() + * @copydoc Dali::Integration::Scene::AddFramePresentedCallback */ - Integration::Scene::EventProcessingFinishedSignalType& EventProcessingFinishedSignal(); + void AddFramePresentedCallback( std::unique_ptr< CallbackBase > callback, int32_t frameId ); + + /** + * @copydoc Dali::Integration::Scene::GetFrameRenderedCallback + */ + void GetFrameRenderedCallback( Dali::Integration::Scene::FrameCallbackContainer& callbacks ); + + /** + * @copydoc Dali::Integration::Scene::GetFramePresentedCallback + */ + void GetFramePresentedCallback( Dali::Integration::Scene::FrameCallbackContainer& callbacks ); + + /** + * @copydoc Integration::Scene::KeyEventSignal() + */ + Integration::Scene::KeyEventSignalType& KeyEventSignal(); - // The touched signal, to support Stage touched signal, will be removed when deprecated in public Stage API - using TouchedSignalType = Signal< void (const TouchEvent&) >; + /** + * @copydoc Integration::Scene::KeyEventGeneratedSignal() + */ + Integration::Scene::KeyEventGeneratedSignalType& KeyEventGeneratedSignal(); /** - * Touched signal to support deprecated stage touched signal. + * @copydoc Integration::Scene::SignalEventProcessingFinished() */ - TouchedSignalType& TouchedSignal(); + Integration::Scene::EventProcessingFinishedSignalType& EventProcessingFinishedSignal(); /** - * @copydoc Integration::Scene::TouchSignal() + * @copydoc Integration::Scene::TouchedSignal() */ - Integration::Scene::TouchSignalType& TouchSignal(); + Integration::Scene::TouchEventSignalType& TouchedSignal(); /** * @copydoc Integration::Scene::sWheelEventSignal() */ Integration::Scene::WheelEventSignalType& WheelEventSignal(); + /** + * @brief Get ItemsDirtyRects + * + * @return the ItemsDirtyRects + */ + std::vector& GetItemsDirtyRects(); + public: /** * From RenderTaskDefaults; retrieve the default root actor. * @return The default root actor. */ - virtual Actor& GetDefaultRootActor(); + Actor& GetDefaultRootActor() override; /** * From RenderTaskDefaults; retrieve the default camera actor. * @return The default camera actor. */ - virtual CameraActor& GetDefaultCameraActor(); + CameraActor& GetDefaultCameraActor() override; private: @@ -255,8 +336,10 @@ private: /** * Second-phase constructor. + * + * @param[in] size The size of the set surface */ - void Initialize( Integration::RenderSurface& surface ); + void Initialize( Size size ); // Undefined Scene(const Scene&) = delete; @@ -265,7 +348,7 @@ private: Scene& operator=(const Scene& rhs) = delete; private: - Integration::RenderSurface* mSurface; + Internal::SceneGraph::Scene* mSceneObject; Size mSize; @@ -283,27 +366,24 @@ private: // The list of render-tasks IntrusivePtr mRenderTaskList; - // The frame buffer - FrameBufferPtr mFrameBuffer; - bool mDepthTreeDirty:1; ///< True if the depth tree needs recalculating EventProcessor mEventProcessor; // The key event signal Integration::Scene::KeyEventSignalType mKeyEventSignal; + Integration::Scene::KeyEventGeneratedSignalType mKeyEventGeneratedSignal; // The event processing finished signal Integration::Scene::EventProcessingFinishedSignalType mEventProcessingFinishedSignal; // The touch signal - Integration::Scene::TouchSignalType mTouchSignal; - - // The touched signal - TouchedSignalType mTouchedSignal; + Integration::Scene::TouchEventSignalType mTouchedSignal; // The wheel event signal Integration::Scene::WheelEventSignalType mWheelEventSignal; + + std::vector mItemsDirtyRects; }; } // Internal