Fix stencil clipping bug 84/249784/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 16 Dec 2020 15:28:16 +0000 (00:28 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 16 Dec 2020 15:28:16 +0000 (00:28 +0900)
Change-Id: I5eb8f3033774fe20976048b24b0e25d7543d915e

automated-tests/src/dali/utc-Dali-Actor.cpp
dali/internal/render/common/render-algorithms.cpp

index dc23be2..0819a66 100644 (file)
@@ -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.
index d40614c..314a974 100755 (executable)
@@ -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 );
   }
 }