X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Frenderers%2Frender-surface-frame-buffer.h;h=e08666c09b1f605de3ee38098c3ebca78ec69fd4;hb=0a68c62785eaa442cfa213157431d6f2c9b37033;hp=576ea65e59604dd1351b7e658c377ef963c7b19e;hpb=01e3acfab09737f49135fa314a03c2460bcf79dc;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 index 576ea65..e08666c 100644 --- 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,43 +86,65 @@ public: */ bool IsSurfaceBacked() override { return true; }; -public: + /** + * @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 ); /** - * Called after this frame buffer is rendered in the render manager + * @copydoc Dali::Internal::FrameBuffer::MarkSurfaceAsInvalid() */ - void PostRender(); + void MarkSurfaceAsInvalid() { mIsSurfaceInvalid = true; }; /** - * Gets the context holding the GL state of rendering for the surface - * @return the context + * @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 */ - Context* GetContext(); + bool IsSurfaceValid() const; + +public: /** - * @brief Gets whether the depth buffer is required - * @return TRUE if the depth buffer is required + * Called after this frame buffer is rendered in the render manager */ - Integration::DepthBufferAvailable GetDepthBufferRequired(); + void PostRender(); /** - * @brief Gets whether the stencil buffer is required - * @return TRUE if the stencil buffer is required + * Gets the context holding the GL state of rendering for the surface + * @return the context */ - Integration::StencilBufferAvailable GetStencilBufferRequired(); + Context* GetContext(); /** - * @brief Gets the background color of the surface. - * @return The background color + * @brief Makes the graphics context current */ - Vector4 GetBackgroundColor(); + void MakeContextCurrent(); 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; + bool mSizeChanged; + std::atomic mIsSurfaceInvalid; ///< This is set only from the event thread and read only from the render thread }; +// 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 ); +} } // namespace Render