X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-render-surface.h;h=6f982e414b6d7274d2089ab4e0e32384fcb809b1;hb=a67bddb9946a20e3eed7d71ade2ed8b20eccdf38;hp=bc036111a3910897ae82ac73a4da07a5fa255acf;hpb=49c6702fb2d9dcdb0b4aeaf5b402450c6bbc0627;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-render-surface.h b/dali/internal/window-system/common/window-render-surface.h index bc03611..6f982e4 100644 --- a/dali/internal/window-system/common/window-render-surface.h +++ b/dali/internal/window-system/common/window-render-surface.h @@ -21,11 +21,14 @@ // EXTERNAL INCLUDES #include #include +#include +#include // INTERNAL INCLUDES #include #include #include +#include namespace Dali { @@ -215,6 +218,18 @@ private: */ void ProcessRotationRequest(); + /** + * @brief Used as the callback for the frame rendered / presented. + */ + void ProcessFrameCallback(); + + /** + * @brief Called when our event file descriptor has been written to. + * @param[in] eventBitMask bit mask of events that occured on the file descriptor + * @param[in] fileDescriptor The file descriptor + */ + void OnFileDescriptorEventDispatched( FileDescriptorMonitor::EventType eventBitMask, int fileDescriptor ); + protected: // Undefined @@ -223,6 +238,36 @@ protected: // Undefined WindowRenderSurface& operator=(const WindowRenderSurface& rhs) = delete; +private: + + struct FrameCallbackInfo + { + FrameCallbackInfo( Dali::Integration::Scene::FrameCallbackContainer& callbackList, int fd ) + : callbacks(), + fileDescriptorMonitor(), + fileDescriptor( fd ) + { + // Transfer owership of the CallbackBase + for( auto&& iter : callbackList ) + { + callbacks.push_back( std::make_pair( std::move( iter.first ), iter.second ) ); + } + } + + ~FrameCallbackInfo() + { + // Delete FileDescriptorMonitor before close fd. + fileDescriptorMonitor.release(); + close( fileDescriptor ); + } + + Dali::Integration::Scene::FrameCallbackContainer callbacks; + std::unique_ptr< FileDescriptorMonitor > fileDescriptorMonitor; + int fileDescriptor; + }; + + using FrameCallbackInfoContainer = std::vector< std::unique_ptr< FrameCallbackInfo > >; + private: // Data EglInterface* mEGL; @@ -232,11 +277,13 @@ private: // Data ThreadSynchronizationInterface* mThreadSynchronization; TriggerEventInterface* mRenderNotification; ///< Render notification trigger TriggerEventInterface* mRotationTrigger; + std::unique_ptr< TriggerEventInterface > mFrameRenderedTrigger; GraphicsInterface* mGraphics; ///< Graphics interface EGLSurface mEGLSurface; EGLContext mEGLContext; ColorDepth mColorDepth; ///< Color depth of surface (32 bit or 24 bit) OutputSignalType mOutputTransformedSignal; + FrameCallbackInfoContainer mFrameCallbackInfoContainer; int mRotationAngle; int mScreenRotationAngle; bool mOwnSurface; ///< Whether we own the surface (responsible for deleting it)