+ const NPatchLoader::Data* data;
+ // 0 is either no data (load failed?) or no stretch regions on image
+ // for both cases we use the default shader
+ NPatchLoader::StretchRanges::SizeType xStretchCount = 0;
+ NPatchLoader::StretchRanges::SizeType yStretchCount = 0;
+
+ auto fragmentShader = mAuxiliaryPixelBuffer ? FRAGMENT_MASK_SHADER
+ : FRAGMENT_SHADER;
+ auto shaderType = mAuxiliaryPixelBuffer ? VisualFactoryCache::NINE_PATCH_MASK_SHADER
+ : VisualFactoryCache::NINE_PATCH_SHADER;
+
+ // ask loader for the regions
+ if( mLoader.GetNPatchData( mId, data ) )
+ {
+ xStretchCount = data->stretchPixelsX.Count();
+ yStretchCount = data->stretchPixelsY.Count();
+ }
+
+ if( DALI_LIKELY( !mImpl->mCustomShader ) )