From: Heeyong Song Date: Wed, 16 Dec 2020 15:28:16 +0000 (+0900) Subject: Fix stencil clipping bug X-Git-Tag: dali_2.0.7~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F84%2F249784%2F1;p=platform%2Fcore%2Fuifw%2Fdali-core.git Fix stencil clipping bug Change-Id: I5eb8f3033774fe20976048b24b0e25d7543d915e --- 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 ); } }