Merge "Enhance texteditor background drawing performance" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / visual-model-impl.cpp
index 3fa3975..490bae3 100644 (file)
@@ -254,6 +254,12 @@ void VisualModel::GetNumberOfLines(GlyphIndex glyphIndex,
   }
 }
 
+LineIndex VisualModel::GetLineOfGlyph( GlyphIndex glyphIndex )
+{
+  const CharacterIndex characterIndex = *(mGlyphsToCharacters.Begin() + glyphIndex);
+  return GetLineOfCharacter(characterIndex);
+}
+
 void VisualModel::GetLinesOfGlyphRange(LineRun*   lines,
                                        GlyphIndex glyphIndex,
                                        Length     numberOfGlyphs) const
@@ -305,13 +311,13 @@ LineIndex VisualModel::GetLineOfCharacter(CharacterIndex characterIndex)
   return index;
 }
 
-void VisualModel::GetUnderlineRuns(GlyphRun*         underlineRuns,
-                                   UnderlineRunIndex index,
-                                   Length            numberOfRuns) const
+void VisualModel::GetUnderlineRuns(UnderlinedGlyphRun* underlineRuns,
+                                   UnderlineRunIndex   index,
+                                   Length              numberOfRuns) const
 {
   memcpy(underlineRuns,
          mUnderlineRuns.Begin() + index,
-         numberOfRuns * sizeof(GlyphRun));
+         numberOfRuns * sizeof(UnderlinedGlyphRun));
 }
 
 void VisualModel::SetNaturalSize(const Vector2& size)
@@ -609,6 +615,16 @@ Length VisualModel::GetNumberOfStrikethroughRuns() const
   return mStrikethroughRuns.Count();
 }
 
+Length VisualModel::GetNumberOfCharacterSpacingGlyphRuns() const
+{
+  return mCharacterSpacingRuns.Count();
+}
+
+const Vector<CharacterSpacingGlyphRun>& VisualModel::GetCharacterSpacingGlyphRuns() const
+{
+  return mCharacterSpacingRuns;
+}
+
 void VisualModel::ClearCaches()
 {
   mCachedLineIndex = 0u;