X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fnpatch%2Fnpatch-visual.cpp;h=7be73011c9031604026d1019202b415f86d0d49f;hb=refs%2Fchanges%2F54%2F149954%2F4;hp=1df32a63b09159fa0ac436b85b42a8703c06edf6;hpb=77a90be65b5182ddc69a30f29e3b1b609241ade4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp old mode 100644 new mode 100755 index 1df32a6..7be7301 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -111,7 +111,6 @@ const char* VERTEX_SHADER_3X3 = DALI_COMPOSE_SHADER( vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );\n vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);\n - mediump vec2 scale = vec2( length( uModelMatrix[ 0 ].xyz ), length( uModelMatrix[ 1 ].xyz ) );\n mediump vec2 size = visualSize.xy;\n \n mediump vec2 fixedFactor = vec2( uFixed[ int( ( aPosition.x + 1.0 ) * 0.5 ) ].x, uFixed[ int( ( aPosition.y + 1.0 ) * 0.5 ) ].y );\n @@ -265,7 +264,7 @@ void NPatchVisual::GetNaturalSize( Vector2& naturalSize ) naturalSize.y = 0u; // load now if not already loaded - if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocal() ) + if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocalResource() ) { mId = mLoader.Load( mImageUrl.GetUrl(), mBorder ); } @@ -305,7 +304,7 @@ void NPatchVisual::DoSetProperties( const Property::Map& propertyMap ) void NPatchVisual::DoSetOnStage( Actor& actor ) { // load when first go on stage - if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocal() ) + if( NPatchLoader::UNINITIALIZED_ID == mId && mImageUrl.IsLocalResource() ) { mId = mLoader.Load( mImageUrl.GetUrl(), mBorder ); } @@ -444,10 +443,17 @@ Shader NPatchVisual::CreateShader() } 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) {