+ else
+ {
+ DALI_LOG_ERROR("The N patch image '%s' is not a valid N patch image\n", mImageUrl.c_str() );
+ TextureSet textureSet = TextureSet::New();
+ mImpl->mRenderer.SetTextures( textureSet );
+ Image croppedImage = VisualFactoryCache::GetBrokenVisualImage();
+ TextureSetImage( textureSet, 0u, croppedImage );
+ mImpl->mRenderer.RegisterProperty( "uFixed[0]", Vector2::ZERO );
+ mImpl->mRenderer.RegisterProperty( "uFixed[1]", Vector2::ZERO );
+ mImpl->mRenderer.RegisterProperty( "uFixed[2]", Vector2::ZERO );
+ mImpl->mRenderer.RegisterProperty( "uStretchTotal", Vector2( croppedImage.GetWidth(), croppedImage.GetHeight() ) );
+ }
+
+ //Register transform properties
+ mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
+}
+
+Geometry NPatchVisual::GetNinePatchGeometry( VisualFactoryCache::GeometryType subType )
+{
+ Geometry geometry = mFactoryCache.GetGeometry( subType );
+ if( !geometry )
+ {
+ if( DALI_LIKELY( VisualFactoryCache::NINE_PATCH_GEOMETRY == subType ) )
+ {
+ geometry = CreateGridGeometry( Uint16Pair( 3, 3 ) );
+ }
+ else if( VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY == subType )
+ {
+ geometry = CreateBorderGeometry( Uint16Pair( 3, 3 ) );
+ }
+ mFactoryCache.SaveGeometry( subType, geometry );
+ }
+ return geometry;