diff options
author | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 20:47:04 +0000 |
---|---|---|
committer | xji@chromium.org <xji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 20:47:04 +0000 |
commit | caa9e1e23f2dadcb33e531e23f0697efb41a3895 (patch) | |
tree | 006e80626be1a644cec94680dd16da003f3f16b2 /ui/gfx/render_text_linux.cc | |
parent | f91a420e470378bfa70882f3c58e4a80cf2302f4 (diff) | |
download | chromium_src-caa9e1e23f2dadcb33e531e23f0697efb41a3895.zip chromium_src-caa9e1e23f2dadcb33e531e23f0697efb41a3895.tar.gz chromium_src-caa9e1e23f2dadcb33e531e23f0697efb41a3895.tar.bz2 |
Rename UpdateLayout() to ResetLayout() which is more accurate.
Review URL: http://codereview.chromium.org/9691002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text_linux.cc')
-rw-r--r-- | ui/gfx/render_text_linux.cc | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc index dafa9e1..4b14819 100644 --- a/ui/gfx/render_text_linux.cc +++ b/ui/gfx/render_text_linux.cc @@ -218,8 +218,26 @@ bool RenderTextLinux::IsCursorablePosition(size_t position) { return (offset < num_log_attrs_ && log_attrs_[offset].is_cursor_position); } -void RenderTextLinux::UpdateLayout() { - ResetLayout(); +void RenderTextLinux::ResetLayout() { + // set_cached_bounds_and_offset_valid(false) is done in RenderText for every + // operation that triggers ResetLayout(). + if (layout_) { + g_object_unref(layout_); + layout_ = NULL; + } + if (current_line_) { + pango_layout_line_unref(current_line_); + current_line_ = NULL; + } + if (log_attrs_) { + g_free(log_attrs_); + log_attrs_ = NULL; + num_log_attrs_ = 0; + } + if (!selection_visual_bounds_.empty()) + selection_visual_bounds_.clear(); + layout_text_ = NULL; + layout_text_len_ = 0; } void RenderTextLinux::EnsureLayout() { @@ -448,28 +466,6 @@ SelectionModel RenderTextLinux::LastSelectionModelInsideRun( return SelectionModel(caret, CURSOR_FORWARD); } -void RenderTextLinux::ResetLayout() { - // set_cached_bounds_and_offset_valid(false) is done in RenderText for every - // operation that triggers ResetLayout(). - if (layout_) { - g_object_unref(layout_); - layout_ = NULL; - } - if (current_line_) { - pango_layout_line_unref(current_line_); - current_line_ = NULL; - } - if (log_attrs_) { - g_free(log_attrs_); - log_attrs_ = NULL; - num_log_attrs_ = 0; - } - if (!selection_visual_bounds_.empty()) - selection_visual_bounds_.clear(); - layout_text_ = NULL; - layout_text_len_ = 0; -} - size_t RenderTextLinux::TextIndexToLayoutIndex(size_t text_index) const { // If the text is obscured then |layout_text_| is not the same as |text()|, // but whether or not the text is obscured, the character (code point) offset |