Removed Draw::OVERLAY from Demos. 47/41347/3
authorRichard Underhill <r.underhill@partner.samsung.com>
Fri, 12 Jun 2015 13:41:41 +0000 (14:41 +0100)
committerRichard Underhill <r.underhill@partner.samsung.com>
Fri, 12 Jun 2015 13:48:36 +0000 (06:48 -0700)
NEEDS:
https://review.tizen.org/gerrit/#/c/41345/

and

https://review.tizen.org/gerrit/#/c/41346/

Change-Id: I2b66ac6882960400d5b32e26ba9909974a2b30cc
Signed-off-by: Richard Underhill <r.underhill@partner.samsung.com>
demo/dali-table-view.cpp
shared/view.h

index 96d33b5..2dd8845 100644 (file)
@@ -268,9 +268,11 @@ void DaliTableView::Initialize( Application& application )
   mScrollView.TouchedSignal().Connect( this, &DaliTableView::OnScrollTouched );
 
   mScrollViewLayer = Layer::New();
+
+  // Disable the depth test for performance
+  mScrollViewLayer.SetDepthTestDisabled( true );
   mScrollViewLayer.SetAnchorPoint( AnchorPoint::CENTER );
   mScrollViewLayer.SetParentOrigin( ParentOrigin::CENTER );
-  mScrollViewLayer.SetDrawMode( DrawMode::OVERLAY );
   mScrollViewLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
   // Create solid background colour.
@@ -279,7 +281,9 @@ void DaliTableView::Initialize( Application& application )
   backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER );
   backgroundColourActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
   backgroundColourActor.SetSizeModeFactor( Vector3( 1.0f, 1.5f, 1.0f ) );
-  backgroundColourActor.SetZ( BACKGROUND_Z );
+
+  // Force the filled background right to the back
+  backgroundColourActor.SetDepthIndex( DemoHelper::BACKGROUND_DEPTH_INDEX );
   mScrollViewLayer.Add( backgroundColourActor );
 
   // Populate background and bubbles - needs to be scrollViewLayer so scroll ends show
@@ -764,6 +768,9 @@ void DaliTableView::AddBackgroundActors( Actor layer, int count, BufferImage dis
     dfActor.SetSize( Vector2( randSize, randSize ) );
     dfActor.SetParentOrigin( ParentOrigin::CENTER );
 
+    // Force the bubbles just in front of the solid background
+    dfActor.SetDepthIndex( DemoHelper::BACKGROUND_DEPTH_INDEX + 1 );
+
     ShaderEffect effect = Toolkit::CreateDistanceFieldEffect();
     dfActor.SetShaderEffect( effect );
     dfActor.SetColor( randColour );
index dcf8e9a..d417b6f 100644 (file)
 namespace DemoHelper
 {
 
+enum ControlDepthIndexRanges
+{
+    BACKGROUND_DEPTH_INDEX    = -10000000,
+    CONTENT_DEPTH_INDEX       =  0,
+    DECORATION_DEPTH_INDEX    =  10000000
+};
+
 /**
  * Provide a style for the view and its tool bar.
  */
@@ -94,7 +101,6 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar,
   {
     Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New();
     label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
-    label.SetDrawMode( Dali::DrawMode::OVERLAY );
     label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" );
     label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title );
     label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
@@ -160,7 +166,6 @@ Dali::Toolkit::TextLabel CreateToolBarLabel( const std::string& text )
 {
   Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( text );
   label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" );
-  label.SetDrawMode( Dali::DrawMode::OVERLAY );
   label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
   label.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT );