2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali-toolkit/internal/text/rendering/text-renderer.h>
33 Dali::ShaderEffect New()
35 std::string vertexShader = DALI_COMPOSE_SHADER(
36 uniform mediump vec4 uTextureRect;\n
39 gl_Position = uMvpMatrix * vec4( aPosition.xy, 0.0, 1.0 );\n
40 vTexCoord = aTexCoord.xy;\n
44 std::string fragmentShader = DALI_COMPOSE_SHADER(
47 mediump vec4 color = texture2D( sTexture, vTexCoord );
48 gl_FragColor = vec4(uColor.rgb, uColor.a*color.r);
52 Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader,
53 Dali::GeometryType( Dali::GEOMETRY_TYPE_TEXTURED_MESH ),
54 Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) );
58 } // namespace BasicShader
62 } // namespace Toolkit