Commit 5d1b1b8cae9c353706023fe36b82f59a002aa696

Authored by Adeel Kazmi
2 parents 2db41d48 92060d3e

[dali_1.1.15] Merge branch 'devel/master'

Change-Id: I5d7d7dc5a210c75eceb26aeec96f019ac99ba269
com.samsung.dali-demo.xml
... ... @@ -34,22 +34,22 @@
34 34 <ui-application appid="item-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/item-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
35 35 <label>Item View</label>
36 36 </ui-application>
37   - <ui-application appid="magnifier.example" exec="/usr/apps/com.samsung.dali-demo/bin/magnifier.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
38   - <label>Magnifier</label>
39   - </ui-application>
40   - <ui-application appid="metaball-explosion.example" exec="/usr/apps/com.samsung.dali-demo/bin/metaball-explosion.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
41   - <label>Metaball Explosion</label>
42   - </ui-application>
43   - <ui-application appid="metaball-refrac.example" exec="/usr/apps/com.samsung.dali-demo/bin/metaball-refrac.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
44   - <label>Metaball Refractions</label>
45   - </ui-application>
46   - <ui-application appid="motion-blur.example" exec="/usr/apps/com.samsung.dali-demo/bin/motion-blur.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
47   - <label>Motion Blur</label>
48   - </ui-application>
49   - <ui-application appid="model3d-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/model3d-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
50   - <label>Model 3D Viewer</label>
51   - </ui-application>
52   - <ui-application appid="motion-stretch.example" exec="/usr/apps/com.samsung.dali-demo/bin/motion-stretch.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  37 + <ui-application appid="magnifier.example" exec="/usr/apps/com.samsung.dali-demo/bin/magnifier.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  38 + <label>Magnifier</label>
  39 + </ui-application>
  40 + <ui-application appid="metaball-explosion.example" exec="/usr/apps/com.samsung.dali-demo/bin/metaball-explosion.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  41 + <label>Metaball Explosion</label>
  42 + </ui-application>
  43 + <ui-application appid="metaball-refrac.example" exec="/usr/apps/com.samsung.dali-demo/bin/metaball-refrac.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  44 + <label>Metaball Refractions</label>
  45 + </ui-application>
  46 + <ui-application appid="motion-blur.example" exec="/usr/apps/com.samsung.dali-demo/bin/motion-blur.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  47 + <label>Motion Blur</label>
  48 + </ui-application>
  49 + <ui-application appid="model3d-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/model3d-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  50 + <label>Model 3D Viewer</label>
  51 + </ui-application>
  52 + <ui-application appid="motion-stretch.example" exec="/usr/apps/com.samsung.dali-demo/bin/motion-stretch.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
53 53 <label>Motion Stretch</label>
54 54 </ui-application>
55 55 <ui-application appid="radial-menu.example" exec="/usr/apps/com.samsung.dali-demo/bin/radial-menu.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
... ... @@ -94,9 +94,9 @@
94 94 <ui-application appid="text-field.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-field.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
95 95 <label>Text Field</label>
96 96 </ui-application>
97   - <ui-application appid="text-fonts.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-fonts.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
98   - <label>Text Fonts</label>
99   - </ui-application>
  97 + <ui-application appid="text-fonts.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-fonts.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  98 + <label>Text Fonts</label>
  99 + </ui-application>
100 100 <ui-application appid="text-message-field.example" exec="/usr/apps/com.samsung.dali-demo/bin/text-message-field.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
101 101 <label>Text Label</label>
102 102 </ui-application>
... ... @@ -121,6 +121,9 @@
121 121 <ui-application appid="gradients.example" exec="/usr/apps/com.samsung.dali-demo/bin/gradients.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
122 122 <label>Color Gradient</label>
123 123 </ui-application>
  124 + <ui-application appid="super-blur-bloom.example" exec="/usr/apps/com.samsung.dali-demo/bin/super-blur-bloom.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
  125 + <label>Super Blur and Bloom</label>
  126 + </ui-application>
