X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fperf-scroll%2Fperf-scroll.cpp;h=8a7d2a08ec533a54af058c104aa5bba0d99b0496;hb=c70446e9b125ae8bb236b4cbc3fd3f8b548459cd;hp=3bfdda5b069e509d3eb3e91b960162aa36b63183;hpb=56fcceb48527c03dc629c76aa6a2c8c6cf26d421;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..8a7d2a0 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; @@ -149,13 +148,6 @@ struct VertexWithTexture Vector2 texCoord; }; -VertexWithTexture gQuadWithTexture[] = { - { Vector2( -0.5f, -0.5f ), Vector2( 0.0f, 0.0f ) }, - { Vector2( 0.5f, -0.5f ), Vector2( 1.0f, 0.0f ) }, - { Vector2( -0.5f, 0.5f ), Vector2( 0.0f, 1.0f ) }, - { Vector2( 0.5f, 0.5f ), Vector2( 1.0f, 1.0f ) } -}; - const char* VERTEX_SHADER_TEXTURE = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n attribute mediump vec2 aTexCoord;\n @@ -231,21 +223,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(); - stage.GetRootLayer().SetDepthTestDisabled(true); + window.GetRootLayer().SetProperty( Layer::Property::DEPTH_TEST, false ); - mSize = Vector3( stageSize.x / mColumnsPerPage, stageSize.y / mRowsPerPage, 0.0f ); + mSize = Vector3( windowSize.x / mColumnsPerPage, windowSize.y / mRowsPerPage, 0.0f ); - // Respond to a click anywhere on the stage - stage.GetRootLayer().TouchSignal().Connect( this, &PerfScroll::OnTouch ); + // Respond to a click anywhere on the window + window.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 +254,7 @@ public: ShowAnimation(); } - bool OnTouch( Actor actor, const TouchData& touch ) + bool OnTouch( Actor actor, const TouchEvent& touch ) { // quit the application mApplication.Quit(); @@ -273,14 +268,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