X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Frender%2Fcommon%2Frender-manager.cpp;h=e878e8a0e815b32b7eeb54692cefced79b25646b;hb=1909fcea2d2b1ff3adfdf16d4630a01e2190085c;hp=fbad2b303ad769acdbfb0f8ee70ddc899c1100ad;hpb=81e1315dc54867f504c974e64b04bfdd03d7977f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index fbad2b3..e878e8a 100755 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -112,7 +112,6 @@ struct RenderManager::Impl renderQueue(), instructions(), renderAlgorithms(), - backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ), frameCount( 0u ), renderBufferIndex( SceneGraphBuffers::INITIAL_UPDATE_BUFFER_INDEX ), defaultSurfaceRect(), @@ -182,8 +181,6 @@ struct RenderManager::Impl RenderInstructionContainer instructions; Render::RenderAlgorithms renderAlgorithms; ///< The RenderAlgorithms object is used to action the renders required by a RenderInstruction - Vector4 backgroundColor; ///< The glClear color used at the beginning of each frame. - uint32_t frameCount; ///< The current frame count BufferIndex renderBufferIndex; ///< The index of the buffer to read from; this is opposite of the "update" buffer @@ -288,11 +285,6 @@ RenderInstructionContainer& RenderManager::GetRenderInstructionContainer() return mImpl->instructions; } -void RenderManager::SetBackgroundColor( const Vector4& color ) -{ - mImpl->backgroundColor = color; -} - void RenderManager::SetDefaultSurfaceRect(const Rect& rect) { mImpl->defaultSurfaceRect = rect; @@ -727,7 +719,6 @@ void RenderManager::DoRender( RenderInstruction& instruction ) Rect surfaceRect = mImpl->defaultSurfaceRect; int surfaceOrientation = mImpl->defaultSurfaceOrientation; - Vector4 backgroundColor = mImpl->backgroundColor; Integration::DepthBufferAvailable depthBufferAvailable = mImpl->depthBufferAvailable; Integration::StencilBufferAvailable stencilBufferAvailable = mImpl->stencilBufferAvailable; Integration::PartialUpdateAvailable partialUpdateAvailable = mImpl->partialUpdateAvailable; @@ -760,7 +751,6 @@ void RenderManager::DoRender( RenderInstruction& instruction ) } surfaceRect = Rect( 0, 0, static_cast( surfaceFrameBuffer->GetWidth() ), static_cast( surfaceFrameBuffer->GetHeight() ) ); - backgroundColor = surfaceFrameBuffer->GetBackgroundColor(); } else { @@ -788,7 +778,10 @@ void RenderManager::DoRender( RenderInstruction& instruction ) { // For each offscreen buffer, update the dependency list with the new texture id used by this frame buffer. Render::TextureFrameBuffer* textureFrameBuffer = static_cast( instruction.mFrameBuffer ); - mImpl->textureDependencyList.PushBack( textureFrameBuffer->GetTextureId() ); + for (unsigned int i0 = 0, i1 = textureFrameBuffer->GetColorAttachmentCount(); i0 < i1; ++i0) + { + mImpl->textureDependencyList.PushBack( textureFrameBuffer->GetTextureId(i0) ); + } } } else @@ -800,7 +793,6 @@ void RenderManager::DoRender( RenderInstruction& instruction ) if( surfaceFrameBuffer && partialUpdateAvailable == Integration::PartialUpdateAvailable::TRUE ) { - const RenderListContainer::SizeType renderListCount = instruction.RenderListCount(); // Iterate through each render list. if( surfaceFrameBuffer->IsPartialUpdateEnabled() ) { @@ -829,32 +821,16 @@ void RenderManager::DoRender( RenderInstruction& instruction ) if ( surfaceFrameBuffer ) { - mImpl->currentContext->Viewport( surfaceRect.x, - surfaceRect.y, - surfaceRect.width, - surfaceRect.height ); - - - mImpl->currentContext->ClearColor( backgroundColor.r, - backgroundColor.g, - backgroundColor.b, - backgroundColor.a ); + mImpl->currentContext->Viewport( surfaceRect.x, + surfaceRect.y, + surfaceRect.width, + surfaceRect.height ); } // Clear the entire color, depth and stencil buffers for the default framebuffer, if required. // It is important to clear all 3 buffers when they are being used, for performance on deferred renderers // e.g. previously when the depth & stencil buffers were NOT cleared, it caused the DDK to exceed a "vertex count limit", // and then stall. That problem is only noticeable when rendering a large number of vertices per frame. - if( isPartialUpdate ) - { - mImpl->currentContext->SetScissorTest( true ); - mImpl->currentContext->Scissor( scissorBox.x, scissorBox.y, scissorBox.width, scissorBox.height ); - } - else - { - mImpl->currentContext->SetScissorTest( false ); - } - GLbitfield clearMask = GL_COLOR_BUFFER_BIT; mImpl->currentContext->ColorMask( true ); @@ -872,14 +848,6 @@ void RenderManager::DoRender( RenderInstruction& instruction ) clearMask |= GL_STENCIL_BUFFER_BIT; } - mImpl->currentContext->Clear( clearMask, Context::FORCE_CLEAR ); - - if( isPartialUpdate ) - { - mImpl->currentContext->SetScissorTest( false ); - } - - if( !instruction.mIgnoreRenderToFbo && ( instruction.mFrameBuffer != 0 ) ) { if ( instruction.mFrameBuffer->IsSurfaceBacked() ) // Surface rendering @@ -933,6 +901,17 @@ void RenderManager::DoRender( RenderInstruction& instruction ) } } + bool clearFullFrameRect = true; + if( instruction.mFrameBuffer != 0 ) + { + Viewport frameRect( 0, 0, instruction.mFrameBuffer->GetWidth(), instruction.mFrameBuffer->GetHeight() ); + clearFullFrameRect = ( frameRect == viewportRect ); + } + else + { + clearFullFrameRect = ( surfaceRect == viewportRect ); + } + if ( surfaceOrientation == 90 || surfaceOrientation == 270 ) { int temp = viewportRect.width; @@ -942,27 +921,33 @@ void RenderManager::DoRender( RenderInstruction& instruction ) mImpl->currentContext->Viewport(viewportRect.x, viewportRect.y, viewportRect.width, viewportRect.height); - if ( instruction.mIsClearColorSet ) + if( instruction.mIsClearColorSet ) { mImpl->currentContext->ClearColor( clearColor.r, clearColor.g, clearColor.b, clearColor.a ); - // Clear the viewport area only - mImpl->currentContext->SetScissorTest( true ); - if( isPartialUpdate ) + if( !clearFullFrameRect ) { - intersectRect = IntersectAABB( scissorBox, viewportRect ); - mImpl->currentContext->Scissor( intersectRect.x, intersectRect.y, intersectRect.width, intersectRect.height ); + mImpl->currentContext->SetScissorTest( true ); + if( isPartialUpdate ) + { + intersectRect = IntersectAABB( scissorBox, viewportRect ); + mImpl->currentContext->Scissor( intersectRect.x, intersectRect.y, intersectRect.width, intersectRect.height ); + } + else + { + mImpl->currentContext->Scissor( viewportRect.x, viewportRect.y, viewportRect.width, viewportRect.height ); + } + mImpl->currentContext->Clear( clearMask, Context::FORCE_CLEAR ); + mImpl->currentContext->SetScissorTest( false ); } else { - mImpl->currentContext->Scissor( viewportRect.x, viewportRect.y, viewportRect.width, viewportRect.height ); + mImpl->currentContext->SetScissorTest( false ); + mImpl->currentContext->Clear( clearMask, Context::FORCE_CLEAR ); } - mImpl->currentContext->ColorMask( true ); - mImpl->currentContext->Clear( GL_COLOR_BUFFER_BIT , Context::CHECK_CACHED_VALUES ); - mImpl->currentContext->SetScissorTest( false ); } // Clear the list of bound textures