From d30bed46e37dc9cd266d20729cc8a464ab53fb8b Mon Sep 17 00:00:00 2001 From: Ferran Sole Date: Mon, 28 Apr 2014 08:52:44 +0100 Subject: [PATCH] Fix bug when reusing renderlist on stencil renderers [Issue#] N/A [Problem] When reusing renderlists for stencil renderers, the stencil renderers are rendered in the color buffer sometimes. [Cause] When reusing a renderlist for stencil renderers the appropiate flags where not seted on the renderlist which causes this renderers to be rendered in the color buffer. [Solution] Added a function to reset the flags correctly for stencil renderlists as in the rest of renderlists (opaque, transparent and overlay) Change-Id: Ic80a33af8ac8ac6bf606610fae5d6279cee8cf81 Signed-off-by: David Steele --- .../manager/prepare-render-instructions.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dali/internal/update/manager/prepare-render-instructions.cpp b/dali/internal/update/manager/prepare-render-instructions.cpp index 71da5e9dc..aabc96a7d 100644 --- a/dali/internal/update/manager/prepare-render-instructions.cpp +++ b/dali/internal/update/manager/prepare-render-instructions.cpp @@ -120,6 +120,16 @@ inline void SetOverlayRenderFlags( RenderList& renderList, bool stencilRenderabl } } +/** + * Set flags for stencil renderlist + * @param renderList to set the flags for + */ +inline void SetStencilRenderFlags( RenderList& renderList ) +{ + renderList.ClearFlags(); + renderList.SetFlags(RenderList::STENCIL_CLEAR | RenderList::STENCIL_WRITE | RenderList::STENCIL_TEST); +} + /** * Add a renderer to the list * @param updateBufferIndex to read the model matrix from @@ -411,6 +421,7 @@ inline void AddStencilRenderers( BufferIndex updateBufferIndex, { RenderList& stencilRenderList = instruction.GetNextFreeRenderList( layer.stencilRenderables.size() ); stencilRenderList.SetClipping( layer.IsClipping(), layer.GetClippingBox() ); + SetStencilRenderFlags( stencilRenderList ); // try to reuse cached renderitems from last time around if( tryReuseRenderList ) @@ -421,11 +432,6 @@ inline void AddStencilRenderers( BufferIndex updateBufferIndex, } } AddRenderersToRenderList( updateBufferIndex, stencilRenderList, layer.stencilRenderables, viewMatrix ); - - stencilRenderList.ClearFlags(); - stencilRenderList.SetFlags(RenderList::STENCIL_CLEAR); - stencilRenderList.SetFlags(RenderList::STENCIL_WRITE); - stencilRenderList.SetFlags(RenderList::STENCIL_TEST); } /** -- 2.34.1