diff options
author | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 10:18:42 +0000 |
---|---|---|
committer | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 10:18:42 +0000 |
commit | 6002a4f38fa52c3d5ffafff7af5c80b3620f2b69 (patch) | |
tree | 55db03775c4538e277df212413f6acce28513c8d /ui/gfx/render_text_win.h | |
parent | cb66c5afe08ffd1bc5e5a3602e14bad192d79c31 (diff) | |
download | chromium_src-6002a4f38fa52c3d5ffafff7af5c80b3620f2b69.zip chromium_src-6002a4f38fa52c3d5ffafff7af5c80b3620f2b69.tar.gz chromium_src-6002a4f38fa52c3d5ffafff7af5c80b3620f2b69.tar.bz2 |
Separate selection highlight from pango layout, highlight selection using skia.
Cache substring bounds to avoid unnecessary g_free. Consolidate drawing functions with RenderTextWin. Remove UpdateLayout() from RenderText::SetSelectionModel().
BUG=103647
TEST=TextfieldViewModelTest; Manual test selection highlight on bidi text.
(Do not really know how to test "fi" ligature part. But since the selection
highlight is not done by using pango attribute, I would assume that solves the problem).
Review URL: http://codereview.chromium.org/8536047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112188 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text_win.h')
-rw-r--r-- | ui/gfx/render_text_win.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ui/gfx/render_text_win.h b/ui/gfx/render_text_win.h index 1711d7b..5733760 100644 --- a/ui/gfx/render_text_win.h +++ b/ui/gfx/render_text_win.h @@ -60,7 +60,6 @@ class RenderTextWin : public RenderText { // Overridden from RenderText: virtual int GetStringWidth() OVERRIDE; - virtual void Draw(Canvas* canvas) OVERRIDE; virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE; virtual Rect GetCursorBounds(const SelectionModel& selection, bool insert_mode) OVERRIDE; @@ -73,14 +72,17 @@ class RenderTextWin : public RenderText { BreakType break_type) OVERRIDE; virtual SelectionModel LeftEndSelectionModel() OVERRIDE; virtual SelectionModel RightEndSelectionModel() OVERRIDE; - virtual std::vector<Rect> GetSubstringBounds(size_t from, size_t to) OVERRIDE; + virtual void GetSubstringBounds(size_t from, + size_t to, + std::vector<Rect>* bounds) OVERRIDE; virtual bool IsCursorablePosition(size_t position) OVERRIDE; virtual void UpdateLayout() OVERRIDE; + virtual void EnsureLayout() OVERRIDE; + virtual void DrawVisualText(Canvas* canvas) OVERRIDE; private: virtual size_t IndexOfAdjacentGrapheme(size_t index, bool next) OVERRIDE; - void EnsureLayout(); void ItemizeLogicalText(); void LayoutVisualText(); @@ -100,11 +102,6 @@ class RenderTextWin : public RenderText { SelectionModel LeftSelectionModel(const SelectionModel& selection); SelectionModel RightSelectionModel(const SelectionModel& selection); - // Draw the text, cursor, and selection. - void DrawSelection(Canvas* canvas); - void DrawVisualText(Canvas* canvas); - void DrawCursor(Canvas* canvas); - // National Language Support native digit and digit substitution settings. SCRIPT_DIGITSUBSTITUTE digit_substitute_; |