$(toolkit_src_dir)/text/rendering/text-renderer.cpp \
$(toolkit_src_dir)/text/rendering/basic/text-basic-renderer.cpp \
$(toolkit_src_dir)/text/rendering/shaders/text-basic-shader.cpp \
+ $(toolkit_src_dir)/text/rendering/shaders/text-bgra-shader.cpp \
$(toolkit_src_dir)/text/rendering/text-backend-impl.cpp \
$(toolkit_src_dir)/transition-effects/cube-transition-effect-impl.cpp \
$(toolkit_src_dir)/transition-effects/cube-transition-cross-effect-impl.cpp \
#include <dali/public-api/images/atlas.h>
#include <dali/public-api/geometry/mesh.h>
#include <dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h>
+#include <dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h>
+
using namespace Dali;
using namespace Dali::Toolkit;
actorBGRA8888 = MeshActor::New( mImpl->CreateMesh( glyphs, positions, Pixel::BGRA8888, mImpl->mAtlasBGRA8888 ) );
actorBGRA8888.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
- ShaderEffect shader = BasicShader::New();
+ ShaderEffect shader = BGRAShader::New();
actorBGRA8888.SetShaderEffect( shader );
}
--- /dev/null
+/*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL HEADERS
+#include <dali-toolkit/internal/text/rendering/text-renderer.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+namespace BGRAShader
+{
+
+Dali::ShaderEffect New()
+{
+ std::string vertexShader = DALI_COMPOSE_SHADER(
+ uniform mediump vec4 uTextureRect;\n
+ void main()\n
+ {\n
+ gl_Position = uMvpMatrix * vec4( aPosition.xy, 0.0, 1.0 );\n
+ vTexCoord = aTexCoord.xy;\n
+ }\n
+ );
+
+ std::string fragmentShader = DALI_COMPOSE_SHADER(
+ void main()\n
+ {\n
+ gl_FragColor = texture2D( sTexture, vTexCoord );
+ }\n
+ );
+
+ Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader,
+ Dali::GeometryType( Dali::GEOMETRY_TYPE_TEXTURED_MESH ),
+ Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) );
+ return shaderEffect;
+}
+
+} // namespace BGRAShader
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
--- /dev/null
+
+#ifndef __DALI_TOOLKIT_TEXT_BGRA_SHADER_H__
+#define __DALI_TOOLKIT_TEXT_BGRA_SHADER_H__
+
+/*
+ * Copyright (c) 2015 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/shader-effects/shader-effect.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * @brief A BGRA shader for rendering glyphs.
+ */
+namespace BGRAShader
+{
+
+/**
+ * Create a basic text shader.
+ * @return A handle to a newly allocated ShaderEffect
+ */
+Dali::ShaderEffect New();
+
+} // namespace BGRAShader
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEXT_BGRA_SHADER_H__