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 #include <dali-toolkit-test-suite-utils.h>
22 #include <dali-toolkit/dali-toolkit.h>
23 #include <dali-toolkit/devel-api/shader-effects/blind-effect.h>
29 void blind_effect_startup(void)
31 test_return_value = TET_UNDEF;
34 void blind_effect_cleanup(void)
36 test_return_value = TET_PASS;
40 int UtcDaliBlindEffectUninitialized(void)
42 ToolkitTestApplication application;
44 Toolkit::BlindEffect effect;
48 // New() must be called to create a BlindEffect or it wont be valid.
49 effect.SetStep( 2.0f );
50 DALI_TEST_CHECK( false );
52 catch (Dali::DaliException& e)
54 // Tests that a negative test of an assertion succeeds
55 DALI_TEST_PRINT_ASSERT( e );
56 DALI_TEST_CHECK(!effect);
61 int UtcDaliBlindEffectPropertyNames(void)
63 ToolkitTestApplication application;
65 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
67 // Check the names, this names are used in the shaders code,
68 // if they change the shader code has to be updated
69 DALI_TEST_EQUALS( effect.GetStepPropertyName(), "uStep", TEST_LOCATION );
73 int UtcDaliBlindEffectDefaultValues(void)
75 ToolkitTestApplication application;
77 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
78 DALI_TEST_CHECK( effect );
80 BufferImage image = CreateBufferImage();
82 ImageActor actor = ImageActor::New( image );
83 actor.SetSize( 100.0f, 100.0f );
84 actor.SetShaderEffect( effect );
85 Stage::GetCurrent().Add( actor );
87 application.SendNotification();
90 // Gets converted to opengl viewport coordinates
92 application.GetGlAbstraction().CheckUniformValue(
93 effect.GetStepPropertyName().c_str(),
98 int UtcDaliBlindEffectCustomValues(void)
100 ToolkitTestApplication application;
102 Toolkit::BlindEffect effect = Toolkit::BlindEffect::New();
103 DALI_TEST_CHECK( effect );
105 BufferImage image = CreateBufferImage();
107 ImageActor actor = ImageActor::New( image );
108 actor.SetSize( 100.0f, 100.0f );
110 effect.SetStep( 2.0f );
112 actor.SetShaderEffect(effect);
113 Stage::GetCurrent().Add(actor);
115 application.SendNotification();
116 application.Render();
118 // Gets converted to opengl viewport coordinates
120 application.GetGlAbstraction().CheckUniformValue(
121 effect.GetStepPropertyName().c_str(),