124 127 <ui-application appid="image-view.example" exec="/usr/apps/com.samsung.dali-demo/bin/image-view.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
125 128 <label>Image View</label>
126 129 </ui-application>
... ...
demo/dali-demo.cpp
... ... @@ -69,6 +69,7 @@ int main(int argc, char **argv)
69 69 demo.AddExample(Example("line-mesh.example", DALI_DEMO_STR_TITLE_LINE_MESH));
70 70 demo.AddExample(Example("gradients.example", DALI_DEMO_STR_TITLE_COLOR_GRADIENT));
71 71 demo.AddExample(Example("image-view.example", DALI_DEMO_STR_TITLE_IMAGE_VIEW));
  72 + demo.AddExample(Example("super-blur-bloom.example", DALI_DEMO_STR_TITLE_SUPER_BLUR_BLOOM));
72 73  
73 74 demo.SortAlphabetically( true );
74 75  
... ...
examples/benchmark/benchmark.cpp
... ... @@ -207,7 +207,7 @@ Geometry&amp; QuadMesh()
207 207 }
208 208  
209 209 bool gUseMesh(false);
210   -bool gUseImageView(false);
  210 +bool gUseImageActor(false);
211 211 bool gNinePatch(false);
212 212 unsigned int gRowsPerPage(25);
213 213 unsigned int gColumnsPerPage( 25 );
... ... @@ -243,11 +243,11 @@ Actor CreateMeshActor( unsigned int index)
243 243  
244 244 }
245 245 // Test application to compare performance between ImageActor and ImageView
246   -// By default, the application consist of 10 pages of 25x25 ImageActors, this can be modified using the following command line arguments:
  246 +// By default, the application consist of 10 pages of 25x25 Image views, this can be modified using the following command line arguments:
247 247 // -r NumberOfRows (Modifies the number of rows per page)
248 248 // -c NumberOfColumns (Modifies the number of columns per page)
249 249 // -p NumberOfPages (Modifies the nimber of pages )
250   -// --use-imageview ( Use ImageView instead of ImageActor )
  250 +// --use-image-actor ( Use ImageActor instead of ImageView )
251 251 // --use-mesh ( Use new renderer API (as ImageView) but shares renderers between actors when possible )
252 252 // --nine-patch ( Use nine patch images )
253 253  
... ... @@ -290,13 +290,13 @@ public:
290 290 {
291 291 CreateMeshActors();
292 292 }
293   - else if( gUseImageView )
  293 + else if( gUseImageActor )
294 294 {
295   - CreateImageViews();
  295 + CreateImageActors();
296 296 }
297 297 else
298 298 {
299   - CreateImageActors();
  299 + CreateImageViews();
300 300 }
301 301  
302 302 ShowAnimation();
... ... @@ -406,15 +406,7 @@ public:
406 406 duration = durationPerActor;
407 407 delay = delayBetweenActors * count;
408 408 }
409   - if( gUseImageView )
410   - {
411   - mImageView[count].SetPosition( initialPosition );
412   - mImageView[count].SetSize( Vector3(0.0f,0.0f,0.0f) );
413   - mImageView[count].SetOrientation( Quaternion( Radian(0.0f),Vector3::XAXIS));
414   - mShow.AnimateTo( Property( mImageView[count], Actor::Property::POSITION), Vector3(xpos+mSize.x*0.5f, ypos+mSize.y*0.5f, 0.0f), AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ));
415   - mShow.AnimateTo( Property( mImageView[count], Actor::Property::SIZE), mSize, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ));
416   - }
417   - else
  409 + if( gUseImageActor || gUseMesh )
418 410 {
419 411 mActor[count].SetPosition( initialPosition );
420 412 mActor[count].SetSize( Vector3(0.0f,0.0f,0.0f) );
... ... @@ -422,6 +414,14 @@ public:
422 414 mShow.AnimateTo( Property( mActor[count], Actor::Property::POSITION), Vector3(xpos+mSize.x*0.5f, ypos+mSize.y*0.5f, 0.0f), AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ));
423 415 mShow.AnimateTo( Property( mActor[count], Actor::Property::SIZE), mSize, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ));
424 416 }
  417 + else
  418 + {
  419 + mImageView[count].SetPosition( initialPosition );
  420 + mImageView[count].SetSize( Vector3(0.0f,0.0f,0.0f) );
  421 + mImageView[count].SetOrientation( Quaternion( Radian(0.0f),Vector3::XAXIS));
  422 + mShow.AnimateTo( Property( mImageView[count], Actor::Property::POSITION), Vector3(xpos+mSize.x*0.5f, ypos+mSize.y*0.5f, 0.0f), AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ));
  423 + mShow.AnimateTo( Property( mImageView[count], Actor::Property::SIZE), mSize, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay, duration ));
  424 + }
