Added key control to gaussian-blur-view.example 85/305885/2
authorDavid Steele <david.steele@samsung.com>
Mon, 12 Feb 2024 18:50:03 +0000 (18:50 +0000)
committerDavid Steele <david.steele@samsung.com>
Thu, 15 Feb 2024 16:29:30 +0000 (16:29 +0000)
Change-Id: I4cff9ec6adcd7d00f899bf9b15dd0dc172284065

examples/gaussian-blur-view/README.md [new file with mode: 0644]
examples/gaussian-blur-view/gaussian-blur-view-example.cpp

diff --git a/examples/gaussian-blur-view/README.md b/examples/gaussian-blur-view/README.md
new file mode 100644 (file)
index 0000000..7d53456
--- /dev/null
@@ -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.
index e9ff1cc..83defd3 100644 (file)
@@ -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();
+      }
     }
   }