X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fperf-scroll%2Fperf-scroll.cpp;h=0261ab3485db44bb3555b8f3fa7a37a9857af057;hb=refs%2Fchanges%2F85%2F242285%2F1;hp=3bfdda5b069e509d3eb3e91b960162aa36b63183;hpb=7be9f30032c9a694c9f18bd03533822bd2dc2075;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/perf-scroll/perf-scroll.cpp b/examples/perf-scroll/perf-scroll.cpp index 3bfdda5..0261ab3 100644 --- a/examples/perf-scroll/perf-scroll.cpp +++ b/examples/perf-scroll/perf-scroll.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -15,9 +15,8 @@ * */ -#include #include - +#include #include "shared/utility.h" using namespace Dali; @@ -231,21 +230,24 @@ public: // The Init signal is received once (only) during the Application lifetime void Create( Application& application ) { - // Get a handle to the stage - Stage stage = Stage::GetCurrent(); - stage.SetBackgroundColor( Color::WHITE ); - Vector2 stageSize = stage.GetSize(); + // Get a handle to the window + Window window = application.GetWindow(); + window.SetBackgroundColor( Color::WHITE ); + Vector2 windowSize = window.GetSize(); + + window.GetRootLayer().SetProperty( Layer::Property::DEPTH_TEST, false ); - stage.GetRootLayer().SetDepthTestDisabled(true); + mSize = Vector3( windowSize.x / mColumnsPerPage, windowSize.y / mRowsPerPage, 0.0f ); - mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f ); + // Respond to a click anywhere on the window + window.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch ); - // Respond to a click anywhere on the stage - stage.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch ); + // Respond to key events + window.KeyEventSignal().Connect( this, &PerfScroll::OnKeyEvent ); mParent = Actor::New(); - mParent.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - stage.Add(mParent); + mParent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + window.Add(mParent); if( gUseMesh ) { @@ -259,7 +261,7 @@ public: ShowAnimation(); } - bool OnTouch( Actor actor, const TouchData& touch ) + bool OnTouch( Actor actor, const TouchEvent& touch ) { // quit the application mApplication.Quit(); @@ -273,14 +275,20 @@ public: void CreateImageViews() { - Stage stage = Stage::GetCurrent(); + Window window = mApplication.GetWindow(); unsigned int actorCount( mRowsPerPage*mColumnsPerPage * mPageCount ); mImageView.resize( actorCount ); for( size_t i(0); i