2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
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>
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>
31 using namespace Toolkit;
33 void utc_dali_toolkit_scroll_view_effect_startup(void)
35 test_return_value = TET_UNDEF;
38 void utc_dali_toolkit_scroll_view_effect_cleanup(void)
40 test_return_value = TET_PASS;
45 static bool gObjectCreatedCallBackCalled;
47 static void TestCallback(BaseHandle handle)
49 gObjectCreatedCallBackCalled = true;
52 const int MILLISECONDS_PER_SECOND = 1000;
53 const int RENDER_FRAME_INTERVAL = 16; ///< Duration of each frame in ms. (at approx 60FPS)
54 const int RENDER_ANIMATION_TEST_DURATION_MS = 1000; ///< 1000ms to test animation
55 const int RENDER_DELAY_SCROLL = 1000; ///< duration to wait for any scroll to complete.
58 * Simulate time passed by.
60 * @note this will always process at least 1 frame (1/60 sec)
62 * @param application Test application instance
63 * @param duration Time to pass in milliseconds.
64 * @return The actual time passed in milliseconds
66 int Wait(ToolkitTestApplication& application, int duration = 0)
70 for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
72 application.SendNotification();
73 application.Render(RENDER_FRAME_INTERVAL);
74 time += RENDER_FRAME_INTERVAL;
81 * Creates a Ruler that snaps to a specified grid size.
82 * If that grid size is 0.0 then this ruler does not
85 * @param[in] gridSize (optional) The grid size for the ruler,
86 * (Default = 0.0 i.e. no snapping)
87 * @return The ruler is returned.
89 RulerPtr CreateRuler(float gridSize = 0.0f)
91 if(gridSize <= Math::MACHINE_EPSILON_0)
93 return new DefaultRuler();
95 return new FixedRuler(gridSize);
100 static bool gOnScrollStartCalled; ///< Whether the OnScrollStart signal was invoked.
101 static bool gOnScrollUpdateCalled; ///< Whether the OnScrollUpdate signal was invoked.
102 static bool gOnScrollCompleteCalled; ///< Whether the OnScrollComplete signal was invoked.
103 static bool gOnScrollClampedCalled; ///< Whether the OnScrollClamped signal was invoked.
104 static bool gOnSnapStartCalled; ///< Whether the OnSnapStart signal was invoked.
105 static ClampState3 gLastClampPosition; ///< Clamping information from OnScrollClampedEvent.
106 static SnapType gLastSnapType; ///< Snaping information from SnapEvent.
107 static Vector3 gConstraintResult; ///< Result from constraint.
109 static ActorContainer gPages; ///< Keeps track of all the pages for applying effects.
111 static void ResetScrollCallbackResults()
113 gOnScrollStartCalled = false;
114 gOnScrollUpdateCalled = false;
115 gOnScrollCompleteCalled = false;
119 * Invoked when scrolling starts.
121 * @param[in] position The current scroll position.
123 static void OnScrollStart( const Vector3& position )
125 gOnScrollStartCalled = true;
129 * Invoked when scrolling updates (via dragging)
131 * @param[in] position The current scroll position.
133 static void OnScrollUpdate( const Vector3& position )
135 gOnScrollUpdateCalled = true;
139 * Invoked when scrolling finishes
141 * @param[in] position The current scroll position.
143 static void OnScrollComplete( const Vector3& position )
145 gOnScrollCompleteCalled = true;
149 * Invoked when scrolling clamped.
151 * @param[in] event The position/scale/rotation axes that were clamped.
153 static void OnScrollClamped( const ScrollView::ClampEvent& event )
155 gOnScrollClampedCalled = true;
156 gLastClampPosition = event.position;
160 * Invoked when a snap or flick started.
162 * @param[in] event The type of snap and the target position/scale/rotation.
164 static void OnSnapStart( const ScrollView::SnapEvent& event )
166 gOnSnapStartCalled = true;
167 gLastSnapType = event.type;
170 ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
172 ScrollView scrollView = ScrollView::New();
173 scrollView.SetSize(size);
174 scrollView.SetAnchorPoint(AnchorPoint::CENTER);
175 scrollView.SetParentOrigin(ParentOrigin::CENTER);
176 scrollView.ApplyConstraint( Constraint::New<Dali::Vector3>( Dali::Actor::SIZE, Dali::ParentSource( Dali::Actor::SIZE ), Dali::EqualToConstraint() ) );
177 scrollView.SetWrapMode(false);
178 scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
179 scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
180 scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
181 Stage::GetCurrent().Add( scrollView );
182 RulerPtr rulerX = CreateRuler(size.width);
183 RulerPtr rulerY = CreateRuler(size.height);
186 rulerX->SetDomain(RulerDomain(0.0f, size.width * columns));
194 rulerY->SetDomain(RulerDomain(0.0f, size.width * rows));
201 scrollView.SetRulerX( rulerX );
202 scrollView.SetRulerY( rulerY );
203 Stage::GetCurrent().Add( scrollView );
205 Actor container = Actor::New();
206 container.SetParentOrigin(ParentOrigin::CENTER);
207 container.SetAnchorPoint(AnchorPoint::CENTER);
208 container.SetSize( size );
209 scrollView.Add( container );
210 container.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
213 for(int row = 0;row<rows;row++)
215 for(int column = 0;column<columns;column++)
217 Actor page = Actor::New();
218 page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
219 page.SetParentOrigin( ParentOrigin::CENTER );
220 page.SetAnchorPoint( AnchorPoint::CENTER );
221 page.SetPosition( column * size.x, row * size.y );
224 gPages.push_back(page);
228 ResetScrollCallbackResults();
235 ResetScrollCallbackResults();
238 Actor AddActorToPage(Actor page, float x, float y, float cols, float rows)
240 Stage stage = Stage::GetCurrent();
241 Vector2 stageSize = stage.GetSize();
243 const float margin = 10.0f;
244 const Vector2 actorSize((stageSize.x / cols) - margin, (stageSize.y / rows) - margin);
246 Actor actor = Actor::New();
247 actor.SetParentOrigin( ParentOrigin::CENTER );
248 actor.SetAnchorPoint( AnchorPoint::CENTER );
250 Vector3 position( margin * 0.5f + (actorSize.x + margin) * x - stageSize.width * 0.5f,
251 margin * 0.5f + (actorSize.y + margin) * y - stageSize.height * 0.5f,
253 Vector3 positionEnd( margin * 0.5f + (actorSize.x + margin) * (x + cols) - stageSize.width * 0.5f - margin,
254 margin * 0.5f + (actorSize.y + margin) * (y + rows) - stageSize.height * 0.5f - margin,
256 Vector3 size(positionEnd - position);
257 actor.SetPosition( position + size * 0.5f);
258 actor.SetSize( positionEnd - position );
263 } // unnamed namespace
266 int UtcDaliScrollViewCustomEffectSetup(void)
268 tet_infoline(" UtcDaliScrollViewCustomEffectSetup");
270 ScrollViewCustomEffect effect;
272 DALI_TEST_CHECK( !effect );
274 BaseHandle handle = ScrollViewCustomEffect::New();
276 DALI_TEST_CHECK( handle );
278 effect = ScrollViewCustomEffect::DownCast(handle);
280 DALI_TEST_CHECK( effect );
285 int UtcDaliScrollViewCubeEffectSetup(void)
287 tet_infoline(" UtcDaliScrollViewCubeEffectSetup");
289 ScrollViewCubeEffect effect;
291 DALI_TEST_CHECK( !effect );
293 BaseHandle handle = ScrollViewCubeEffect::New();
295 DALI_TEST_CHECK( handle );
297 effect = ScrollViewCubeEffect::DownCast(handle);
299 DALI_TEST_CHECK( effect );
303 int UtcDaliScrollViewSpiralEffectSetup(void)
305 tet_infoline(" UtcDaliScrollViewSpiralEffectSetup");
307 ScrollViewPageSpiralEffect effect;
309 DALI_TEST_CHECK( !effect );
311 BaseHandle handle = ScrollViewPageSpiralEffect::New();
313 DALI_TEST_CHECK( handle );
315 effect = ScrollViewPageSpiralEffect::DownCast(handle);
317 DALI_TEST_CHECK( effect );
324 int UtcDaliScrollViewSlideEffectSetup(void)
326 tet_infoline(" UtcDaliScrollViewSlideEffectSetup");
328 ScrollViewSlideEffect effect;
330 DALI_TEST_CHECK( !effect );
332 BaseHandle handle = ScrollViewSlideEffect::New();
334 DALI_TEST_CHECK( handle );
336 effect = ScrollViewSlideEffect::DownCast(handle);
338 DALI_TEST_CHECK( effect );
342 int UtcDaliScrollViewTwistEffectSetup(void)
344 tet_infoline(" UtcDaliScrollViewTwistEffectSetup");
346 ScrollViewTwistEffect effect;
348 DALI_TEST_CHECK( !effect );
350 BaseHandle handle = ScrollViewTwistEffect::New();
352 DALI_TEST_CHECK( handle );
354 effect = ScrollViewTwistEffect::DownCast(handle);
356 DALI_TEST_CHECK( effect );
360 int UtcDaliScrollViewCubeEffectTest(void)
362 ToolkitTestApplication application;
363 tet_infoline(" UtcDaliScrollViewCubeEffectTest");
365 Vector2 size = Stage::GetCurrent().GetSize();
367 ScrollView scrollView = SetupTestScrollView(1, 3, size);
368 Actor page = gPages[1];
369 Wait(application, 500);
371 ScrollViewCubeEffect effect = ScrollViewCubeEffect::New();
372 scrollView.ApplyEffect(effect);
374 Actor actor = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
376 Vector3 actorPrePosition = actor.GetCurrentPosition();
378 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);
380 Actor actor2 = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
381 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);
383 scrollView.ScrollTo(1);
384 while(!gOnScrollCompleteCalled)
388 // test that the first page has reached centre of screen
389 Vector3 actorPostPosition = actor.GetCurrentPosition();
390 // just check the actor has moved
391 DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
397 int UtcDaliScrollViewSpiralEffectTest(void)
399 ToolkitTestApplication application;
400 tet_infoline(" UtcDaliScrollViewSpiralEffectTest");
402 Vector2 size = Stage::GetCurrent().GetSize();
404 ScrollView scrollView = SetupTestScrollView(1, 3, size);
405 Actor testPage = gPages[1];
406 Wait(application, 500);
408 ScrollViewPageSpiralEffect effect = ScrollViewPageSpiralEffect::New();
409 scrollView.ApplyEffect(effect);
411 for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
413 Actor page = *pageIter;
414 page.RemoveConstraints();
415 page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
416 effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
420 scrollView.ScrollTo(1);
421 while(!gOnScrollCompleteCalled)
425 // test that the first page has reached centre of screen
426 Vector3 pagePos = testPage.GetCurrentPosition();
427 DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
434 int UtcDaliScrollViewSlideEffectTest(void)
436 ToolkitTestApplication application;
437 tet_infoline(" UtcDaliScrollViewSlideEffectTest");
439 Vector2 size = Stage::GetCurrent().GetSize();
440 Vector3 pageSize(size.x, size.y, 0.0f);
442 ScrollView scrollView = SetupTestScrollView(1, 3, size);
443 Actor testPage = gPages[1];
444 Wait(application, 500);
446 ScrollViewSlideEffect effect = ScrollViewSlideEffect::New();
447 effect.SetDelayReferenceOffset(pageSize * 0.25);
448 DALI_TEST_EQUALS(effect.GetDelayReferenceOffset(), pageSize * 0.25, Math::MACHINE_EPSILON_0, TEST_LOCATION);
449 effect.SetMaxDelayDuration(0.5f);
450 DALI_TEST_EQUALS(effect.GetMaxDelayDuration(), 0.5f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
451 effect.SetSlideDirection(false);
452 DALI_TEST_CHECK(!effect.GetSlideDirection());
454 scrollView.ApplyEffect(effect);
456 Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3);
458 Vector3 actorPrePosition = actor.GetCurrentPosition();
460 effect.ApplyToActor(actor, 0.0f, 0.5f);
462 scrollView.ScrollTo(1);
463 while(!gOnScrollCompleteCalled)
467 // test that the first page has reached centre of screen
468 Vector3 actorPostPosition = actor.GetCurrentPosition();
469 // just check the actor has moved
470 DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
475 int UtcDaliScrollViewTwistEffectTest(void)
477 ToolkitTestApplication application;
478 tet_infoline(" UtcDaliScrollViewTwistEffectTest");
480 Vector2 size = Stage::GetCurrent().GetSize();
482 ScrollView scrollView = SetupTestScrollView(1, 3, size);
483 Actor testPage = gPages[1];
484 Wait(application, 500);
486 ScrollViewTwistEffect effect = ScrollViewTwistEffect::New();
487 float shrinkDist = 0.2f;
488 effect.SetMinimumDistanceForShrink(shrinkDist);
489 DALI_TEST_CHECK((shrinkDist - effect.GetMinimumDistanceForShrink()) < Math::MACHINE_EPSILON_0);
490 effect.EnableEffect(true);
491 scrollView.ApplyEffect(effect);
493 Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3);
495 Vector3 actorPrePosition = actor.GetCurrentPosition();
497 effect.ApplyToActor( actor,
499 Vector2(Math::PI_2, Math::PI_2),
502 scrollView.ScrollTo(1);
503 while(!gOnScrollCompleteCalled)
507 // test that the first page has reached centre of screen
508 Vector3 actorPostPosition = actor.GetCurrentPosition();
509 // just check the actor has moved
510 DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
515 int UtcDaliScrollViewCustomEffectTest(void)
517 ToolkitTestApplication application;
518 tet_infoline(" UtcDaliScrollViewCustomEffectTest");
520 Vector2 size = Stage::GetCurrent().GetSize();
521 Vector3 pageSize(size.x, size.y, 0.0f);
523 ScrollView scrollView = SetupTestScrollView(1, 3, size);
524 Actor testPage = gPages[1];
525 Wait(application, 500);
526 Vector3 pageStartPos, pagePos;
527 pageStartPos = pagePos = testPage.GetCurrentPosition();
528 //scrollView.RemoveConstraintsFromChildren();
530 ScrollViewCustomEffect effect = ScrollViewCustomEffect::DownCast(scrollView.ApplyEffect(ScrollView::PageEffectCarousel));
532 for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
534 Actor page = *pageIter;
535 page.RemoveConstraints();
536 page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
537 effect.ApplyToPage(page, pageSize);
540 pagePos = testPage.GetCurrentPosition();
541 DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
543 scrollView.ScrollTo(1);
544 while(!gOnScrollCompleteCalled)
548 ResetScrollCallbackResults();
549 // test that the first page has reached centre of screen
550 pagePos = testPage.GetCurrentPosition();
551 DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
553 // scroll back to page 0
554 scrollView.ScrollTo(0);
555 while(!gOnScrollCompleteCalled)
559 ResetScrollCallbackResults();
560 pagePos = testPage.GetCurrentPosition();
561 DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
563 scrollView.RemoveEffect(effect);
565 effect = ScrollViewCustomEffect::New();
566 effect.SetPageTranslation(Vector3(20.0f, 20.0f, 5.0f));
567 effect.SetPageTranslation(Vector3(20.0f, 20.0f, 5.0f), Vector3(20.0f, 20.0f, -5.0f));
568 effect.SetPageTranslationIn(Vector3(20.0f, 20.0f, 5.0f));
569 effect.SetPageTranslationOut(Vector3(20.0f, 20.0f, -5.0f));
570 effect.SetPageTranslation(Vector3(20.0f, 0.0f, 0.0f));
571 effect.SetSwingAngle(Math::PI, Vector3::YAXIS);
572 effect.SetPageSpacing(Vector2(20.0f, 20.0f));
573 scrollView.ApplyEffect(effect);
575 for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
577 Actor page = *pageIter;
578 page.RemoveConstraints();
579 page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
580 effect.ApplyToPage(page, pageSize);
583 pagePos = testPage.GetCurrentPosition();
584 DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
586 scrollView.ScrollTo(1);
587 while(!gOnScrollCompleteCalled)
591 ResetScrollCallbackResults();
592 // test that the first page has reached centre of screen
593 pagePos = testPage.GetCurrentPosition();
594 DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
596 // scroll back to page 0
597 scrollView.ScrollTo(0);
598 while(!gOnScrollCompleteCalled)
602 ResetScrollCallbackResults();
603 pagePos = testPage.GetCurrentPosition();
604 DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
606 scrollView.RemoveEffect(effect);
607 effect = ScrollViewCustomEffect::New();
608 effect.SetSwingAngle(Math::PI, Vector3::YAXIS);
609 effect.SetSwingAnchor(AnchorPoint::CENTER_LEFT);
610 effect.SetPageTranslation(Vector3(size.x, size.y, 0));
611 effect.SetOpacityThreshold(0.66f);
612 scrollView.ApplyEffect(effect);
614 for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
616 Actor page = *pageIter;
617 page.RemoveConstraints();
618 page.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
619 effect.ApplyToPage(page, pageSize);
623 scrollView.ScrollTo(1);
624 while(!gOnScrollCompleteCalled)
628 ResetScrollCallbackResults();
629 // test that the first page has reached centre of screen
630 pagePos = testPage.GetCurrentPosition();
631 DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
633 // scroll back to page 0
634 scrollView.ScrollTo(0);
635 while(!gOnScrollCompleteCalled)
639 ResetScrollCallbackResults();
640 pagePos = testPage.GetCurrentPosition();
641 DALI_TEST_EQUALS(pagePos, pageStartPos, Math::MACHINE_EPSILON_0, TEST_LOCATION);
642 scrollView.RemoveEffect(effect);
645 effect.SetPageTranslateAlphaFunction(AlphaFunctions::Linear);
646 effect.SetPageTranslateAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
647 effect.SetPageTranslateAlphaFunctionIn(AlphaFunctions::Linear);
648 effect.SetPageTranslateAlphaFunctionOut(AlphaFunctions::Linear);
649 effect.SetGlobalPageRotation(Math::PI, Vector3::YAXIS);
650 effect.SetAngledOriginPageRotation(Vector3(Math::PI, Math::PI, 0.0f));
651 effect.SetGlobalPageRotation(Math::PI, Vector3::YAXIS, Math::PI, Vector3::YAXIS);
652 effect.SetGlobalPageRotationIn(Math::PI, Vector3::YAXIS);
653 effect.SetGlobalPageRotationOut(Math::PI, Vector3::YAXIS);
654 effect.SetGlobalPageRotationOrigin(Vector3::ZERO);
655 effect.SetGlobalPageRotationOrigin(Vector3::ZERO, Vector3::ZERO);
656 effect.SetGlobalPageRotationOriginIn(Vector3::ZERO);
657 effect.SetGlobalPageRotationOriginOut(Vector3::ZERO);
658 effect.SetSwingAngle(Math::PI, Vector3::YAXIS);
659 effect.SetSwingAngle(Math::PI, Vector3::YAXIS, Math::PI, Vector3::YAXIS);
660 effect.SetSwingAngleIn(Math::PI, Vector3::YAXIS);
661 effect.SetSwingAngleOut(Math::PI, Vector3::YAXIS);
662 effect.SetSwingAngleAlphaFunction(AlphaFunctions::Linear);
663 effect.SetSwingAngleAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
664 effect.SetSwingAngleAlphaFunctionIn(AlphaFunctions::Linear);
665 effect.SetSwingAngleAlphaFunctionOut(AlphaFunctions::Linear);
666 effect.SetSwingAnchor(AnchorPoint::CENTER, AnchorPoint::CENTER_LEFT);
667 effect.SetSwingAnchorIn(AnchorPoint::CENTER);
668 effect.SetSwingAnchorOut(AnchorPoint::CENTER);
669 effect.SetSwingAnchorAlphaFunction(AlphaFunctions::Linear);
670 effect.SetSwingAnchorAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
671 effect.SetSwingAnchorAlphaFunctionIn(AlphaFunctions::Linear);
672 effect.SetSwingAnchorAlphaFunctionOut(AlphaFunctions::Linear);
673 effect.SetOpacityThreshold(0.5f);
674 effect.SetOpacityThreshold(0.5f, 0.5f);
675 effect.SetOpacityThresholdIn(0.5f);
676 effect.SetOpacityThresholdOut(0.5f);
677 effect.SetOpacityAlphaFunction(AlphaFunctions::Linear);
678 effect.SetOpacityAlphaFunction(AlphaFunctions::Linear, AlphaFunctions::Linear);
679 effect.SetOpacityAlphaFunctionIn(AlphaFunctions::Linear);
680 effect.SetOpacityAlphaFunctionOut(AlphaFunctions::Linear);