From a03f5ec56183b63d2d2e46eba9ca78685390a8e7 Mon Sep 17 00:00:00 2001 From: Richard Underhill Date: Fri, 12 Jun 2015 14:41:41 +0100 Subject: [PATCH] Removed Draw::OVERLAY from Demos. NEEDS: https://review.tizen.org/gerrit/#/c/41345/ and https://review.tizen.org/gerrit/#/c/41346/ Change-Id: I2b66ac6882960400d5b32e26ba9909974a2b30cc Signed-off-by: Richard Underhill --- demo/dali-table-view.cpp | 11 +++++++++-- shared/view.h | 9 +++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index 96d33b5..2dd8845 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -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 ); diff --git a/shared/view.h b/shared/view.h index dcf8e9a..d417b6f 100644 --- a/shared/view.h +++ b/shared/view.h @@ -26,6 +26,13 @@ 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 ); -- 2.7.4