// EXTERNAL INCLUDES
#include <dali/dali.h>
-#include <dali/devel-api/images/native-image-interface-extension.h>
#include <dali-toolkit/dali-toolkit.h>
#include <cstring>
/**
* @brief Creates a shader used to render a native image
- * @param[in] nativeImageInterface The native image interface
+ * @param[in] nativeImage The native image
* @return A shader to render the native image
*/
-Shader CreateShader( NativeImageInterface& nativeImageInterface )
+Shader CreateShader( NativeImageInterface& nativeImage )
{
static const char* DEFAULT_SAMPLER_TYPENAME = "sampler2D";
}\n
);
- NativeImageInterface::Extension* extension( nativeImageInterface.GetExtension() );
- if( extension )
- {
- std::string fragmentShader;
-
- //Get custom fragment shader prefix
- const char* fragmentPreFix = extension->GetCustomFragmentPreFix();
- if( fragmentPreFix )
- {
- fragmentShader = fragmentPreFix;
- fragmentShader += FRAGMENT_SHADER_TEXTURE;
- }
- else
- {
- fragmentShader = FRAGMENT_SHADER_TEXTURE;
- }
- //Get custom sampler type name
- const char* customSamplerTypename = extension->GetCustomSamplerTypename();
- if( customSamplerTypename )
- {
- fragmentShader.replace( fragmentShader.find( DEFAULT_SAMPLER_TYPENAME ), strlen(DEFAULT_SAMPLER_TYPENAME), customSamplerTypename );
- }
+ std::string fragmentShader;
- return Shader::New( VERTEX_SHADER_TEXTURE, fragmentShader );
+ //Get custom fragment shader prefix
+ const char* fragmentPrefix = nativeImage.GetCustomFragmentPrefix();
+ if( fragmentPrefix )
+ {
+ fragmentShader = fragmentPrefix;
+ fragmentShader += FRAGMENT_SHADER_TEXTURE;
}
else
{
- return Shader::New( VERTEX_SHADER_TEXTURE, FRAGMENT_SHADER_TEXTURE );
+ fragmentShader = FRAGMENT_SHADER_TEXTURE;
}
+
+ //Get custom sampler type name
+ const char* customSamplerTypename = nativeImage.GetCustomSamplerTypename();
+ if( customSamplerTypename )
+ {
+ fragmentShader.replace( fragmentShader.find( DEFAULT_SAMPLER_TYPENAME ), strlen(DEFAULT_SAMPLER_TYPENAME), customSamplerTypename );
+ }
+
+ return Shader::New( VERTEX_SHADER_TEXTURE, fragmentShader );
}
}