From b766a879a8f8b55a7017847894a2f1bc7edd83d8 Mon Sep 17 00:00:00 2001 From: Victor Cebollada Date: Tue, 21 Jul 2015 15:17:03 +0100 Subject: [PATCH] Text clean. * Removes includes. * Moves code in text-view.cpp to match the .h Change-Id: Ifc510f19a427722f6072122f68b5f26800dc1081 Signed-off-by: Victor Cebollada --- .../text-controls/text-field-impl.cpp | 1 + .../text-controls/text-label-impl.cpp | 1 + dali-toolkit/internal/file.list | 3 - .../internal/text/bidirectional-support.h | 3 - .../internal/text/character-set-conversion.h | 3 - .../internal/text/clipping/text-clipper.cpp | 2 - .../internal/text/clipping/text-clipper.h | 3 - .../text/decorator/text-decorator.cpp | 20 +----- .../internal/text/decorator/text-decorator.h | 14 +--- .../internal/text/layouts/layout-engine.cpp | 3 +- .../internal/text/layouts/layout-engine.h | 2 - dali-toolkit/internal/text/line-run.h | 3 - .../internal/text/logical-model-impl.cpp | 3 - .../internal/text/logical-model-impl.h | 4 -- .../text/multi-language-support-impl.cpp | 8 --- .../internal/text/multi-language-support.h | 2 - .../atlas/atlas-glyph-manager-impl.cpp | 2 - .../rendering/atlas/atlas-glyph-manager.cpp | 1 - .../rendering/atlas/text-atlas-renderer.cpp | 38 +++++++---- .../rendering/atlas/text-atlas-renderer.h | 1 - .../rendering/shaders/text-basic-shader.cpp | 64 ------------------- .../rendering/shaders/text-basic-shader.h | 53 --------------- .../shaders/text-basic-shadow-shader.cpp | 62 ------------------ .../rendering/shaders/text-bgra-shader.cpp | 64 ------------------- .../text/rendering/shaders/text-bgra-shader.h | 54 ---------------- .../text/rendering/text-backend-impl.cpp | 2 +- .../internal/text/rendering/text-renderer.h | 5 +- dali-toolkit/internal/text/shaper.cpp | 7 -- .../internal/text/text-controller-impl.cpp | 4 -- .../internal/text/text-controller-impl.h | 2 +- .../internal/text/text-controller.cpp | 7 -- dali-toolkit/internal/text/text-controller.h | 11 +--- .../internal/text/text-view-interface.h | 6 +- dali-toolkit/internal/text/text-view.cpp | 63 +++++++++--------- dali-toolkit/internal/text/text-view.h | 2 - .../internal/text/visual-model-impl.cpp | 1 - .../internal/text/visual-model-impl.h | 4 +- 37 files changed, 67 insertions(+), 461 deletions(-) delete mode 100644 dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp delete mode 100644 dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h delete mode 100644 dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp delete mode 100644 dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp delete mode 100644 dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 8fda39b3d4..728a3be2a3 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include using namespace Dali::Toolkit::Text; diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp index aff8134241..290c64f993 100644 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include using Dali::Toolkit::Text::LayoutEngine; diff --git a/dali-toolkit/internal/file.list b/dali-toolkit/internal/file.list index e96d299859..a93f983cd4 100644 --- a/dali-toolkit/internal/file.list +++ b/dali-toolkit/internal/file.list @@ -84,9 +84,6 @@ toolkit_src_files = \ $(toolkit_src_dir)/text/rendering/atlas/text-atlas-renderer.cpp \ $(toolkit_src_dir)/text/rendering/atlas/atlas-glyph-manager.cpp \ $(toolkit_src_dir)/text/rendering/atlas/atlas-glyph-manager-impl.cpp \ - $(toolkit_src_dir)/text/rendering/shaders/text-basic-shader.cpp \ - $(toolkit_src_dir)/text/rendering/shaders/text-basic-shadow-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 \ diff --git a/dali-toolkit/internal/text/bidirectional-support.h b/dali-toolkit/internal/text/bidirectional-support.h index 72b147abe7..f659a9c50f 100644 --- a/dali-toolkit/internal/text/bidirectional-support.h +++ b/dali-toolkit/internal/text/bidirectional-support.h @@ -36,9 +36,6 @@ namespace Toolkit namespace Text { -class LogicalModel; -class VisualModel; - /** * Sets the bidirectional info into the logical model. * diff --git a/dali-toolkit/internal/text/character-set-conversion.h b/dali-toolkit/internal/text/character-set-conversion.h index 720114b1e1..b60a34414f 100644 --- a/dali-toolkit/internal/text/character-set-conversion.h +++ b/dali-toolkit/internal/text/character-set-conversion.h @@ -22,9 +22,6 @@ #include #include -// INTERNAL INCLUDES -#include - namespace Dali { diff --git a/dali-toolkit/internal/text/clipping/text-clipper.cpp b/dali-toolkit/internal/text/clipping/text-clipper.cpp index e9c6e8f531..031956acc4 100644 --- a/dali-toolkit/internal/text/clipping/text-clipper.cpp +++ b/dali-toolkit/internal/text/clipping/text-clipper.cpp @@ -19,10 +19,8 @@ #include // EXTERNAL INCLUDES -#include #include #include -#include namespace { diff --git a/dali-toolkit/internal/text/clipping/text-clipper.h b/dali-toolkit/internal/text/clipping/text-clipper.h index d435c86d52..26bff0b849 100644 --- a/dali-toolkit/internal/text/clipping/text-clipper.h +++ b/dali-toolkit/internal/text/clipping/text-clipper.h @@ -22,9 +22,6 @@ #include #include #include -#include -#include -#include #include namespace Dali diff --git a/dali-toolkit/internal/text/decorator/text-decorator.cpp b/dali-toolkit/internal/text/decorator/text-decorator.cpp index d09eacb471..ed67d72480 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.cpp +++ b/dali-toolkit/internal/text/decorator/text-decorator.cpp @@ -20,39 +20,21 @@ // EXTERNAL INCLUDES #include -#include + #include -#include #include -#include -#include #include -#include -#include #include #include -#include #include -#include -#include -#include #include -#include -#include #include -#include #include -#include // INTERNAL INCLUDES -#include #include -#include -#include #include -#include -#include #ifdef DEBUG_ENABLED #define DECORATOR_DEBUG diff --git a/dali-toolkit/internal/text/decorator/text-decorator.h b/dali-toolkit/internal/text/decorator/text-decorator.h index c77ec949bd..b018c6afe4 100644 --- a/dali-toolkit/internal/text/decorator/text-decorator.h +++ b/dali-toolkit/internal/text/decorator/text-decorator.h @@ -22,7 +22,6 @@ #include #include #include -#include // INTERNAL INCLUDES #include @@ -30,21 +29,12 @@ namespace Dali { -class Actor; -class Image; -class Vector2; -class Vector4; +struct Vector2; +struct Vector4; namespace Toolkit { -class TextSelectionPopupCallbackInterface; - -namespace Internal -{ -class Control; -} - namespace Text { diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 442b631fcf..f7e9aa342a 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -20,9 +20,8 @@ // EXTERNAL INCLUDES #include -#include -#include #include +#include // INTERNAL INCLUDES #include diff --git a/dali-toolkit/internal/text/layouts/layout-engine.h b/dali-toolkit/internal/text/layouts/layout-engine.h index e48de907a3..121b2400b4 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.h +++ b/dali-toolkit/internal/text/layouts/layout-engine.h @@ -28,8 +28,6 @@ namespace Dali { -struct Vector2; - namespace Toolkit { diff --git a/dali-toolkit/internal/text/line-run.h b/dali-toolkit/internal/text/line-run.h index 584d758820..69091829d7 100644 --- a/dali-toolkit/internal/text/line-run.h +++ b/dali-toolkit/internal/text/line-run.h @@ -18,9 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include diff --git a/dali-toolkit/internal/text/logical-model-impl.cpp b/dali-toolkit/internal/text/logical-model-impl.cpp index 7dbe628416..e8e906fefc 100644 --- a/dali-toolkit/internal/text/logical-model-impl.cpp +++ b/dali-toolkit/internal/text/logical-model-impl.cpp @@ -18,9 +18,6 @@ // CLASS HEADER #include -// EXTERNAL INCLUDES -#include - namespace Dali { diff --git a/dali-toolkit/internal/text/logical-model-impl.h b/dali-toolkit/internal/text/logical-model-impl.h index 269247f127..43ef817cc3 100644 --- a/dali-toolkit/internal/text/logical-model-impl.h +++ b/dali-toolkit/internal/text/logical-model-impl.h @@ -38,12 +38,8 @@ namespace Toolkit namespace Text { -struct BidirectionalLineInfoRun; -struct BidirectionalParagraphInfoRun; -struct FontRun; class LogicalModel; typedef IntrusivePtr LogicalModelPtr; -struct ScriptRun; /** * @brief A logical text model contains layout independent information. diff --git a/dali-toolkit/internal/text/multi-language-support-impl.cpp b/dali-toolkit/internal/text/multi-language-support-impl.cpp index 5284a3b713..8d8b3c8354 100644 --- a/dali-toolkit/internal/text/multi-language-support-impl.cpp +++ b/dali-toolkit/internal/text/multi-language-support-impl.cpp @@ -19,17 +19,9 @@ #include // EXTERNAL INCLUDES -#include #include #include #include -#include - -// INTERNAL INCLUDES -#include -#include -#include -#include namespace Dali { diff --git a/dali-toolkit/internal/text/multi-language-support.h b/dali-toolkit/internal/text/multi-language-support.h index 5c8ea1d989..7e47fd2220 100644 --- a/dali-toolkit/internal/text/multi-language-support.h +++ b/dali-toolkit/internal/text/multi-language-support.h @@ -42,8 +42,6 @@ class MultilanguageSupport; } // Internal -class LogicalModel; - /** * @brief Sets the character's scripts to the model and validates the fonts set by the user or assigns default ones. */ diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp index a14116699c..38412292c7 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp @@ -18,8 +18,6 @@ #include // EXTERNAL INCLUDES -#include -#include #include #define MAKE_SHADER(A)#A diff --git a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp index e71ad896b9..463a3e8510 100644 --- a/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp @@ -22,7 +22,6 @@ #include // INTERNAL INCLUDES -#include #include namespace Dali diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp index d1b29811d6..2e94ce13fd 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp @@ -19,17 +19,19 @@ #include // EXTERNAL INCLUDES -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include +#include #include -#include + // INTERNAL INCLUDES #include #include +#include using namespace Dali; using namespace Dali::Toolkit; @@ -176,10 +178,11 @@ struct AtlasRenderer::Impl : public ConnectionTracker // Avoid emptying mTextCache (& removing references) until after incremented references for the new text Vector< TextCacheEntry > newTextCache; + const GlyphInfo* const glyphsBuffer = glyphs.Begin(); for( uint32_t i = 0, glyphSize = glyphs.Size(); i < glyphSize; ++i ) { - const GlyphInfo& glyph = glyphs[ i ]; + const GlyphInfo& glyph = *( glyphsBuffer + i ); // No operation for white space if ( glyph.width && glyph.height ) @@ -191,7 +194,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker FontMetrics fontMetrics; mFontClient.GetFontMetrics( glyph.fontId, fontMetrics ); currentUnderlinePosition = ceil( fabsf( fontMetrics.underlinePosition ) ); - float descender = ceil( fabsf( fontMetrics.descender ) ); + const float descender = ceil( fabsf( fontMetrics.descender ) ); if ( underlineHeight == ZERO ) { @@ -295,7 +298,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker slot ); lastFontId = glyph.fontId; } - } + } // glyphs // Now remove references for the old text RemoveText(); @@ -404,7 +407,10 @@ struct AtlasRenderer::Impl : public ConnectionTracker // Check to see if there's a mesh data object that references the same atlas ? uint32_t index = 0; - for ( std::vector< MeshRecord >::iterator mIt = meshContainer.begin(); mIt != meshContainer.end(); ++mIt, ++index ) + for ( std::vector< MeshRecord >::iterator mIt = meshContainer.begin(), + mEndIt = meshContainer.end(); + mIt != mEndIt; + ++mIt, ++index ) { if ( slot.mAtlasId == mIt->mAtlasId && color == mIt->mColor ) { @@ -452,7 +458,10 @@ struct AtlasRenderer::Impl : public ConnectionTracker float underlineThickness ) { bool foundExtent = false; - for ( Vector< Extent >::Iterator eIt = extents.Begin(); eIt != extents.End(); ++eIt ) + for ( Vector< Extent >::Iterator eIt = extents.Begin(), + eEndIt = extents.End(); + eIt != eEndIt; + ++eIt ) { if ( Equals( baseLine, eIt->mBaseLine ) ) { @@ -515,14 +524,17 @@ struct AtlasRenderer::Impl : public ConnectionTracker } } - void GenerateUnderlines( std::vector< MeshRecord>& meshRecords, + void GenerateUnderlines( std::vector< MeshRecord >& meshRecords, Vector< Extent >& extents, const Vector4& underlineColor, const Vector4& textColor ) { AtlasManager::Mesh2D newMesh; unsigned short faceIndex = 0; - for ( Vector< Extent >::ConstIterator eIt = extents.Begin(); eIt != extents.End(); ++eIt ) + for ( Vector< Extent >::ConstIterator eIt = extents.Begin(), + eEndIt = extents.End(); + eIt != eEndIt; + ++eIt ) { AtlasManager::Vertex2D vert; uint32_t index = eIt->mMeshRecordIndex; diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h index 809c236fb0..a6ae4b6e5d 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h @@ -20,7 +20,6 @@ // INTERNAL INCLUDES #include -#include namespace Dali { diff --git a/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp b/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp deleted file mode 100644 index 447783f5af..0000000000 --- a/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - * - */ - -// CLASS HEADER -#include -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Text -{ - -namespace BasicShader -{ - -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 - mediump vec4 color = texture2D( sTexture, vTexCoord ); - gl_FragColor = vec4(uColor.rgb, uColor.a*color.r); - }\n - ); - - Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader, - Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) ); - return shaderEffect; -} - -} // namespace BasicShader - -} // namespace Text - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h b/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h deleted file mode 100644 index cc97d1b68e..0000000000 --- a/dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef __DALI_TOOLKIT_TEXT_BASIC_SHADER_H__ -#define __DALI_TOOLKIT_TEXT_BASIC_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 - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Text -{ - -/** - * @brief A basic shader for rendering glyphs in Pixel::L8 format. - */ -namespace BasicShader -{ - -/** - * Create a basic text shader. - * @return A handle to a newly allocated ShaderEffect - */ -Dali::ShaderEffect New(); - -} // namespace BasicShader - -} // namespace Text - -} // namespace Toolkit - -} // namespace Dali - -#endif // __DALI_TOOLKIT_TEXT_BASIC_SHADER_H__ diff --git a/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp b/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp deleted file mode 100644 index 5ff9ecea4a..0000000000 --- a/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - * - */ - -// CLASS HEADER -#include - -namespace Dali -{ - -namespace Toolkit -{ - -namespace Text -{ - -namespace BasicShadowShader -{ -/* -Dali::ShaderEffect New() -{ - std::string vertexShader = DALI_COMPOSE_SHADER( - void main()\n - {\n - gl_Position = vec4( aPosition.xy, 0.0, 1.0 );\n - vTexCoord = aTexCoord.xy;\n - }\n - ); - - std::string fragmentShader = DALI_COMPOSE_SHADER( - void main()\n - {\n - mediump vec4 color = texture2D( sTexture, vTexCoord ); - gl_FragColor = vec4(uColor.rgb, uColor.a*color.r); - }\n - ); - - Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader, - Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) ); - return shaderEffect; -} -*/ -} // namespace BasicShadowShader - -} // namespace Text - -} // namespace Toolkit - -} // namespace Dali diff --git a/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp b/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp deleted file mode 100644 index 5bf3707ccc..0000000000 --- a/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 -#include - -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::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) ); - return shaderEffect; -} - -} // namespace BGRAShader - -} // namespace Text - -} // namespace Toolkit - -} // namespace Dali - diff --git a/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h b/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h deleted file mode 100644 index 16293c6257..0000000000 --- a/dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h +++ /dev/null @@ -1,54 +0,0 @@ - -#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 - -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__ diff --git a/dali-toolkit/internal/text/rendering/text-backend-impl.cpp b/dali-toolkit/internal/text/rendering/text-backend-impl.cpp index f9f15df09b..776d4081f2 100644 --- a/dali-toolkit/internal/text/rendering/text-backend-impl.cpp +++ b/dali-toolkit/internal/text/rendering/text-backend-impl.cpp @@ -19,8 +19,8 @@ #include // EXTERNAL INCLUDES -#include #include +#include // INTERNAL INCLUDES #include diff --git a/dali-toolkit/internal/text/rendering/text-renderer.h b/dali-toolkit/internal/text/rendering/text-renderer.h index eea4efa1df..cc7c8f4ee0 100644 --- a/dali-toolkit/internal/text/rendering/text-renderer.h +++ b/dali-toolkit/internal/text/rendering/text-renderer.h @@ -23,9 +23,6 @@ #include #include -// INTERNAL INCLUDES -#include - namespace Dali { @@ -38,6 +35,8 @@ namespace Text class Renderer; typedef IntrusivePtr RendererPtr; +class ViewInterface; + /** * @brief Abstract base class for Text renderers. * diff --git a/dali-toolkit/internal/text/shaper.cpp b/dali-toolkit/internal/text/shaper.cpp index 0f4a114826..5061193c25 100644 --- a/dali-toolkit/internal/text/shaper.cpp +++ b/dali-toolkit/internal/text/shaper.cpp @@ -19,15 +19,8 @@ #include // EXTERNAL INCLUDES -#include #include -// INTERNAL INCLUDES -#include -#include -#include -#include - namespace Dali { diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 76e42cad87..6552ce8ea3 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -25,13 +25,9 @@ // INTERNAL INCLUDES #include #include -#include #include -#include #include #include -#include -#include namespace { diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 83aafe40c0..392df2cc68 100644 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -20,13 +20,13 @@ // EXTERNAL INCLUDES #include -#include #include // INTERNAL INCLUDES #include #include #include +#include #include namespace Dali diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index fcb3c099c6..9d0cf87bcb 100644 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include #include #include #include @@ -29,13 +28,7 @@ #include #include #include -#include -#include -#include -#include #include -#include -#include namespace { diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index 42ab96a051..99c2ab09cb 100644 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -19,23 +19,14 @@ */ // EXTERNAL INCLUDES -#include #include -#include -#include #include -#include -#include -#include -#include // INTERNAL INCLUDES #include #include -#include #include #include -#include namespace Dali { @@ -47,7 +38,7 @@ namespace Text { class Controller; -class LayoutEngine; +class View; typedef IntrusivePtr ControllerPtr; typedef Dali::Toolkit::Text::ControlInterface ControlInterface; diff --git a/dali-toolkit/internal/text/text-view-interface.h b/dali-toolkit/internal/text/text-view-interface.h index 55e4aca86f..bcc7f22139 100644 --- a/dali-toolkit/internal/text/text-view-interface.h +++ b/dali-toolkit/internal/text/text-view-interface.h @@ -18,9 +18,6 @@ * */ -// EXTERNAL INCLUDES -#include - // INTERNAL INCLUDES #include @@ -28,6 +25,7 @@ namespace Dali { struct Vector2; +struct Vector4; namespace Toolkit { @@ -35,8 +33,6 @@ namespace Toolkit namespace Text { -struct LineRun; - /** * @brief Abstract interface to provide the information necessary displaying text. * diff --git a/dali-toolkit/internal/text/text-view.cpp b/dali-toolkit/internal/text/text-view.cpp index 621f26db59..4bee1c284a 100644 --- a/dali-toolkit/internal/text/text-view.cpp +++ b/dali-toolkit/internal/text/text-view.cpp @@ -65,6 +65,23 @@ const Vector2& View::GetControlSize() const return Vector2::ZERO; } +Length View::GetNumberOfGlyphs() const +{ + if( mImpl->mVisualModel ) + { + const VisualModel& model = *mImpl->mVisualModel; + + const Length glyphCount = model.mGlyphs.Count(); + const Length positionCount = model.mGlyphPositions.Count(); + + DALI_ASSERT_DEBUG( positionCount <= glyphCount && "Invalid glyph positions in Model" ); + + return (positionCount < glyphCount) ? positionCount : glyphCount; + } + + return 0; +} + Length View::GetGlyphs( GlyphInfo* glyphs, Vector2* glyphPositions, GlyphIndex glyphIndex, @@ -248,80 +265,58 @@ Length View::GetGlyphs( GlyphInfo* glyphs, const Vector4& View::GetTextColor() const { - if ( mImpl->mVisualModel ) + if( mImpl->mVisualModel ) { - VisualModel& model = *mImpl->mVisualModel; - return model.GetTextColor(); + return mImpl->mVisualModel->GetTextColor(); } return Vector4::ZERO; } const Vector2& View::GetShadowOffset() const { - if ( mImpl->mVisualModel ) + if( mImpl->mVisualModel ) { - VisualModel& model = *mImpl->mVisualModel; - return model.GetShadowOffset(); + return mImpl->mVisualModel->GetShadowOffset(); } return Vector2::ZERO; } const Vector4& View::GetShadowColor() const { - if ( mImpl->mVisualModel ) + if( mImpl->mVisualModel ) { - VisualModel& model = *mImpl->mVisualModel; - return model.GetShadowColor(); + return mImpl->mVisualModel->GetShadowColor(); } return Vector4::ZERO; } const Vector4& View::GetUnderlineColor() const { - if ( mImpl->mVisualModel ) + if( mImpl->mVisualModel ) { - VisualModel& model = *mImpl->mVisualModel; - return model.GetUnderlineColor(); + return mImpl->mVisualModel->GetUnderlineColor(); } return Vector4::ZERO; } bool View::IsUnderlineEnabled() const { - if ( mImpl->mVisualModel ) + if( mImpl->mVisualModel ) { - VisualModel& model = *mImpl->mVisualModel; - return model.IsUnderlineEnabled(); + return mImpl->mVisualModel->IsUnderlineEnabled(); } return false; } float View::GetUnderlineHeight() const { - if ( mImpl->mVisualModel ) + if( mImpl->mVisualModel ) { - VisualModel& model = *mImpl->mVisualModel; - return model.GetUnderlineHeight(); + return mImpl->mVisualModel->GetUnderlineHeight(); } return 0.0f; } -Length View::GetNumberOfGlyphs() const -{ - if( mImpl->mVisualModel ) - { - VisualModel& model = *mImpl->mVisualModel; - - const Length glyphCount = model.mGlyphs.Count(); - const Length positionCount = model.mGlyphPositions.Count(); - - DALI_ASSERT_DEBUG( positionCount <= glyphCount && "Invalid glyph positions in Model" ); - - return (positionCount < glyphCount) ? positionCount : glyphCount; - } - - return 0; -} } // namespace Text diff --git a/dali-toolkit/internal/text/text-view.h b/dali-toolkit/internal/text/text-view.h index b724faad7b..2ab19b1b85 100644 --- a/dali-toolkit/internal/text/text-view.h +++ b/dali-toolkit/internal/text/text-view.h @@ -25,8 +25,6 @@ namespace Dali { -struct Vector2; - namespace Toolkit { diff --git a/dali-toolkit/internal/text/visual-model-impl.cpp b/dali-toolkit/internal/text/visual-model-impl.cpp index a354fdc313..bb7cdde42f 100644 --- a/dali-toolkit/internal/text/visual-model-impl.cpp +++ b/dali-toolkit/internal/text/visual-model-impl.cpp @@ -20,7 +20,6 @@ // EXTERNAL INCLUDES #include -#include namespace Dali { diff --git a/dali-toolkit/internal/text/visual-model-impl.h b/dali-toolkit/internal/text/visual-model-impl.h index 57eaffd501..32ab3867c9 100644 --- a/dali-toolkit/internal/text/visual-model-impl.h +++ b/dali-toolkit/internal/text/visual-model-impl.h @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #include #include @@ -30,15 +31,12 @@ namespace Dali { -struct Vector2; - namespace Toolkit { namespace Text { -struct LineRun; class VisualModel; typedef IntrusivePtr VisualModelPtr; -- 2.34.1