X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Frendering%2Fframe-buffer-impl.h;h=16c61f5d0d463d6738f24185b6c9c30b21396bbe;hb=55827866fcb8c7ee47581ac4335a3390472090e8;hp=8b0f7762294f67fc973c283653258768bd453afe;hpb=e72a3bcda27e5c2af336b1c7cf4a6d5090720e11;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/rendering/frame-buffer-impl.h b/dali/internal/event/rendering/frame-buffer-impl.h old mode 100644 new mode 100755 index 8b0f776..16c61f5 --- a/dali/internal/event/rendering/frame-buffer-impl.h +++ b/dali/internal/event/rendering/frame-buffer-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_FRAME_BUFFER_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -28,6 +28,12 @@ namespace Dali { + +namespace Integration +{ +class RenderSurface; +} + namespace Internal { namespace Render @@ -42,6 +48,8 @@ class FrameBuffer : public BaseObject { public: + using Mask = Dali::FrameBuffer::Attachment::Mask; + /** * @brief Create a new FrameBuffer * @@ -50,7 +58,21 @@ public: * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask) * @return A smart-pointer to the newly allocated Texture. */ - static FrameBufferPtr New( unsigned int width, unsigned int height, unsigned int attachments ); + static FrameBufferPtr New( uint32_t width, uint32_t height, Mask attachments ); + + /** + * @brief Create a new FrameBuffer + * + * @param[in] renderSurface The render surface + * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask) + * @return A smart-pointer to the newly allocated Texture. + */ + static FrameBufferPtr New( Dali::Integration::RenderSurface& renderSurface, Mask attachments ); + + /** + * A reference counted object may only be deleted by calling Unreference() + */ + virtual ~FrameBuffer(); /** * @brief Get the FrameBuffer render object @@ -62,13 +84,42 @@ public: /** * @copydoc Dali::FrameBuffer::AttachColorTexture() */ - void AttachColorTexture( TexturePtr texture, unsigned int mipmapLevel, unsigned int layer ); + void AttachColorTexture( TexturePtr texture, uint32_t mipmapLevel, uint32_t layer ); /** * @copydoc Dali::FrameBuffer::GetColorTexture() */ Texture* GetColorTexture(); + /** + * @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 ); + + /** + * @brief Mark the render surface as invalid + * + * The render surface is maked as invalid when it is deleted. + * + * @note Only for FrameBuffer backed by a render surface. + * @return True if the FrameBuffer is backed by a render surface + */ + void MarkSurfaceAsInvalid(); + + /** + * @brief Sets whether partial update is required for partial update + * @param[in] value whether partial update or not + */ + void SetPartialUpdateEnabled( bool value ); + private: // implementation /** @@ -77,23 +128,20 @@ private: // implementation * @param[in] height The height of the FrameBuffer * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask) */ - FrameBuffer( unsigned int width, unsigned int height, unsigned int attachments ); + FrameBuffer( uint32_t width, uint32_t height, Mask attachments ); /** * Second stage initialization of the Texture */ - void Initialize(); + void Initialize( Integration::RenderSurface* renderSurface = nullptr ); protected: - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~FrameBuffer(); - private: // unimplemented methods - FrameBuffer( const FrameBuffer& ); - FrameBuffer& operator=( const FrameBuffer& ); + + FrameBuffer() = delete; + FrameBuffer( const FrameBuffer& ) = delete; + FrameBuffer& operator=( const FrameBuffer& ) = delete; private: // data @@ -101,9 +149,11 @@ private: // data Internal::Render::FrameBuffer* mRenderObject; ///< The Render::Texture associated to this texture TexturePtr mColor; - unsigned int mWidth; - unsigned int mHeight; - unsigned int mAttachments; ///< Bit-mask of type FrameBuffer::Attachment::Mask + uint32_t mWidth; + uint32_t mHeight; + Mask mAttachments; ///< Bit-mask of type FrameBuffer::Attachment::Mask + + bool mIsSurfaceBacked:1; };