From: Anton Obzhirov Date: Wed, 27 May 2020 16:24:43 +0000 (+0100) Subject: Add using UPDATE_SIZE_HINT for some demos with custom shaders. X-Git-Tag: dali_1.9.18~3 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=ffa6fd3ef56e9838b9ea7a58b1a061c427147365 Add using UPDATE_SIZE_HINT for some demos with custom shaders. Change-Id: Id25354481d3b0c8e88741e523425a7e7501cbf6f --- diff --git a/examples/line-mesh/line-mesh-example.cpp b/examples/line-mesh/line-mesh-example.cpp index b4fd114..1d845af 100644 --- a/examples/line-mesh/line-mesh-example.cpp +++ b/examples/line-mesh/line-mesh-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -16,6 +16,7 @@ */ // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES @@ -195,6 +196,7 @@ public: mMeshActor = Actor::New(); mMeshActor.AddRenderer( mRenderer ); mMeshActor.SetProperty( Actor::Property::SIZE, Vector2(200, 200) ); + mMeshActor.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, Vector2(400, 400) ); Property::Index morphAmountIndex = mMeshActor.RegisterProperty( "uMorphAmount", 0.0f ); diff --git a/examples/mesh-morph/mesh-morph-example.cpp b/examples/mesh-morph/mesh-morph-example.cpp index e2d0773..655545a 100644 --- a/examples/mesh-morph/mesh-morph-example.cpp +++ b/examples/mesh-morph/mesh-morph-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -16,6 +16,7 @@ */ // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES @@ -297,6 +298,7 @@ public: mMeshActor = Actor::New(); mMeshActor.AddRenderer( mRenderer ); mMeshActor.SetProperty( Actor::Property::SIZE, Vector2(400, 400) ); + mMeshActor.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, Vector2(480, 700) ); Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f ); diff --git a/examples/motion-blur/motion-blur-example.cpp b/examples/motion-blur/motion-blur-example.cpp index e8f034e..6fa3778 100644 --- a/examples/motion-blur/motion-blur-example.cpp +++ b/examples/motion-blur/motion-blur-example.cpp @@ -20,6 +20,7 @@ #include "shared/view.h" #include +#include #include #include @@ -204,13 +205,15 @@ public: // Scale down actor to fit on very low resolution screens with space to interact: mMotionBlurActorSize = Size( std::min( stageSize.x * 0.3f, MOTION_BLUR_ACTOR_WIDTH ), std::min( stageSize.y * 0.3f, MOTION_BLUR_ACTOR_HEIGHT ) ); + mMotionBlurActorUpdateSize = Size( std::max( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::max( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) ); mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) ); mMotionBlurEffect = CreateMotionBlurEffect(); mMotionBlurImageView = ImageView::New(); SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y ); mMotionBlurImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - mMotionBlurImageView.SetProperty( Actor::Property::SIZE, Vector2(mMotionBlurActorSize.x, mMotionBlurActorSize.y) ); + mMotionBlurImageView.SetProperty( Actor::Property::SIZE, mMotionBlurActorUpdateSize ); + mMotionBlurImageView.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, mMotionBlurActorUpdateSize ); mContentLayer.Add( mMotionBlurImageView ); @@ -437,6 +440,7 @@ private: Property::Map mMotionBlurEffect; ImageView mMotionBlurImageView; Size mMotionBlurActorSize; + Size mMotionBlurActorUpdateSize; // animate actor to position where user taps screen Animation mActorTapMovementAnimation; diff --git a/examples/motion-stretch/motion-stretch-example.cpp b/examples/motion-stretch/motion-stretch-example.cpp index 0dc404d..c579e5a 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 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. @@ -20,6 +20,7 @@ #include "shared/view.h" #include +#include #include #include @@ -188,6 +189,8 @@ public: mMotionStretchImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); mMotionStretchImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mMotionStretchImageView.SetProperty( Actor::Property::SIZE, Vector2( MOTION_STRETCH_ACTOR_WIDTH, MOTION_STRETCH_ACTOR_HEIGHT ) ); + // Add stretch padding + mMotionStretchImageView.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, Vector2( MOTION_STRETCH_ACTOR_WIDTH+32, MOTION_STRETCH_ACTOR_HEIGHT+32 ) ); mContentLayer.Add( mMotionStretchImageView );