X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Frenderers%2Frender-surface-frame-buffer.h;h=fa7128915678670ade81e93116a6c3db8d915b69;hb=286c5b28462df9d19bba639d4a0b7bba37e2d021;hp=576ea65e59604dd1351b7e658c377ef963c7b19e;hpb=2ecd4fa47f0f90ff8679460fe35b433a09d45b47;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/renderers/render-surface-frame-buffer.h b/dali/internal/render/renderers/render-surface-frame-buffer.h old mode 100644 new mode 100755 index 576ea65..fa71289 --- a/dali/internal/render/renderers/render-surface-frame-buffer.h +++ b/dali/internal/render/renderers/render-surface-frame-buffer.h @@ -17,7 +17,11 @@ * limitations under the License. */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES +#include #include #include @@ -82,6 +86,31 @@ public: */ bool IsSurfaceBacked() override { return true; }; + /** + * @brief Sets the frame buffer size. + * @param[in] width The width size + * @param[in] height The height size + */ + void SetSize( uint32_t width, uint32_t height ); + + /** + * @brief Sets the background color. + * @param[in] color The new background color + */ + void SetBackgroundColor( const Vector4& color ); + + /** + * @copydoc Dali::Internal::FrameBuffer::MarkSurfaceAsInvalid() + */ + void MarkSurfaceAsInvalid() { mIsSurfaceInvalid = true; }; + + /** + * @brief Gets whether the render surface in this frame buffer is valid or not + * @note The render surface becomes invalid when it is deleted in the event thread + * @return Whether the render surface is valid or not + */ + bool IsSurfaceValid() const; + public: /** @@ -96,16 +125,9 @@ public: Context* GetContext(); /** - * @brief Gets whether the depth buffer is required - * @return TRUE if the depth buffer is required + * @brief Makes the graphics context current */ - Integration::DepthBufferAvailable GetDepthBufferRequired(); - - /** - * @brief Gets whether the stencil buffer is required - * @return TRUE if the stencil buffer is required - */ - Integration::StencilBufferAvailable GetStencilBufferRequired(); + void MakeContextCurrent(); /** * @brief Gets the background color of the surface. @@ -113,12 +135,71 @@ public: */ Vector4 GetBackgroundColor(); + /** + * @brief Sets currentframe updated/damaged rects + * @return merged update rects + */ + Rect SetDamagedRect( const Rect& damagedRect ); + + /** + * @brief Gets whether partial update is required for partial update + * @return whether partial update or not + */ + bool IsPartialUpdateEnabled() const; + + /** + * @brief Sets whether partial update is required for partial update + * @param[in] value whether partial update or not + */ + void SetPartialUpdateEnabled( bool value ); + private: Integration::RenderSurface* mSurface; ///< The render surface Context* mContext; ///< The context holding the GL state of rendering for the surface backed frame buffer + + uint32_t mWidth; + uint32_t mHeight; + Vector4 mBackgroundColor; + bool mSizeChanged; + bool mBackgroundColorChanged; + std::atomic mIsSurfaceInvalid; ///< This is set only from the event thread and read only from the render thread + bool mPartialUpdateEnabled; ///< This value is whether partial update is required }; +// Messages for FrameBuffer +inline void SetFrameBufferSizeMessage( SceneGraph::UpdateManager& updateManager, SurfaceFrameBuffer* surfaceFrameBuffer, uint32_t width, uint32_t height ) +{ + typedef MessageValue2< SurfaceFrameBuffer, uint32_t, uint32_t > LocalType; + + // Reserve some memory inside the message queue + uint32_t* slot = updateManager.ReserveMessageSlot( sizeof( LocalType ) ); + + // Construct message in the message queue memory; note that delete should not be called on the return value + new (slot) LocalType( surfaceFrameBuffer, &SurfaceFrameBuffer::SetSize, width, height ); +} + +inline void SetFrameBufferBackgroundColorMessage( SceneGraph::UpdateManager& updateManager, SurfaceFrameBuffer* surfaceFrameBuffer, const Vector4& color ) +{ + typedef MessageValue1< SurfaceFrameBuffer, Vector4 > LocalType; + + // Reserve some memory inside the message queue + uint32_t* slot = updateManager.ReserveMessageSlot( sizeof( LocalType ) ); + + // Construct message in the message queue memory; note that delete should not be called on the return value + new (slot) LocalType( surfaceFrameBuffer, &SurfaceFrameBuffer::SetBackgroundColor, color ); +} + +inline void SetFrameBufferPartialUpdateMessage( SceneGraph::UpdateManager& updateManager, SurfaceFrameBuffer* surfaceFrameBuffer, bool value ) +{ + typedef MessageValue1< SurfaceFrameBuffer, bool > LocalType; + + // Reserve some memory inside the message queue + uint32_t* slot = updateManager.ReserveMessageSlot( sizeof( LocalType ) ); + + // Construct message in the message queue memory; note that delete should not be called on the return value + new (slot) LocalType( surfaceFrameBuffer, &SurfaceFrameBuffer::SetPartialUpdateEnabled, value ); +} } // namespace Render