Commit ffa6fd3ef56e9838b9ea7a58b1a061c427147365
1 parent
194e3ed2
Add using UPDATE_SIZE_HINT for some demos with custom shaders.
Change-Id: Id25354481d3b0c8e88741e523425a7e7501cbf6f
Showing
4 changed files
with
15 additions
and
4 deletions
examples/line-mesh/line-mesh-example.cpp
| 1 | 1 | /* |
| 2 | - * Copyright (c) 2017 Samsung Electronics Co., Ltd. | |
| 2 | + * Copyright (c) 2020 Samsung Electronics Co., Ltd. | |
| 3 | 3 | * |
| 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | 5 | * you may not use this file except in compliance with the License. |
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | // EXTERNAL INCLUDES |
| 19 | +#include <dali/devel-api/actors/actor-devel.h> | |
| 19 | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | 21 | |
| 21 | 22 | // INTERNAL INCLUDES |
| ... | ... | @@ -195,6 +196,7 @@ public: |
| 195 | 196 | mMeshActor = Actor::New(); |
| 196 | 197 | mMeshActor.AddRenderer( mRenderer ); |
| 197 | 198 | mMeshActor.SetProperty( Actor::Property::SIZE, Vector2(200, 200) ); |
| 199 | + mMeshActor.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, Vector2(400, 400) ); | |
| 198 | 200 | |
| 199 | 201 | Property::Index morphAmountIndex = mMeshActor.RegisterProperty( "uMorphAmount", 0.0f ); |
| 200 | 202 | ... | ... |
examples/mesh-morph/mesh-morph-example.cpp
| 1 | 1 | /* |
| 2 | - * Copyright (c) 2017 Samsung Electronics Co., Ltd. | |
| 2 | + * Copyright (c) 2020 Samsung Electronics Co., Ltd. | |
| 3 | 3 | * |
| 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | 5 | * you may not use this file except in compliance with the License. |
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | // EXTERNAL INCLUDES |
| 19 | +#include <dali/devel-api/actors/actor-devel.h> | |
| 19 | 20 | #include <dali-toolkit/dali-toolkit.h> |
| 20 | 21 | |
| 21 | 22 | // INTERNAL INCLUDES |
| ... | ... | @@ -297,6 +298,7 @@ public: |
| 297 | 298 | mMeshActor = Actor::New(); |
| 298 | 299 | mMeshActor.AddRenderer( mRenderer ); |
| 299 | 300 | mMeshActor.SetProperty( Actor::Property::SIZE, Vector2(400, 400) ); |
| 301 | + mMeshActor.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, Vector2(480, 700) ); | |
| 300 | 302 | |
| 301 | 303 | Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f ); |
| 302 | 304 | ... | ... |
examples/motion-blur/motion-blur-example.cpp
| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | +#include <dali/devel-api/actors/actor-devel.h> | |
| 23 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | 25 | #include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h> |
| 25 | 26 | |
| ... | ... | @@ -204,13 +205,15 @@ public: |
| 204 | 205 | |
| 205 | 206 | // Scale down actor to fit on very low resolution screens with space to interact: |
| 206 | 207 | mMotionBlurActorSize = Size( std::min( stageSize.x * 0.3f, MOTION_BLUR_ACTOR_WIDTH ), std::min( stageSize.y * 0.3f, MOTION_BLUR_ACTOR_HEIGHT ) ); |
| 208 | + mMotionBlurActorUpdateSize = Size( std::max( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::max( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) ); | |
| 207 | 209 | mMotionBlurActorSize = Size( std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ), std::min( mMotionBlurActorSize.x, mMotionBlurActorSize.y ) ); |
| 208 | 210 | |
| 209 | 211 | mMotionBlurEffect = CreateMotionBlurEffect(); |
| 210 | 212 | mMotionBlurImageView = ImageView::New(); |
| 211 | 213 | SetImageFittedInBox( mMotionBlurImageView, mMotionBlurEffect, MOTION_BLUR_ACTOR_IMAGE1, mMotionBlurActorSize.x, mMotionBlurActorSize.y ); |
| 212 | 214 | mMotionBlurImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); |
| 213 | - mMotionBlurImageView.SetProperty( Actor::Property::SIZE, Vector2(mMotionBlurActorSize.x, mMotionBlurActorSize.y) ); | |
| 215 | + mMotionBlurImageView.SetProperty( Actor::Property::SIZE, mMotionBlurActorUpdateSize ); | |
| 216 | + mMotionBlurImageView.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, mMotionBlurActorUpdateSize ); | |
| 214 | 217 | |
| 215 | 218 | mContentLayer.Add( mMotionBlurImageView ); |
| 216 | 219 | |
| ... | ... | @@ -437,6 +440,7 @@ private: |
| 437 | 440 | Property::Map mMotionBlurEffect; |
| 438 | 441 | ImageView mMotionBlurImageView; |
| 439 | 442 | Size mMotionBlurActorSize; |
| 443 | + Size mMotionBlurActorUpdateSize; | |
| 440 | 444 | |
| 441 | 445 | // animate actor to position where user taps screen |
| 442 | 446 | Animation mActorTapMovementAnimation; | ... | ... |
examples/motion-stretch/motion-stretch-example.cpp
| 1 | 1 | /* |
| 2 | - * Copyright (c) 2019 Samsung Electronics Co., Ltd. | |
| 2 | + * Copyright (c) 2020 Samsung Electronics Co., Ltd. | |
| 3 | 3 | * |
| 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | 5 | * you may not use this file except in compliance with the License. |
| ... | ... | @@ -20,6 +20,7 @@ |
| 20 | 20 | |
| 21 | 21 | #include "shared/view.h" |
| 22 | 22 | #include <dali/dali.h> |
| 23 | +#include <dali/devel-api/actors/actor-devel.h> | |
| 23 | 24 | #include <dali-toolkit/dali-toolkit.h> |
| 24 | 25 | #include <dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h> |
| 25 | 26 | |
| ... | ... | @@ -188,6 +189,8 @@ public: |
| 188 | 189 | mMotionStretchImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); |
| 189 | 190 | mMotionStretchImageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); |
| 190 | 191 | mMotionStretchImageView.SetProperty( Actor::Property::SIZE, Vector2( MOTION_STRETCH_ACTOR_WIDTH, MOTION_STRETCH_ACTOR_HEIGHT ) ); |
| 192 | + // Add stretch padding | |
| 193 | + mMotionStretchImageView.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, Vector2( MOTION_STRETCH_ACTOR_WIDTH+32, MOTION_STRETCH_ACTOR_HEIGHT+32 ) ); | |
| 191 | 194 | |
| 192 | 195 | mContentLayer.Add( mMotionStretchImageView ); |
| 193 | 196 | ... | ... |