- mColor = texture;
- AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
+ if( ( texture->GetWidth() / ( 1u << mipmapLevel ) == mWidth ) &&
+ ( texture->GetHeight() / ( 1u << mipmapLevel ) == mHeight ) )
+ {
+ mColor = texture;
+ AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer );
+ }
+ else
+ {
+ DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Size mismatch \n" );
+ }
+ }
+}
+
+Texture* FrameBuffer::GetColorTexture()
+{
+ return mIsSurfaceBacked ? nullptr : mColor.Get();
+}
+
+void FrameBuffer::SetSize( uint32_t width, uint32_t height )
+{
+ mWidth = width;
+ mHeight = height;
+
+ if( mRenderObject->IsSurfaceBacked() )
+ {
+ SetFrameBufferSizeMessage( mEventThreadServices.GetUpdateManager(), static_cast<Render::SurfaceFrameBuffer*>( mRenderObject ), width, height );
+ }
+}
+
+void FrameBuffer::SetBackgroundColor( const Vector4& color )
+{
+ if( mRenderObject->IsSurfaceBacked() )
+ {
+ SetFrameBufferBackgroundColorMessage( mEventThreadServices.GetUpdateManager(), static_cast<Render::SurfaceFrameBuffer*>( mRenderObject ), color );