425 425 ++count;
426 426 }
427 427 }
... ... @@ -438,20 +438,20 @@ public:
438 438 size_t actorCount( mRowsPerPage*mColumnsPerPage*mPageCount);
439 439 for( size_t i(0); i<actorCount; ++i )
440 440 {
441   - if( gUseImageView )
442   - {
443   - mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(0.0f,3.0f));
444   - mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(3.0f,3.0f));
445   - mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(6.0f,2.0f));
446   - mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3( 12.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(8.0f,2.0f));
447   - }
448   - else
  441 + if( gUseImageActor || gUseMesh )
449 442 {
450 443 mScroll.AnimateBy( Property( mActor[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(0.0f,3.0f));
451 444 mScroll.AnimateBy( Property( mActor[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(3.0f,3.0f));
452 445 mScroll.AnimateBy( Property( mActor[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(6.0f,2.0f));
453 446 mScroll.AnimateBy( Property( mActor[i], Actor::Property::POSITION), Vector3( 12.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(8.0f,2.0f));
454 447 }
  448 + else
  449 + {
  450 + mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(0.0f,3.0f));
  451 + mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(3.0f,3.0f));
  452 + mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3(-4.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(6.0f,2.0f));
  453 + mScroll.AnimateBy( Property( mImageView[i], Actor::Property::POSITION), Vector3( 12.0f*stageSize.x,0.0f, 0.0f), AlphaFunction::EASE_OUT, TimePeriod(8.0f,2.0f));
  454 + }
455 455 }
456 456 mScroll.Play();
457 457 mScroll.FinishedSignal().Connect( this, &Benchmark::OnAnimationEnd );
... ... @@ -465,6 +465,7 @@ public:
465 465  
466 466 unsigned int totalColumns = mColumnsPerPage * mPageCount;
467 467  
  468 + float finalZ = Dali::Stage::GetCurrent().GetRenderTaskList().GetTask(0).GetCameraActor().GetCurrentWorldPosition().z;
468 469 float totalDuration( 5.0f);
469 470 float durationPerActor( 0.5f );
470 471 float delayBetweenActors = ( totalDuration - durationPerActor) / (mRowsPerPage*mColumnsPerPage);
... ... @@ -480,15 +481,15 @@ public:
480 481 delay = delayBetweenActors * count;
481 482 }
482 483  
483   - if( gUseImageView )
  484 + if( gUseImageActor || gUseMesh )
484 485 {
485   - mHide.AnimateTo( Property( mImageView[count], Actor::Property::ORIENTATION), Quaternion( Radian( Degree( 70.0f ) ), Vector3::XAXIS ), AlphaFunction::EASE_OUT, TimePeriod( delay, duration ));
486   - mHide.AnimateBy( Property( mImageView[count], Actor::Property::POSITION_Z), 1000.0f, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay +delayBetweenActors*actorsPerPage + duration, duration ));
  486 + mHide.AnimateTo( Property( mActor[count], Actor::Property::ORIENTATION), Quaternion( Radian( Degree( 70.0f ) ), Vector3::XAXIS ), AlphaFunction::EASE_OUT, TimePeriod( delay, duration ));
  487 + mHide.AnimateBy( Property( mActor[count], Actor::Property::POSITION_Z), finalZ, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay +delayBetweenActors*actorsPerPage + duration, duration ));
487 488 }
488 489 else
489 490 {
490   - mHide.AnimateTo( Property( mActor[count], Actor::Property::ORIENTATION), Quaternion( Radian( Degree( 70.0f ) ), Vector3::XAXIS ), AlphaFunction::EASE_OUT, TimePeriod( delay, duration ));
491   - mHide.AnimateBy( Property( mActor[count], Actor::Property::POSITION_Z), 1000.0f, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay +delayBetweenActors*actorsPerPage + duration, duration ));
  491 + mHide.AnimateTo( Property( mImageView[count], Actor::Property::ORIENTATION), Quaternion( Radian( Degree( 70.0f ) ), Vector3::XAXIS ), AlphaFunction::EASE_OUT, TimePeriod( delay, duration ));
  492 + mHide.AnimateBy( Property( mImageView[count], Actor::Property::POSITION_Z), finalZ, AlphaFunction::EASE_OUT_BACK, TimePeriod( delay +delayBetweenActors*actorsPerPage + duration, duration ));
492 493 }
493 494 ++count;
494 495 }
... ... @@ -534,9 +535,9 @@ int main( int argc, char **argv )
534 535 {
535 536 gUseMesh = true;
536 537 }
537   - else if( arg.compare("--use-imageview") == 0)
  538 + else if( arg.compare("--use-image-actor") == 0)
