From: David Steele Date: Mon, 12 Feb 2024 18:50:03 +0000 (+0000) Subject: Added key control to gaussian-blur-view.example X-Git-Tag: dali_2.3.11~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-demo.git;a=commitdiff_plain;h=02f3725ad7bd2772cec5a2ffa49c2a8535225a69 Added key control to gaussian-blur-view.example Change-Id: I4cff9ec6adcd7d00f899bf9b15dd0dc172284065 --- diff --git a/examples/gaussian-blur-view/README.md b/examples/gaussian-blur-view/README.md new file mode 100644 index 0000000..7d53456 --- /dev/null +++ b/examples/gaussian-blur-view/README.md @@ -0,0 +1,5 @@ +This example shows the GuassianBlurView in action. + +Press 1, touch or click in order to toggle the blurring. + +Used to test render tasks, frame buffers and fence syncs. diff --git a/examples/gaussian-blur-view/gaussian-blur-view-example.cpp b/examples/gaussian-blur-view/gaussian-blur-view-example.cpp index e9ff1cc..83defd3 100644 --- a/examples/gaussian-blur-view/gaussian-blur-view-example.cpp +++ b/examples/gaussian-blur-view/gaussian-blur-view-example.cpp @@ -116,25 +116,30 @@ private: if(PointState::DOWN == state) { - if(!mActivate) - { - mActivate = true; - mGaussianBlurView.Activate(); + ToggleBlurState(); + } - mOnLabel.SetProperty(Actor::Property::VISIBLE, true); - mOffLabel.SetProperty(Actor::Property::VISIBLE, false); - } - else - { - mActivate = false; - mGaussianBlurView.Deactivate(); + return true; + } - mOnLabel.SetProperty(Actor::Property::VISIBLE, false); - mOffLabel.SetProperty(Actor::Property::VISIBLE, true); - } + void ToggleBlurState() + { + if(!mActivate) + { + mActivate = true; + mGaussianBlurView.Activate(); + + mOnLabel.SetProperty(Actor::Property::VISIBLE, true); + mOffLabel.SetProperty(Actor::Property::VISIBLE, false); } + else + { + mActivate = false; + mGaussianBlurView.Deactivate(); - return true; + mOnLabel.SetProperty(Actor::Property::VISIBLE, false); + mOffLabel.SetProperty(Actor::Property::VISIBLE, true); + } } void OnKeyEvent(const KeyEvent& event) @@ -145,6 +150,10 @@ private: { mApplication.Quit(); } + else if(!event.GetKeyName().compare("1")) + { + ToggleBlurState(); + } } }