From: dongsug song Date: Tue, 27 Feb 2018 01:00:06 +0000 (+0000) Subject: Merge "Add logs to check the messages processed by the update thread" into tizen_4... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=148378f6d71dbfe7fa38e0006a087f7acc10b3c8;hp=695b6b939aa83af860d63f544cc01b10393f3530;p=platform%2Fcore%2Fuifw%2Fdali-core.git Merge "Add logs to check the messages processed by the update thread" into tizen_4.0_tv --- diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 1ee475f..de776df 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -4467,8 +4467,8 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void) | ┌─────┐─────┐ A C D - | - B + | | + B E */ const Vector2 stageSize( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ); @@ -4476,12 +4476,14 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void) const Vector2 sizeB{ stageSize.width, stageSize.height * 0.05f }; const Vector2 sizeC{ stageSize.width, stageSize.height * 0.25f }; const Vector2 sizeD{ stageSize.width, stageSize.height * 0.25f }; + const Vector2 sizeE{ stageSize.width, stageSize.height * 0.05f }; // Create a clipping actors. Actor clippingActorA = CreateActorWithContent( sizeA.width, sizeA.height ); Actor clippingActorB = CreateActorWithContent( sizeB.width, sizeB.height ); Actor clippingActorC = CreateActorWithContent( sizeC.width, sizeC.height ); Actor clippingActorD = CreateActorWithContent( sizeD.width, sizeD.height ); + Actor clippingActorE = CreateActorWithContent( sizeE.width, sizeE.height ); clippingActorA.SetParentOrigin( ParentOrigin::CENTER_LEFT ); clippingActorA.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); @@ -4499,15 +4501,20 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void) clippingActorD.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); clippingActorD.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); + clippingActorE.SetParentOrigin( ParentOrigin::CENTER_LEFT ); + clippingActorE.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorA.SetPosition( 0.0f, -200.0f, 0.0f ); clippingActorB.SetPosition( 0.0f, 0.0f, 0.0f ); clippingActorC.SetPosition( 0.0f, 100.0f, 0.0f ); clippingActorD.SetPosition( 0.0f, 0.0f, 0.0f ); + clippingActorE.SetPosition( 0.0f, 0.0f, 0.0f ); Stage::GetCurrent().Add( clippingActorA ); clippingActorA.Add( clippingActorB ); Stage::GetCurrent().Add( clippingActorC ); Stage::GetCurrent().Add( clippingActorD ); + clippingActorD.Add( clippingActorE ); // Gather the call trace. GenerateTrace( application, enabledDisableTrace, scissorTrace ); @@ -4528,6 +4535,7 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void) DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipB ) ); DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipC ) ); DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipD ) ); + DALI_TEST_CHECK( scissorTrace.CountMethod( "Scissor" ) == 4 ); // Scissor rect should not be changed in clippingActorE case. So count should be 4. END_TEST; } diff --git a/automated-tests/src/dali/utc-Dali-Renderer.cpp b/automated-tests/src/dali/utc-Dali-Renderer.cpp index 9ea907d..021349f 100644 --- a/automated-tests/src/dali/utc-Dali-Renderer.cpp +++ b/automated-tests/src/dali/utc-Dali-Renderer.cpp @@ -956,7 +956,7 @@ int UtcDaliRendererPreMultipledAlpha(void) DALI_TEST_EQUALS( (int)BlendFactor::ONE, srcFactorRgb, TEST_LOCATION ); DALI_TEST_EQUALS( (int)BlendFactor::ONE_MINUS_SRC_ALPHA, destFactorRgb, TEST_LOCATION ); DALI_TEST_EQUALS( (int)BlendFactor::ONE, srcFactorAlpha, TEST_LOCATION ); - DALI_TEST_EQUALS( (int)BlendFactor::ONE, destFactorAlpha, TEST_LOCATION ); + DALI_TEST_EQUALS( (int)BlendFactor::ONE_MINUS_SRC_ALPHA, destFactorAlpha, TEST_LOCATION ); DALI_TEST_CHECK( gl.GetUniformValue( "uColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, Vector4(0.5f, 0.0f, 0.5f, 0.5f), TEST_LOCATION ); diff --git a/dali/internal/event/rendering/renderer-impl.cpp b/dali/internal/event/rendering/renderer-impl.cpp index 62c517c..35431d5 100644 --- a/dali/internal/event/rendering/renderer-impl.cpp +++ b/dali/internal/event/rendering/renderer-impl.cpp @@ -315,7 +315,7 @@ void Renderer::EnablePreMultipliedAlpha( bool preMultipled ) { if( preMultipled ) { - SetBlendFunc( BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE ); + SetBlendFunc( BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA ); } mPremultipledAlphaEnabled = preMultipled; SetEnablePreMultipliedAlphaMessage( GetEventThreadServices(), *mSceneObject, mPremultipledAlphaEnabled ); diff --git a/dali/internal/render/common/render-algorithms.cpp b/dali/internal/render/common/render-algorithms.cpp index 4559a73..9e2c900 100644 --- a/dali/internal/render/common/render-algorithms.cpp +++ b/dali/internal/render/common/render-algorithms.cpp @@ -244,9 +244,9 @@ inline void RenderAlgorithms::SetupScissorClipping( const RenderItem& item, Cont // So we know if we are at depth 4 and the stackDepth is 5, that we have gone up. // If the depth is the same then we are effectively part of a different sub-tree from the parent, we must also remove the current clip. // Note: Stack depth must always be at least 1, as we will have the layer or stage size as the root value. - if( ( childStackDepth > 0u ) && ( scissorDepth <= childStackDepth ) ) + if( ( childStackDepth > 0u ) && ( scissorDepth < childStackDepth ) ) { - while( scissorDepth <= childStackDepth ) // Pop until sibling + while( scissorDepth < childStackDepth ) { mScissorStack.pop_back(); --childStackDepth; @@ -255,7 +255,7 @@ inline void RenderAlgorithms::SetupScissorClipping( const RenderItem& item, Cont // We traversed up the tree, we need to apply a new scissor rectangle (unless we are at the root). traversedUpTree = true; } - else if( clippingNode && childStackDepth > 0u && childStackDepth == scissorDepth ) // case of sibling clip area + if( clippingNode && childStackDepth > 0u && childStackDepth == scissorDepth ) // case of sibling clip area { mScissorStack.pop_back(); }