538 539 {
539   - gUseImageView = true;
  540 + gUseImageActor = true;
540 541 }
541 542 else if( arg.compare("--nine-patch" ) == 0)
542 543 {
... ...
examples/super-blur-bloom/super-blur-bloom-example.cpp 0 โ†’ 100644
  1 +/*
  2 + * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + *
  16 + */
  17 +#include <dali/dali.h>
  18 +#include <dali-toolkit/dali-toolkit.h>
  19 +#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
  20 +#include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
  21 +#include "shared/view.h"
  22 +
  23 +using namespace Dali;
  24 +
  25 +namespace
  26 +{
  27 +const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" );
  28 +const char * const TITLE_SUPER_BLUR( "Super Blur" );
  29 +const char * const TITLE_BLOOM( "Bloom" );
  30 +const char * const CHANGE_BACKGROUND_ICON( DALI_IMAGE_DIR "icon-change.png" );
  31 +const char * const CHANGE_BACKGROUND_ICON_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" );
  32 +const char * const CHANGE_BLUR_ICON( DALI_IMAGE_DIR "icon-replace.png" );
  33 +const char * const CHANGE_BLUR_ICON_SELECTED( DALI_IMAGE_DIR "icon-replace-selected.png" );
  34 +
  35 +const char* BACKGROUND_IMAGES[]=
  36 +{
  37 + DALI_IMAGE_DIR "background-1.jpg",
  38 + DALI_IMAGE_DIR "background-2.jpg",
  39 + DALI_IMAGE_DIR "background-3.jpg",
  40 + DALI_IMAGE_DIR "background-4.jpg",
  41 + DALI_IMAGE_DIR "background-5.jpg",
  42 + DALI_IMAGE_DIR "background-magnifier.jpg",
  43 +};
  44 +const unsigned int NUM_BACKGROUND_IMAGES( sizeof( BACKGROUND_IMAGES ) / sizeof( BACKGROUND_IMAGES[0] ) );
  45 +}
  46 +
  47 +/**
  48 + * @brief Load an image, scaled-down to no more than the stage dimensions.
  49 + *
  50 + * Uses image scaling mode FittingMode::SCALE_TO_FILL to resize the image at
  51 + * load time to cover the entire stage with pixels with no borders,
  52 + * and filter mode BOX_THEN_LINEAR to sample the image with
  53 + * maximum quality.
  54 + */
  55 +ResourceImage LoadStageFillingImage( const char * const imagePath )
  56 +{
  57 + Size stageSize = Stage::GetCurrent().GetSize();
  58 + return ResourceImage::New( imagePath, Dali::ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR );
  59 +}
  60 +
  61 +class BlurExample : public ConnectionTracker
  62 +{
  63 +public:
  64 + BlurExample(Application &app)
  65 + : mApp(app),
  66 + mImageIndex( 0 ),
  67 + mIsBlurring( false )
  68 + {
  69 + // Connect to the Application's Init signal
  70 + app.InitSignal().Connect(this, &BlurExample::Create);
  71 + }
  72 +
  73 + ~BlurExample()
  74 + {
  75 + }
  76 +private:
  77 + // The Init signal is received once (only) during the Application lifetime
  78 + void Create(Application& app)
  79 + {
  80 + Stage stage = Stage::GetCurrent();
  81 + Vector2 stageSize = stage.GetSize();
  82 +
  83 + stage.KeyEventSignal().Connect(this, &BlurExample::OnKeyEvent);
  84 +
  85 + // Creates a default view with a default tool bar.
  86 + // The view is added to the stage.
  87 + Layer content = DemoHelper::CreateView( app,
  88 + mBackground,
  89 + mToolBar,
  90 + "",
  91 + TOOLBAR_IMAGE,
  92 + "" );
  93 +
  94 + // Add a button to change background. (right of toolbar)
  95 + Toolkit::PushButton changeBackgroundButton = Toolkit::PushButton::New();
  96 + changeBackgroundButton.SetUnselectedImage( CHANGE_BACKGROUND_ICON );
  97 + changeBackgroundButton.SetSelectedImage( CHANGE_BACKGROUND_ICON_SELECTED );
  98 + changeBackgroundButton.ClickedSignal().Connect( this, &BlurExample::OnChangeBackgroundIconClicked );
  99 + mToolBar.AddControl( changeBackgroundButton,
  100 + DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
  101 + Toolkit::Alignment::HorizontalRight,
  102 + DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
  103 +
  104 + // Add a button to change the blur view. (left of toolbar)
  105 + Toolkit::PushButton changeBlurButton = Toolkit::PushButton::New();
  106 + changeBlurButton.SetUnselectedImage( CHANGE_BLUR_ICON );
  107 + changeBlurButton.SetSelectedImage( CHANGE_BLUR_ICON_SELECTED );
  108 + changeBlurButton.ClickedSignal().Connect( this, &BlurExample::OnChangeBlurIconClicked );
  109 + mToolBar.AddControl( changeBlurButton,
  110 + DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
  111 + Toolkit::Alignment::HorizontalLeft,
  112 + DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
  113 +
  114 + mSuperBlurView = Toolkit::SuperBlurView::New( 5 );
  115 + mSuperBlurView.SetSize( stageSize );
  116 + mSuperBlurView.SetParentOrigin( ParentOrigin::CENTER );
  117 + mSuperBlurView.SetAnchorPoint( AnchorPoint::CENTER );
  118 + mSuperBlurView.BlurFinishedSignal().Connect(this, &BlurExample::OnBlurFinished);
  119 + mCurrentImage = LoadStageFillingImage( BACKGROUND_IMAGES[mImageIndex] );
  120 + mSuperBlurView.SetImage( mCurrentImage );
  121 + mBackground.Add( mSuperBlurView );
  122 + mIsBlurring = true;
  123 + SetTitle( TITLE_SUPER_BLUR );
  124 +
  125 + mBloomView = Toolkit::BloomView::New();
  126 + mBloomView.SetParentOrigin(ParentOrigin::CENTER);
  127 + mBloomView.SetSize(stageSize);
  128 + mBloomActor = Toolkit::ImageView::New(mCurrentImage);
  129 + mBloomActor.SetParentOrigin( ParentOrigin::CENTER );
  130 + mBloomView.Add( mBloomActor );
  131 +
  132 + // Connect the callback to the touch signal on the background
  133 + mSuperBlurView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
  134 + mBloomView.TouchedSignal().Connect( this, &BlurExample::OnTouch );
  135 + }
  136 +
  137 + // Callback function of the touch signal on the background
  138 + bool OnTouch(Dali::Actor actor, const Dali::TouchEvent& event)
  139 + {
  140 + const TouchPoint &point = event.GetPoint(0);
  141 + switch(point.state)
  142 + {
  143 + case TouchPoint::Down:
  144 + {
  145 + if( mAnimation )
  146 + {
  147 + mAnimation.Clear();
  148 + }
  149 +
  150 + mAnimation = Animation::New( 2.f );
  151 + if( mSuperBlurView.OnStage() )
  152 + {
  153 + mAnimation.AnimateTo( Property( mSuperBlurView, mSuperBlurView.GetBlurStrengthPropertyIndex() ), 1.f );
  154 + }
  155 + else
  156 + {
  157 + mAnimation.AnimateTo( Property( mBloomView, mBloomView.GetBloomIntensityPropertyIndex() ), 3.f );
  158 + }
  159 + mAnimation.Play();
  160 + break;
  161 + }
  162 + case TouchPoint::Up:
  163 + case TouchPoint::Leave:
  164 + case TouchPoint::Interrupted:
  165 + {
  166 + if( mAnimation )
  167 + {
  168 + mAnimation.Clear();
  169 + }
  170 +
  171 + mAnimation = Animation::New( 2.f );
  172 + if( mSuperBlurView.OnStage() )
  173 + {
  174 + mAnimation.AnimateTo( Property( mSuperBlurView, mSuperBlurView.GetBlurStrengthPropertyIndex() ), 0.f );
  175 + }
  176 + else
  177 + {
  178 + mAnimation.AnimateTo( Property( mBloomView, mBloomView.GetBloomIntensityPropertyIndex() ), 0.f );
  179 + }
  180 + mAnimation.Play();
  181 + break;
  182 + }
  183 + case TouchPoint::Motion:
  184 + case TouchPoint::Stationary:
  185 + case TouchPoint::Last:
  186 + default:
  187 + {
  188 + break;
  189 + }
  190 + }
  191 + return true;
  192 + }
  193 +
  194 + /**
  195 + * Main key event handler
  196 + */
  197 + void OnKeyEvent(const KeyEvent& event)
  198 + {
  199 + if(event.state == KeyEvent::Down)
  200 + {
  201 + if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
  202 + {
  203 + mApp.Quit();
  204 + }
  205 + }
  206 + }
  207 +
  208 + bool OnChangeBackgroundIconClicked( Toolkit::Button button )
  209 + {
  210 + if( mIsBlurring )
  211 + {
  212 + return true;
  213 + }
  214 +
  215 + if( mAnimation )
  216 + {
  217 + mAnimation.Clear();
  218 + }
  219 +
  220 + mImageIndex = (mImageIndex+1u)%NUM_BACKGROUND_IMAGES;
  221 + mCurrentImage = LoadStageFillingImage( BACKGROUND_IMAGES[mImageIndex] );
  222 +
  223 + if( mSuperBlurView.OnStage() )
  224 + {
  225 + mIsBlurring = true;
  226 +
  227 + mSuperBlurView.SetBlurStrength( 0.f );
  228 + mSuperBlurView.SetImage( mCurrentImage );
  229 + }
  230 + else
  231 + {
  232 + mBloomView.SetProperty( mBloomView.GetBloomIntensityPropertyIndex(), 0.f );
  233 + mBloomActor.SetImage( mCurrentImage );
  234 + }
  235 +
  236 + return true;
  237 + }
  238 +
  239 + bool OnChangeBlurIconClicked( Toolkit::Button button )
  240 + {
  241 + if( mSuperBlurView.OnStage() )
  242 + {
  243 + SetTitle( TITLE_BLOOM );
  244 + mBackground.Remove( mSuperBlurView );
  245 +
  246 + mBloomActor.SetImage( mCurrentImage );
  247 + mBloomView.SetProperty( mBloomView.GetBloomIntensityPropertyIndex(), 0.f );
  248 + mBackground.Add( mBloomView );
  249 + mBloomView.Activate();
  250 +
  251 + }
  252 + else
  253 + {
  254 + SetTitle( TITLE_SUPER_BLUR );
  255 + mBackground.Remove( mBloomView );
  256 + mBloomView.Deactivate();
  257 +
  258 + mBackground.Add( mSuperBlurView );
  259 + mSuperBlurView.SetBlurStrength( 0.f );
  260 + mSuperBlurView.SetImage( mCurrentImage );
  261 + mIsBlurring = true;
  262 + }
  263 +
  264 + return true;
  265 + }
  266 +
  267 + void OnBlurFinished( Toolkit::SuperBlurView blurView )
  268 + {
  269 + mIsBlurring = false;
  270 + }
  271 +
  272 + /**
  273 + * Sets/Updates the title of the View
  274 + * @param[in] title The new title for the view.
  275 + */
  276 + void SetTitle(const std::string& title)
  277 + {
  278 + if(!mTitleActor)
  279 + {
  280 + mTitleActor = DemoHelper::CreateToolBarLabel( title );
  281 + // Add title to the tool bar.
  282 + mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter );
  283 + }
  284 +
  285 + mTitleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, title );
  286 + }
  287 +
  288 +private:
  289 +
  290 + Application& mApp;
  291 + Toolkit::ToolBar mToolBar;
  292 + Toolkit::TextLabel mTitleActor; ///< The Toolbar's Title.
  293 + Toolkit::Control mBackground;
  294 + Toolkit::SuperBlurView mSuperBlurView;
  295 + Toolkit::BloomView mBloomView;
  296 + Animation mAnimation;
  297 + Toolkit::ImageView mBloomActor;
  298 + Image mCurrentImage;
  299 + unsigned int mImageIndex;
  300 + bool mIsBlurring;
  301 +};
  302 +
  303 +/*****************************************************************************/
  304 +
  305 +static void
  306 +RunTest(Application& app)
  307 +{
  308 + BlurExample theApp(app);
  309 + app.MainLoop();
  310 +}
  311 +
  312 +/*****************************************************************************/
  313 +
  314 +int
  315 +main(int argc, char **argv)
  316 +{
  317 + Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH);
  318 +
  319 + RunTest(app);
  320 +
  321 + return 0;
  322 +}
