+ if( !mImpl->mCustomShader->mFragmentShader.empty() )
+ {
+ fragmentShader = mImpl->mCustomShader->mFragmentShader.c_str();
+ }
+ hints = mImpl->mCustomShader->mHints;
+
+ if( mStretchPixelsX.Size() == 1 && mStretchPixelsY.Size() == 1 )
+ {
+ shader = Shader::New( VERTEX_SHADER_3X3, fragmentShader, hints );
+ }
+ else if( mStretchPixelsX.Size() > 0 || mStretchPixelsY.Size() > 0)
+ {
+ std::stringstream vertexShader;
+ vertexShader << "#define FACTOR_SIZE_X " << mStretchPixelsX.Size() + 2 << "\n"
+ << "#define FACTOR_SIZE_Y " << mStretchPixelsY.Size() + 2 << "\n"
+ << VERTEX_SHADER;
+
+ shader = Shader::New( vertexShader.str(), fragmentShader, hints );
+ }