Revert "Remove ScrollViewCustomEffect"
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / utc-Dali-ScrollViewEffect.cpp
1 /*
2  * Copyright (c) 2014 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
18 #include <iostream>
19 #include <stdlib.h>
20
21 // Need to override adaptor classes for toolkit test harness, so include
22 // test harness headers before dali headers.
23 #include <dali-toolkit-test-suite-utils.h>
24
25 #include <dali.h>
26 #include <dali-toolkit/dali-toolkit.h>
27 #include <dali/integration-api/events/touch-event-integ.h>
28 #include <dali/integration-api/events/pan-gesture-event.h>
29
30 using namespace Dali;
31 using namespace Toolkit;
32
33 void utc_dali_toolkit_scroll_view_effect_startup(void)
34 {
35   test_return_value = TET_UNDEF;
36 }
37
38 void utc_dali_toolkit_scroll_view_effect_cleanup(void)
39 {
40   test_return_value = TET_PASS;
41 }
42
43 namespace
44 {
45
46 const int MILLISECONDS_PER_SECOND = 1000;
47 const int RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
48 const int RENDER_ANIMATION_TEST_DURATION_MS = 1000;             ///< 1000ms to test animation
49 const int RENDER_DELAY_SCROLL = 1000;                           ///< duration to wait for any scroll to complete.
50
51 /*
52  * Simulate time passed by.
53  *
54  * @note this will always process at least 1 frame (1/60 sec)
55  *
56  * @param application Test application instance
57  * @param duration Time to pass in milliseconds.
58  * @return The actual time passed in milliseconds
59  */
60 int Wait(ToolkitTestApplication& application, int duration = 0)
61 {
62   int time = 0;
63
64   for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
65   {
66     application.SendNotification();
67     application.Render(RENDER_FRAME_INTERVAL);
68     time += RENDER_FRAME_INTERVAL;
69   }
70
71   return time;
72 }
73
74 /**
75  * Creates a Ruler that snaps to a specified grid size.
76  * If that grid size is 0.0 then this ruler does not
77  * snap.
78  *
79  * @param[in] gridSize (optional) The grid size for the ruler,
80  * (Default = 0.0 i.e. no snapping)
81  * @return The ruler is returned.
82  */
83 RulerPtr CreateRuler(float gridSize = 0.0f)
84 {
85   if(gridSize <= Math::MACHINE_EPSILON_0)
86   {
87       return new DefaultRuler();
88   }
89   return new FixedRuler(gridSize);
90 }
91
92 // Callback probes.
93
94 static bool gOnScrollStartCalled;                       ///< Whether the OnScrollStart signal was invoked.
95 static bool gOnScrollUpdateCalled;                      ///< Whether the OnScrollUpdate signal was invoked.
96 static bool gOnScrollCompleteCalled;                    ///< Whether the OnScrollComplete signal was invoked.
97 static Vector3 gConstraintResult;                       ///< Result from constraint.
98
99 static ActorContainer gPages;                                ///< Keeps track of all the pages for applying effects.
100
101 static void ResetScrollCallbackResults()
102 {
103   gOnScrollStartCalled = false;
104   gOnScrollUpdateCalled = false;
105   gOnScrollCompleteCalled = false;
106 }
107
108 /**
109  * Invoked when scrolling starts.
110  *
111  * @param[in] position The current scroll position.
112  */
113 static void OnScrollStart( const Vector3& position )
114 {
115   gOnScrollStartCalled = true;
116 }
117
118 /**
119  * Invoked when scrolling updates (via dragging)
120  *
121  * @param[in] position The current scroll position.
122  */
123 static void OnScrollUpdate( const Vector3& position )
124 {
125   gOnScrollUpdateCalled = true;
126 }
127
128 /**
129  * Invoked when scrolling finishes
130  *
131  * @param[in] position The current scroll position.
132  */
133 static void OnScrollComplete( const Vector3& position )
134 {
135   gOnScrollCompleteCalled = true;
136 }
137
138 ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
139 {
140   ScrollView scrollView = ScrollView::New();
141   scrollView.SetSize(size);
142   scrollView.SetAnchorPoint(AnchorPoint::CENTER);
143   scrollView.SetParentOrigin(ParentOrigin::CENTER);
144   scrollView.ApplyConstraint( Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::EqualToConstraint() ) );
145   scrollView.SetWrapMode(false);
146   scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
147   scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
148   scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
149   Stage::GetCurrent().Add( scrollView );
150   RulerPtr rulerX = CreateRuler(size.width);
151   RulerPtr rulerY = CreateRuler(size.height);
152   if(columns > 1)
153   {
154     rulerX->SetDomain(RulerDomain(0.0f, size.width * columns));
155   }
156   else
157   {
158     rulerX->Disable();
159   }
160   if(rows > 1)
161   {
162     rulerY->SetDomain(RulerDomain(0.0f, size.width * rows));
163   }
164   else
165   {
166     rulerY->Disable();
167   }
168
169   scrollView.SetRulerX( rulerX );
170   scrollView.SetRulerY( rulerY );
171   Stage::GetCurrent().Add( scrollView );
172
173   Actor container = Actor::New();
174   container.SetParentOrigin(ParentOrigin::CENTER);
175   container.SetAnchorPoint(AnchorPoint::CENTER);
176   container.SetSize( size );
177   scrollView.Add( container );
178   container.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
179
180   gPages.clear();
181   for(int row = 0;row<rows;row++)
182   {
183     for(int column = 0;column<columns;column++)
184     {
185       Actor page = Actor::New();
186       page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
187       page.SetParentOrigin( ParentOrigin::CENTER );
188       page.SetAnchorPoint( AnchorPoint::CENTER );
189       page.SetPosition( column * size.x, row * size.y );
190       container.Add(page);
191
192       gPages.push_back(page);
193     }
194   }
195
196   ResetScrollCallbackResults();
197   return scrollView;
198 }
199
200 void CleanupTest()
201 {
202   gPages.clear();
203   ResetScrollCallbackResults();
204 }
205
206 Actor AddActorToPage(Actor page, float x, float y, float cols, float rows)
207 {
208   Stage stage = Stage::GetCurrent();
209   Vector2 stageSize = stage.GetSize();
210
211   const float margin = 10.0f;
212   const Vector2 actorSize((stageSize.x / cols) - margin, (stageSize.y / rows) - margin);
213
214   Actor actor = Actor::New();
215   actor.SetParentOrigin( ParentOrigin::CENTER );
216   actor.SetAnchorPoint( AnchorPoint::CENTER );
217
218   Vector3 position( margin * 0.5f + (actorSize.x + margin) * x - stageSize.width * 0.5f,
219                     margin * 0.5f + (actorSize.y + margin) * y - stageSize.height * 0.5f,
220                     0.0f);
221   Vector3 positionEnd( margin * 0.5f + (actorSize.x + margin) * (x + cols) - stageSize.width * 0.5f - margin,
222                        margin * 0.5f + (actorSize.y + margin) * (y + rows) - stageSize.height * 0.5f - margin,
223                        0.0f);
224   Vector3 size(positionEnd - position);
225   actor.SetPosition( position + size * 0.5f);
226   actor.SetSize( positionEnd - position );
227   page.Add(actor);
228   return actor;
229 }
230
231 } // unnamed namespace
232
233
234 int UtcDaliScrollViewCustomEffectSetup(void)
235 {
236   tet_infoline(" UtcDaliScrollViewCustomEffectSetup");
237
238   ScrollViewCustomEffect effect;
239
240   DALI_TEST_CHECK( !effect );
241
242   BaseHandle handle = ScrollViewCustomEffect::New();
243
244   DALI_TEST_CHECK( handle );
245
246   effect = ScrollViewCustomEffect::DownCast(handle);
247
248   DALI_TEST_CHECK( effect );
249
250   END_TEST;
251 }
252
253 int UtcDaliScrollViewCubeEffectSetup(void)
254 {
255   tet_infoline(" UtcDaliScrollViewCubeEffectSetup");
256
257   ScrollViewCubeEffect effect;
258
259   DALI_TEST_CHECK( !effect );
260
261   BaseHandle handle = ScrollViewCubeEffect::New();
262
263   DALI_TEST_CHECK( handle );
264
265   effect = ScrollViewCubeEffect::DownCast(handle);
266
267   DALI_TEST_CHECK( effect );
268   END_TEST;
269 }
270
271 int UtcDaliScrollViewSpiralEffectSetup(void)
272 {
273   tet_infoline(" UtcDaliScrollViewSpiralEffectSetup");
274
275   ScrollViewPageSpiralEffect effect;
276
277   DALI_TEST_CHECK( !effect );
278
279   BaseHandle handle = ScrollViewPageSpiralEffect::New();
280
281   DALI_TEST_CHECK( handle );
282
283   effect = ScrollViewPageSpiralEffect::DownCast(handle);
284
285   DALI_TEST_CHECK( effect );
286   END_TEST;
287 }
288
289
290
291
292 int UtcDaliScrollViewSlideEffectSetup(void)
293 {
294   tet_infoline(" UtcDaliScrollViewSlideEffectSetup");
295
296   ScrollViewSlideEffect effect;
297
298   DALI_TEST_CHECK( !effect );
299
300   BaseHandle handle = ScrollViewSlideEffect::New();
301
302   DALI_TEST_CHECK( handle );
303
304   effect = ScrollViewSlideEffect::DownCast(handle);
305
306   DALI_TEST_CHECK( effect );
307   END_TEST;
308 }
309
310 int UtcDaliScrollViewCubeEffectTest(void)
311 {
312   ToolkitTestApplication application;
313   tet_infoline(" UtcDaliScrollViewCubeEffectTest");
314
315   Vector2 size = Stage::GetCurrent().GetSize();
316
317   ScrollView scrollView = SetupTestScrollView(1, 3, size);
318   Actor page = gPages[1];
319   Wait(application, 500);
320
321   ScrollViewCubeEffect effect = ScrollViewCubeEffect::New();
322   scrollView.ApplyEffect(effect);
323
324   Actor actor = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
325   Wait(application);
326   Vector3 actorPrePosition = actor.GetCurrentPosition();
327
328   effect.ApplyToActor(actor, page, Vector3(-105.0f, 30.0f, -240.0f), Vector2(Math::PI * 0.5f, Math::PI * 0.5f), Vector2(0.25f, 0.25f) * size);
329
330   Actor actor2 = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
331   effect.ApplyToActor(actor2, Vector3(-105.0f, 30.0f, -240.0f), Vector2(Math::PI * 0.5f, Math::PI * 0.5f), Vector2(0.25f, 0.25f) * size);
332
333   scrollView.ScrollTo(1);
334   while(!gOnScrollCompleteCalled)
335   {
336     Wait(application);
337   }
338   // test that the first page has reached centre of screen
339   Vector3 actorPostPosition = actor.GetCurrentPosition();
340   // just check the actor has moved
341   DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
342   CleanupTest();
343   END_TEST;
344 }
345
346
347 int UtcDaliScrollViewSpiralEffectTest(void)
348 {
349   ToolkitTestApplication application;
350   tet_infoline(" UtcDaliScrollViewSpiralEffectTest");
351
352   Vector2 size = Stage::GetCurrent().GetSize();
353
354   ScrollView scrollView = SetupTestScrollView(1, 3, size);
355   Actor testPage = gPages[1];
356   Wait(application, 500);
357
358   ScrollViewPageSpiralEffect effect = ScrollViewPageSpiralEffect::New();
359   scrollView.ApplyEffect(effect);
360
361   for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
362   {
363     Actor page = *pageIter;
364     page.RemoveConstraints();
365     page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
366     effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
367   }
368   Wait(application);
369
370   scrollView.ScrollTo(1);
371   while(!gOnScrollCompleteCalled)
372   {
373     Wait(application);
374   }
375   // test that the first page has reached centre of screen
376   Vector3 pagePos = testPage.GetCurrentPosition();
377   DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
378   CleanupTest();
379   END_TEST;
380 }
381
382
383
384 int UtcDaliScrollViewSlideEffectTest(void)
385 {
386   ToolkitTestApplication application;
387   tet_infoline(" UtcDaliScrollViewSlideEffectTest");
388
389   Vector2 size = Stage::GetCurrent().GetSize();
390   Vector3 pageSize(size.x, size.y, 0.0f);
391
392   ScrollView scrollView = SetupTestScrollView(1, 3, size);
393   Actor testPage = gPages[1];
394   Wait(application, 500);
395
396   ScrollViewSlideEffect effect = ScrollViewSlideEffect::New();
397   effect.SetDelayReferenceOffset(pageSize * 0.25);
398   DALI_TEST_EQUALS(effect.GetDelayReferenceOffset(), pageSize * 0.25, Math::MACHINE_EPSILON_0, TEST_LOCATION);
399   effect.SetMaxDelayDuration(0.5f);
400   DALI_TEST_EQUALS(effect.GetMaxDelayDuration(), 0.5f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
401   effect.SetSlideDirection(false);
402   DALI_TEST_CHECK(!effect.GetSlideDirection());
403
404   scrollView.ApplyEffect(effect);
405
406   Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3);
407   Wait(application);
408   Vector3 actorPrePosition = actor.GetCurrentPosition();
409
410   effect.ApplyToActor(actor, 0.0f, 0.5f);
411
412   scrollView.ScrollTo(1);
413   while(!gOnScrollCompleteCalled)
414   {
415     Wait(application);
416   }
417   // test that the first page has reached centre of screen
418   Vector3 actorPostPosition = actor.GetCurrentPosition();
419   // just check the actor has moved
420   DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
421   CleanupTest();
422   END_TEST;
423 }
424
425 int UtcDaliScrollViewCustomEffectTest(void)
426 {
427   ToolkitTestApplication application;
428   tet_infoline(" UtcDaliScrollViewCustomEffectTest");
429
430   Vector2 size = Stage::GetCurrent().GetSize();
431   Vector3 pageSize(size.x, size.y, 0.0f);
432
433   ScrollView scrollView = SetupTestScrollView(1, 3, size);
434   Actor testPage = gPages[1];
435   Wait(application, 500);
436   Vector3 pageStartPos, pagePos;
437   pageStartPos = pagePos = testPage.GetCurrentPosition();
438   //scrollView.RemoveConstraintsFromChildren();
439
440   ScrollViewCustomEffect effect = ScrollViewCustomEffect::DownCast(scrollView.ApplyEffect(ScrollView::PageEffectCarousel));
441
442   for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
443   {
444     Actor page = *pageIter;
445     page.RemoveConstraints();
446     page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
447     effect.ApplyToPage(page, pageSize);
448   }
449   Wait(application);
450   pagePos = testPage.GetCurrentPosition();
451   DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
452
453   scrollView.ScrollTo(1);
454   while(!gOnScrollCompleteCalled)
455   {
456     Wait(application);
457   }
458   ResetScrollCallbackResults();
459   // test that the first page has reached centre of screen
460   pagePos = testPage.GetCurrentPosition();
461   DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
462
463   // scroll back to page 0
464   scrollView.ScrollTo(0);
465   while(!gOnScrollCompleteCalled)
466   {
467     Wait(application);
468   }
469   ResetScrollCallbackResults();
470   pagePos = testPage.GetCurrentPosition();
471   DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
472
473   scrollView.RemoveEffect(effect);
474
475   effect = ScrollViewCustomEffect::New();
476   effect.SetPageTranslation(Vector3(20.0f, 20.0f, 5.0f));
477   effect.SetPageTranslation(Vector3(20.0f, 20.0f, 5.0f), Vector3(20.0f, 20.0f, -5.0f));
478   effect.SetPageTranslationIn(Vector3(20.0f, 20.0f, 5.0f));
479   effect.SetPageTranslationOut(Vector3(20.0f, 20.0f, -5.0f));
480   effect.SetPageTranslation(Vector3(20.0f, 0.0f, 0.0f));
481   effect.SetSwingAngle(Math::PI, Vector3::YAXIS);
482   effect.SetPageSpacing(Vector2(20.0f, 20.0f));
483   scrollView.ApplyEffect(effect);
484
485   for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
486   {
487     Actor page = *pageIter;
488     page.RemoveConstraints();
489     page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
490     effect.ApplyToPage(page, pageSize);
491   }
492   Wait(application);
493   pagePos = testPage.GetCurrentPosition();
494   DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
495
496   scrollView.ScrollTo(1);
497   while(!gOnScrollCompleteCalled)
498   {
499     Wait(application);
500   }
501   ResetScrollCallbackResults();
502   // test that the first page has reached centre of screen
503   pagePos = testPage.GetCurrentPosition();
504   DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
505
506   // scroll back to page 0
507   scrollView.ScrollTo(0);
508   while(!gOnScrollCompleteCalled)
509   {
510     Wait(application);
511   }
512   ResetScrollCallbackResults();
513   pagePos = testPage.GetCurrentPosition();
514   DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
515
516   scrollView.RemoveEffect(effect);
517   effect = ScrollViewCustomEffect::New();
518   effect.SetSwingAngle(Math::PI, Vector3::YAXIS);
519   effect.SetSwingAnchor(AnchorPoint::CENTER_LEFT);
520   effect.SetPageTranslation(Vector3(size.x, size.y, 0));
521   effect.SetOpacityThreshold(0.66f);
522   scrollView.ApplyEffect(effect);
523
524   for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
525   {
526     Actor page = *pageIter;
527     page.RemoveConstraints();
528     page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
529     effect.ApplyToPage(page, pageSize);
530   }
531   Wait(application);
532
533   scrollView.ScrollTo(1);
534   while(!gOnScrollCompleteCalled)
535   {
536     Wait(application);
537   }
538   ResetScrollCallbackResults();
539   // test that the first page has reached centre of screen
540   pagePos = testPage.GetCurrentPosition();
541   DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
542
543   // scroll back to page 0
544   scrollView.ScrollTo(0);
545   while(!gOnScrollCompleteCalled)
546   {
547     Wait(application);
548   }
549   ResetScrollCallbackResults();
550   pagePos = testPage.GetCurrentPosition();
551   DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
552   scrollView.RemoveEffect(effect);
553
554
555   effect.SetPageTranslateAlphaFunction(AlphaFunctions::Linear);
556   effect.SetPageTranslateAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
557   effect.SetPageTranslateAlphaFunctionIn(AlphaFunctions::Linear);
558   effect.SetPageTranslateAlphaFunctionOut(AlphaFunctions::Linear);
559   effect.SetGlobalPageRotation(Math::PI, Vector3::YAXIS);
560   effect.SetAngledOriginPageRotation(Vector3(Math::PI, Math::PI, 0.0f));
561   effect.SetGlobalPageRotation(Math::PI, Vector3::YAXIS, Math::PI, Vector3::YAXIS);
562   effect.SetGlobalPageRotationIn(Math::PI, Vector3::YAXIS);
563   effect.SetGlobalPageRotationOut(Math::PI, Vector3::YAXIS);
564   effect.SetGlobalPageRotationOrigin(Vector3::ZERO);
565   effect.SetGlobalPageRotationOrigin(Vector3::ZERO, Vector3::ZERO);
566   effect.SetGlobalPageRotationOriginIn(Vector3::ZERO);
567   effect.SetGlobalPageRotationOriginOut(Vector3::ZERO);
568   effect.SetSwingAngle(Math::PI, Vector3::YAXIS);
569   effect.SetSwingAngle(Math::PI, Vector3::YAXIS, Math::PI, Vector3::YAXIS);
570   effect.SetSwingAngleIn(Math::PI, Vector3::YAXIS);
571   effect.SetSwingAngleOut(Math::PI, Vector3::YAXIS);
572   effect.SetSwingAngleAlphaFunction(AlphaFunctions::Linear);
573   effect.SetSwingAngleAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
574   effect.SetSwingAngleAlphaFunctionIn(AlphaFunctions::Linear);
575   effect.SetSwingAngleAlphaFunctionOut(AlphaFunctions::Linear);
576   effect.SetSwingAnchor(AnchorPoint::CENTER, AnchorPoint::CENTER_LEFT);
577   effect.SetSwingAnchorIn(AnchorPoint::CENTER);
578   effect.SetSwingAnchorOut(AnchorPoint::CENTER);
579   effect.SetSwingAnchorAlphaFunction(AlphaFunctions::Linear);
580   effect.SetSwingAnchorAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
581   effect.SetSwingAnchorAlphaFunctionIn(AlphaFunctions::Linear);
582   effect.SetSwingAnchorAlphaFunctionOut(AlphaFunctions::Linear);
583   effect.SetOpacityThreshold(0.5f);
584   effect.SetOpacityThreshold(0.5f, 0.5f);
585   effect.SetOpacityThresholdIn(0.5f);
586   effect.SetOpacityThresholdOut(0.5f);
587   effect.SetOpacityAlphaFunction(AlphaFunctions::Linear);
588   effect.SetOpacityAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
589   effect.SetOpacityAlphaFunctionIn(AlphaFunctions::Linear);
590   effect.SetOpacityAlphaFunctionOut(AlphaFunctions::Linear);
591   CleanupTest();
592   END_TEST;
593 }