From 3df7058ca6ee084818cd0af06212786ed6f68cce Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 17 Dec 2020 00:28:16 +0900 Subject: [PATCH] Fix stencil clipping bug Change-Id: I5eb8f3033774fe20976048b24b0e25d7543d915e --- automated-tests/src/dali/utc-Dali-Actor.cpp | 4 ++-- dali/internal/render/common/render-algorithms.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index dc23be2..0819a66 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -4367,7 +4367,7 @@ int UtcDaliActorPropertyClippingNestedChildren(void) DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7681, 7681", startIndex)); // GL_KEEP, GL_REPLACE, GL_REPLACE // Check the correct setup was done to test against first bit-plane (only) of the stencil buffer. - DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 1, 255", startIndex)); // 514 is GL_EQUAL + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 1, 1", startIndex)); // 514 is GL_EQUAL DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7680, 7680", startIndex)); // GL_KEEP, GL_KEEP, GL_KEEP // Check we are set up to write to the second bitplane of the stencil buffer (only). @@ -4377,7 +4377,7 @@ int UtcDaliActorPropertyClippingNestedChildren(void) // Check we are set up to test against both the first and second bit-planes of the stencil buffer. // (Both must be set to pass the check). - DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 3, 255", startIndex)); // 514 is GL_EQUAL, Test both bit-planes 1 & 2 + DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilFunc", "514, 3, 3", startIndex)); // 514 is GL_EQUAL, Test both bit-planes 1 & 2 DALI_TEST_CHECK(stencilTrace.FindMethodAndParamsFromStartIndex("StencilOp", "7680, 7680, 7680", startIndex)); // GL_KEEP, GL_KEEP, GL_KEEP // If we are on the first loop, set the layer to 3D and loop to perform the test again. diff --git a/dali/internal/render/common/render-algorithms.cpp b/dali/internal/render/common/render-algorithms.cpp index d40614c..314a974 100755 --- a/dali/internal/render/common/render-algorithms.cpp +++ b/dali/internal/render/common/render-algorithms.cpp @@ -159,7 +159,7 @@ inline void SetupStencilClipping( const RenderItem& item, Context& context, uint // We are reading from the stencil buffer. Set up the stencil accordingly // This calculation sets all the bits up to the current depth bit. // This has the effect of testing that the pixel being written to exists in every bit-plane up to the current depth. - context.StencilFunc( GL_EQUAL, currentDepthMask, 0xff ); + context.StencilFunc( GL_EQUAL, currentDepthMask, currentDepthMask ); context.StencilOp( GL_KEEP, GL_KEEP, GL_KEEP ); } } -- 2.7.4