Commit 02f3725ad7bd2772cec5a2ffa49c2a8535225a69

Authored by David Steele
1 parent ff71a968

Added key control to gaussian-blur-view.example

Change-Id: I4cff9ec6adcd7d00f899bf9b15dd0dc172284065
examples/gaussian-blur-view/README.md 0 → 100644
  1 +This example shows the GuassianBlurView in action.
  2 +
  3 +Press 1, touch or click in order to toggle the blurring.
  4 +
  5 +Used to test render tasks, frame buffers and fence syncs.
... ...
examples/gaussian-blur-view/gaussian-blur-view-example.cpp
... ... @@ -116,25 +116,30 @@ private:
116 116  
117 117 if(PointState::DOWN == state)
118 118 {
119   - if(!mActivate)
120   - {
121   - mActivate = true;
122   - mGaussianBlurView.Activate();
  119 + ToggleBlurState();
  120 + }
123 121  
124   - mOnLabel.SetProperty(Actor::Property::VISIBLE, true);
125   - mOffLabel.SetProperty(Actor::Property::VISIBLE, false);
126   - }
127   - else
128   - {
129   - mActivate = false;
130   - mGaussianBlurView.Deactivate();
  122 + return true;
  123 + }
131 124  
132   - mOnLabel.SetProperty(Actor::Property::VISIBLE, false);
133   - mOffLabel.SetProperty(Actor::Property::VISIBLE, true);
134   - }
  125 + void ToggleBlurState()
  126 + {
  127 + if(!mActivate)
  128 + {
  129 + mActivate = true;
  130 + mGaussianBlurView.Activate();
  131 +
  132 + mOnLabel.SetProperty(Actor::Property::VISIBLE, true);
  133 + mOffLabel.SetProperty(Actor::Property::VISIBLE, false);
135 134 }
  135 + else
  136 + {
  137 + mActivate = false;
  138 + mGaussianBlurView.Deactivate();
136 139  
137   - return true;
  140 + mOnLabel.SetProperty(Actor::Property::VISIBLE, false);
  141 + mOffLabel.SetProperty(Actor::Property::VISIBLE, true);
  142 + }
138 143 }
139 144  
140 145 void OnKeyEvent(const KeyEvent& event)
... ... @@ -145,6 +150,10 @@ private:
145 150 {
146 151 mApplication.Quit();
147 152 }
  153 + else if(!event.GetKeyName().compare("1"))
  154 + {
  155 + ToggleBlurState();
  156 + }
148 157 }
149 158 }
150 159  
... ...