+int UtcDaliNPatchVisualCustomShader(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "NPatchVisual with custom shader" );
+
+ VisualFactory factory = VisualFactory::Get();
+ Property::Map properties;
+ Property::Map shader;
+ const std::string fragmentShader = "Foobar";
+ shader[Dali::Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
+ properties[Dali::Toolkit::Visual::Property::TYPE] = Dali::Toolkit::Visual::IMAGE;
+ properties[Dali::Toolkit::Visual::Property::SHADER]=shader;
+ properties[Dali::Toolkit::ImageVisual::Property::URL] = TEST_NPATCH_FILE_NAME;
+
+ Visual::Base visual = factory.CreateVisual( properties );
+ Actor dummy = Actor::New();
+ // trigger creation through setting on stage
+ visual.SetOnStage( dummy );
+
+ Renderer renderer = dummy.GetRendererAt( 0 );
+ Shader shader2 = renderer.GetShader();
+ Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
+ Property::Map* map = value.GetMap();
+ DALI_TEST_CHECK( map );
+
+ Property::Value* fragment = map->Find( "fragment" ); // fragment key name from shader-impl.cpp
+ // *map["vertex"]; is default here so not verifying it
+
+ DALI_TEST_EQUALS( fragmentShader, fragment->Get<std::string>(), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliGradientVisualBlendMode(void)
+{
+ ToolkitTestApplication application;
+
+ VisualFactory factory = VisualFactory::Get();
+
+ Visual::Base opaqueGradientVisual = factory.CreateVisual(
+ Property::Map().Add( Visual::Property::TYPE, Visual::GRADIENT )
+ .Add( GradientVisual::Property::START_POSITION, Vector2( -0.5f, -0.5f ) )
+ .Add( GradientVisual::Property::END_POSITION, Vector2( 0.5f, 0.5f ) )
+ .Add( GradientVisual::Property::STOP_COLOR, Property::Array().Add( Color::RED )
+ .Add( Color::GREEN ) ) );