Merge "Fix for cursor. Avoid the jump of the grab handle when there is a mix of...
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / rendering / shaders / text-basic-shadow-shader.cpp
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
20
21 namespace Dali
22 {
23
24 namespace Toolkit
25 {
26
27 namespace Text
28 {
29
30 namespace BasicShadowShader
31 {
32
33 Dali::ShaderEffect New()
34 {
35   std::string vertexShader = DALI_COMPOSE_SHADER(
36       void main()\n
37       {\n
38         gl_Position = vec4( aPosition.xy, 0.0, 1.0 );\n
39         vTexCoord = aTexCoord.xy;\n
40       }\n
41   );
42
43   std::string fragmentShader = DALI_COMPOSE_SHADER(
44       void main()\n
45       {\n
46         mediump vec4 color = texture2D( sTexture, vTexCoord );
47         gl_FragColor = vec4(uColor.rgb, uColor.a*color.r);
48       }\n
49   );
50
51   Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader,
52                                                              Dali::GeometryType( Dali::GEOMETRY_TYPE_TEXTURED_MESH ),
53                                                              Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) );
54   return shaderEffect;
55 }
56
57 } // namespace BasicShadowShader
58
59 } // namespace Text
60
61 } // namespace Toolkit
62
63 } // namespace Dali