projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Note that some Text propeties in devel api can't be changed" into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
visuals
/
npatch
/
npatch-visual.cpp
diff --git
a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
old mode 100644
(file)
new mode 100755
(executable)
index
599546f
..
9235545
--- a/
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
+++ b/
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
6
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
7
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-19,10
+19,10
@@
#include "npatch-visual.h"
// EXTERNAL INCLUDES
#include "npatch-visual.h"
// EXTERNAL INCLUDES
-#include <dali/integration-api/platform-abstraction.h>
#include <dali/public-api/images/buffer-image.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/devel-api/images/texture-set-image.h>
#include <dali/public-api/images/buffer-image.h>
#include <dali/public-api/images/resource-image.h>
#include <dali/devel-api/images/texture-set-image.h>
+#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
@@
-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
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
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
@@
-444,10
+443,17
@@
Shader NPatchVisual::CreateShader()
}
hints = mImpl->mCustomShader->mHints;
}
hints = mImpl->mCustomShader->mHints;
+ /* Apply Custom Vertex Shader only if image is 9-patch */
if( ( xStretchCount == 1 && yStretchCount == 1 ) ||
( xStretchCount == 0 && yStretchCount == 0 ) )
{
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)
{
}
else if( xStretchCount > 0 || yStretchCount > 0)
{