... ...
packaging/com.samsung.dali-demo.spec
... ... @@ -2,7 +2,7 @@
2 2  
3 3 Name: com.samsung.dali-demo
4 4 Summary: The OpenGLES Canvas Core Demo
5   -Version: 1.1.14
  5 +Version: 1.1.15
6 6 Release: 1
7 7 Group: System/Libraries
8 8 License: Apache-2.0
... ...
resources/scripts/shader-effect-ripple.json
... ... @@ -51,9 +51,9 @@
51 51 "Ripple2D": {
52 52 "program": {
53 53 "vertexPrefix": "",
54   - "vertex": "void main(void)\n{\n gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\n vTexCoord = aTexCoord;\n}\n\n",
  54 + "vertex": "void main(void)\n{\n gl_Position = uMvpMatrix * vec4(aPosition*uSize.xy, 0.0, 1.0);\n vTexCoord = mix( uTextureRect.xy, uTextureRect.zw, aPosition + vec2(0.5) );\n}\n\n",
55 55 "fragmentPrefix": "",
56   - "fragment": "precision mediump float;\nuniform float uAmplitude; // 0.02; (< 1)\nuniform float uTime;\nvoid main()\n{\n highp vec2 textureSize = sTextureRect.zw - sTextureRect.xy;\n highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\n highp float len = length(pos);\n highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \n gl_FragColor = texture2D(sTexture, texCoord) * uColor;\n}\n\n\n",
  56 + "fragment": "precision mediump float;\nuniform float uAmplitude; // 0.02; (< 1)\nuniform float uTime;\nvoid main()\n{\n highp vec2 textureSize = uTextureRect.zw - uTextureRect.xy;\n highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\n highp float len = length(pos);\n highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \n gl_FragColor = texture2D(sTexture, texCoord) * uColor;\n}\n\n\n",
57 57 "geometryType": "GEOMETRY_TYPE_IMAGE"
58 58 },
59 59 "geometryHints": "HINT_NONE",
... ...
shared/dali-demo-strings.h
... ... @@ -61,6 +61,7 @@ extern &quot;C&quot;
61 61 #define DALI_DEMO_STR_TITLE_TEXTURED_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TEXTURED_MESH")
62 62 #define DALI_DEMO_STR_TITLE_LINE_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_LINE_MESH")
63 63 #define DALI_DEMO_STR_TITLE_COLOR_GRADIENT dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_COLOR_GRADIENT")
  64 +#define DALI_DEMO_STR_TITLE_SUPER_BLUR_BLOOM dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_SUPER_BLUR_BLOOM")
64 65  
65 66 #else // !INTERNATIONALIZATION_ENABLED
66 67  
... ... @@ -97,6 +98,7 @@ extern &quot;C&quot;
97 98 #define DALI_DEMO_STR_TITLE_LINE_MESH "Mesh Line"
98 99 #define DALI_DEMO_STR_TITLE_COLOR_GRADIENT "Color Gradient"
99 100 #define DALI_DEMO_STR_TITLE_IMAGE_VIEW "Image View"
  101 +#define DALI_DEMO_STR_TITLE_SUPER_BLUR_BLOOM "Super Blur and Bloom"
100 102  
101 103 #endif
102 104  
... ...