VisualFactory factory = VisualFactory::Get();
Property::Map properties;
Property::Map shader;
+ const std::string vertexShader = "Foobar";
const std::string fragmentShader = "Foobar";
shader[Dali::Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = fragmentShader;
+ shader[Dali::Toolkit::Visual::Shader::Property::VERTEX_SHADER] = vertexShader;
Property::Map transformMap;
transformMap["size"] = Vector2( 0.5f, 0.5f ) ;
DALI_TEST_EQUALS( renderer.GetProperty( index ), Property::Value(Vector2(0.5, 0.5)), 0.001, TEST_LOCATION );
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 );
+ Property::Value* vertex = map->Find( "vertex" ); // vertex key name from shader-impl.cpp
+ DALI_TEST_EQUALS( vertexShader, vertex->Get<std::string>(), TEST_LOCATION );
+
END_TEST;
}
}
hints = mImpl->mCustomShader->mHints;
+ /* Apply Custom Vertex Shader only if image is 9-patch */
if( ( xStretchCount == 1 && yStretchCount == 1 ) ||
( xStretchCount == 0 && yStretchCount == 0 ) )
{
- shader = Shader::New( VERTEX_SHADER_3X3, fragmentShader, hints );
+ const char* vertexShader = VERTEX_SHADER_3X3;
+
+ if( !mImpl->mCustomShader->mVertexShader.empty() )
+ {
+ vertexShader = mImpl->mCustomShader->mVertexShader.c_str();
+ }
+ shader = Shader::New( vertexShader, fragmentShader, hints );
}
else if( xStretchCount > 0 || yStretchCount > 0)
{