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
(Vector) Check failure of vector rendering
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
text-scroller.cpp
diff --git
a/dali-toolkit/internal/text/text-scroller.cpp
b/dali-toolkit/internal/text/text-scroller.cpp
index
466bfa6
..
8fba9b5
100644
(file)
--- a/
dali-toolkit/internal/text/text-scroller.cpp
+++ b/
dali-toolkit/internal/text/text-scroller.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
7
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
8
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.
@@
-50,9
+50,7
@@
const char* VERTEX_SHADER_SCROLL = DALI_COMPOSE_SHADER(
uniform mediump float uHorizontalAlign;\n
uniform mediump float uVerticalAlign;\n
\n
uniform mediump float uHorizontalAlign;\n
uniform mediump float uVerticalAlign;\n
\n
- uniform mediump mat4 uModelMatrix;\n
- uniform mediump mat4 uViewMatrix;\n
- uniform mediump mat4 uProjection;\n
+ uniform highp mat4 uMvpMatrix;\n
\n
//Visual size and offset
uniform mediump vec2 offset;\n
\n
//Visual size and offset
uniform mediump vec2 offset;\n
@@
-66,15
+64,12
@@
const char* VERTEX_SHADER_SCROLL = DALI_COMPOSE_SHADER(
mediump vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy );\n
mediump vec2 visualSize = mix( uSize.xy * size, size, offsetSizeMode.zw );\n
\n
mediump vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy );\n
mediump vec2 visualSize = mix( uSize.xy * size, size, offsetSizeMode.zw );\n
\n
- mediump float delta = floor ( uDelta ) + 0.5;\n
- vTexCoord.x = ( delta + uHorizontalAlign * ( uTextureSize.x - visualSize.x - uGap ) + floor( aPosition.x * visualSize.x ) + 0.5 - uGap * 0.5 ) / uTextureSize.x + 0.5;\n
+ vTexCoord.x = ( uDelta + uHorizontalAlign * ( uTextureSize.x - visualSize.x - uGap ) + floor( aPosition.x * visualSize.x ) + 0.5 - uGap * 0.5 ) / uTextureSize.x + 0.5;\n
vTexCoord.y = ( uVerticalAlign * ( uTextureSize.y - visualSize.y ) + floor( aPosition.y * visualSize.y ) + 0.5 ) / ( uTextureSize.y ) + 0.5;\n
\n
mediump vec4 vertexPosition = vec4( floor( ( aPosition + anchorPoint ) * visualSize + ( visualOffset + origin ) * uSize.xy ), 0.0, 1.0 );\n
vTexCoord.y = ( uVerticalAlign * ( uTextureSize.y - visualSize.y ) + floor( aPosition.y * visualSize.y ) + 0.5 ) / ( uTextureSize.y ) + 0.5;\n
\n
mediump vec4 vertexPosition = vec4( floor( ( aPosition + anchorPoint ) * visualSize + ( visualOffset + origin ) * uSize.xy ), 0.0, 1.0 );\n
- mediump vec4 nonAlignedVertex = uViewMatrix * uModelMatrix * vertexPosition;\n
- mediump vec4 pixelAlignedVertex = vec4 ( floor( nonAlignedVertex.xyz ), 1.0 );\n
\n
\n
- gl_Position = u
Projection * pixelAlignedVertex
;\n
+ gl_Position = u
MvpMatrix * vertexPosition
;\n
}\n
);
}\n
);
@@
-83,13
+78,6
@@
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
uniform sampler2D sTexture;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
uniform sampler2D sTexture;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
- uniform lowp float preMultipliedAlpha;\n
- \n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
\n
void main()\n
{\n
\n
void main()\n
{\n
@@
-97,9
+85,8
@@
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
discard;\n
\n
mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
discard;\n
\n
mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
- textTexture.rgb *= mix( 1.0, textTexture.a, preMultipliedAlpha );\n
\n
\n
- gl_FragColor = textTexture * uColor * v
isualMixColor(
);
+ gl_FragColor = textTexture * uColor * v
ec4( mixColor, 1.0
);
}\n
);
}\n
);
@@
-233,6
+220,10
@@
void TextScroller::StopScrolling()
}
}
}
}
}
}
+ else
+ {
+ mScrollerInterface.ScrollingFinished();
+ }
}
TextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const
}
TextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const
@@
-294,8
+285,20
@@
void TextScroller::SetParameters( Actor scrollingTextActor, Renderer renderer, T
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters wrapGap[%f]\n", wrapGap );
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters wrapGap[%f]\n", wrapGap );
- const float horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[ horizontalAlignment ][ direction ];
+ float horizontalAlign;
+
+ if( textureSize.x > controlSize.x )
+ {
+ // if Text is elided, scroll should start at the begin of text.
+ horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[HorizontalAlignment::BEGIN][ direction ];
+ }
+ else
+ {
+ horizontalAlign = HORIZONTAL_ALIGNMENT_TABLE[ horizontalAlignment ][ direction ];
+ }
+
const float verticalAlign = VERTICAL_ALIGNMENT_TABLE[ verticalAlignment ];
const float verticalAlign = VERTICAL_ALIGNMENT_TABLE[ verticalAlignment ];
+
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters horizontalAlign[%f], verticalAlign[%f]\n", horizontalAlign, verticalAlign );
scrollingTextActor.RegisterProperty( "uTextureSize", textureSize );
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters horizontalAlign[%f], verticalAlign[%f]\n", horizontalAlign, verticalAlign );
scrollingTextActor.RegisterProperty( "uTextureSize", textureSize );