From: adam.b Date: Thu, 1 Oct 2020 14:11:54 +0000 (+0100) Subject: skipping the render items outside of the partial rendering merged area. X-Git-Tag: dali_1.9.33~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F245101%2F2;p=platform%2Fcore%2Fuifw%2Fdali-core.git skipping the render items outside of the partial rendering merged area. Change-Id: I7a9019fc75600f71a5580c4a4956b6324399a2a3 --- diff --git a/dali/internal/render/common/render-algorithms.cpp b/dali/internal/render/common/render-algorithms.cpp index f5d540c79..d40614c09 100755 --- a/dali/internal/render/common/render-algorithms.cpp +++ b/dali/internal/render/common/render-algorithms.cpp @@ -442,6 +442,22 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList, { const RenderItem& item = renderList.GetItem( index ); + // Discard renderers outside the root clipping rect + bool skip = true; + if( !rootClippingRect.IsEmpty() ) + { + auto rect = item.CalculateViewportSpaceAABB( item.mUpdateSize, mViewportRectangle.width, mViewportRectangle.height ); + + if(rect.Intersect( rootClippingRect )) + { + skip = false; + } + } + else + { + skip = false; + } + DALI_PRINT_RENDER_ITEM( item ); // Set up clipping based on both the Renderer and Actor APIs. @@ -455,9 +471,9 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList, // draw-mode state, such as Overlays. // If the flags are set to "AUTO", the behavior then depends on the type of renderer. Overlay Renderers will always // disable depth testing and writing. Color Renderers will enable them if the Layer does. - if( depthBufferAvailable == Integration::DepthBufferAvailable::TRUE ) + if (depthBufferAvailable == Integration::DepthBufferAvailable::TRUE) { - SetupDepthBuffer( item, context, autoDepthTestMode, firstDepthBufferUse ); + SetupDepthBuffer(item, context, autoDepthTestMode, firstDepthBufferUse); } // Depending on whether the renderer has draw commands attached or not the rendering process will @@ -465,12 +481,15 @@ inline void RenderAlgorithms::ProcessRenderList( const RenderList& renderList, // iteration must be done and the default behaviour of the renderer will be executed. // The queues allow to iterate over the same renderer multiple times changing the state of the renderer. // It is similar to the multi-pass rendering. - auto const MAX_QUEUE = item.mRenderer->GetDrawCommands().empty() ? 1 : DevelRenderer::RENDER_QUEUE_MAX; - for( auto queue = 0u; queue < MAX_QUEUE; ++queue ) + if( !skip ) { - // Render the item. - item.mRenderer->Render(context, bufferIndex, *item.mNode, item.mModelMatrix, item.mModelViewMatrix, - viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque, boundTextures, instruction, queue); + auto const MAX_QUEUE = item.mRenderer->GetDrawCommands().empty() ? 1 : DevelRenderer::RENDER_QUEUE_MAX; + for (auto queue = 0u; queue < MAX_QUEUE; ++queue) + { + // Render the item. + item.mRenderer->Render(context, bufferIndex, *item.mNode, item.mModelMatrix, item.mModelViewMatrix, + viewMatrix, projectionMatrix, item.mSize, !item.mIsOpaque, boundTextures, instruction, queue); + } } } }