/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
tet_infoline("Testing Dali::Layer::SetDepthTestDisabled() ");
Layer actor = Layer::New();
+ // Note that IsDepthTestDisabled does not depend on layer behavior,
+ // as 2D layers can still have depth tests performed on a per-renderer basis.
+ // Check default.
DALI_TEST_CHECK( actor.IsDepthTestDisabled() );
- actor.SetBehavior( Layer::LAYER_3D );
-
- Property::Value behavior = actor.GetProperty(Layer::Property::BEHAVIOR);
- DALI_TEST_EQUALS(behavior.Get<std::string>().c_str(), "LAYER_3D", TEST_LOCATION );
+ // Check Set / Unset.
+ actor.SetDepthTestDisabled( false );
DALI_TEST_CHECK( !actor.IsDepthTestDisabled() );
-
actor.SetDepthTestDisabled( true );
DALI_TEST_CHECK( actor.IsDepthTestDisabled() );
+
END_TEST;
}
DALI_TEST_EQUALS( layer.GetBehavior(), Dali::Layer::LAYER_3D, TEST_LOCATION );
END_TEST;
}
+
+Actor CreateActor( bool withAlpha )
+{
+ Dali::BufferImage bufferImage;
+
+ if( withAlpha )
+ {
+ bufferImage = Dali::BufferImage::WHITE();
+ }
+ else
+ {
+ bufferImage = BufferImage::New( 1u, 1u, Pixel::RGB888, Dali::Image::NEVER );
+ PixelBuffer* pBuffer = bufferImage.GetBuffer();
+ if( pBuffer )
+ {
+ pBuffer[0] = pBuffer[1] = pBuffer[2] = 0xFF;
+ }
+ }
+
+ Actor actor = CreateRenderableActor( bufferImage );
+ actor.SetParentOrigin( ParentOrigin::CENTER );
+ actor.SetAnchorPoint( AnchorPoint::CENTER );
+
+ return actor;
+}
+
+int UtcDaliLayer3DSort(void)
+{
+ tet_infoline( "Testing LAYER_3D sort coverage test" );
+ TestApplication application;
+ TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+ TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
+
+ Stage::GetCurrent().GetRootLayer().SetBehavior( Layer::LAYER_3D );
+
+ // Create an actor.
+ Actor actor = CreateActor( false );
+ Stage::GetCurrent().Add( actor );
+
+ // Create child actors.
+ Actor child1 = CreateActor( true );
+ actor.Add( child1 );
+ Actor child2 = CreateActor( false );
+ child1.Add( child2 );
+
+ enabledDisableTrace.Reset();
+ enabledDisableTrace.Enable( true );
+ application.SendNotification();
+ application.Render();
+ enabledDisableTrace.Enable( false );
+
+ DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "2929" ) ); // 2929 is GL_DEPTH_TEST
+
+ END_TEST;
+}