X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali%2Finternal%2Fevent%2Frendering%2Fframe-buffer-impl.cpp;h=1703fd7db03e010fe4c60cc43107a5d43d0dae8e;hb=0a68c62785eaa442cfa213157431d6f2c9b37033;hp=33afe3556c05a99e3d7e0ae2c93eaff6d9dc7086;hpb=6edec3983c52944fa34184430f8fce524ba175e8;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/rendering/frame-buffer-impl.cpp b/dali/internal/event/rendering/frame-buffer-impl.cpp index 33afe35..1703fd7 100644 --- a/dali/internal/event/rendering/frame-buffer-impl.cpp +++ b/dali/internal/event/rendering/frame-buffer-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -53,10 +53,11 @@ Render::FrameBuffer* FrameBuffer::GetRenderObject() const FrameBuffer::FrameBuffer( uint32_t width, uint32_t height, Mask attachments ) : mEventThreadServices( EventThreadServices::Get() ), mRenderObject( NULL ), - mColor( NULL ), + mColor{ nullptr }, mWidth( width ), mHeight( height ), mAttachments( attachments ), + mColorAttachmentCount( 0 ), mIsSurfaceBacked( false ) { } @@ -88,22 +89,28 @@ void FrameBuffer::AttachColorTexture( TexturePtr texture, uint32_t mipmapLevel, } else { - if( ( texture->GetWidth() / ( 1u << mipmapLevel ) == mWidth ) && - ( texture->GetHeight() / ( 1u << mipmapLevel ) == mHeight ) ) + if( ( texture->GetWidth() / ( 1u << mipmapLevel ) != mWidth ) || + ( texture->GetHeight() / ( 1u << mipmapLevel ) != mHeight ) ) { - mColor = texture; - AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer ); + DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Size mismatch \n" ); + } + else if ( mColorAttachmentCount >= Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS ) + { + DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Exceeded maximum supported color attachments.\n" ); } else { - DALI_LOG_ERROR( "Failed to attach color texture to FrameBuffer: Size mismatch \n" ); + mColor[mColorAttachmentCount] = texture; + ++mColorAttachmentCount; + + AttachColorTextureToFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject, texture->GetRenderObject(), mipmapLevel, layer ); } } } -Texture* FrameBuffer::GetColorTexture() +Texture* FrameBuffer::GetColorTexture(uint8_t index) const { - return mIsSurfaceBacked ? nullptr : mColor.Get(); + return ( mIsSurfaceBacked || index >= mColorAttachmentCount ) ? nullptr : mColor[index].Get(); } void FrameBuffer::SetSize( uint32_t width, uint32_t height ) @@ -117,14 +124,6 @@ void FrameBuffer::SetSize( uint32_t width, uint32_t height ) } } -void FrameBuffer::SetBackgroundColor( const Vector4& color ) -{ - if( mRenderObject->IsSurfaceBacked() ) - { - SetFrameBufferBackgroundColorMessage( mEventThreadServices.GetUpdateManager(), static_cast( mRenderObject ), color ); - } -} - void FrameBuffer::MarkSurfaceAsInvalid() { if ( mIsSurfaceBacked )