Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: ui/gfx/render_text.h

Issue 351963002: RenderTextHarfBuzz: Allow mid-glyph cursors in multi-grapheme clusters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index 9fb6151697bf12b04fd6739792f595f283f0a2df..4234e4da18387ff56427f275eb987dbe879447d3 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -37,6 +37,12 @@ struct SkPoint;
class SkShader;
class SkTypeface;
+namespace base {
+namespace i18n {
+class BreakIterator;
+}
+}
+
namespace gfx {
class Canvas;
@@ -432,6 +438,10 @@ class GFX_EXPORT RenderText {
const std::vector<internal::Line>& lines() const { return lines_; }
void set_lines(std::vector<internal::Line>* lines) { lines_.swap(*lines); }
+ base::i18n::BreakIterator* grapheme_iterator() {
+ return grapheme_iterator_.get();
msw 2014/07/25 00:37:00 nit: fix indent
ckocagil 2014/07/29 23:13:41 Done.
+ }
+
// Returns the baseline of the current text. The return value depends on
// the text and its layout while the return value of GetBaseline() doesn't.
// GetAlignmentOffset() takes into account the difference between them.
@@ -705,6 +715,9 @@ class GFX_EXPORT RenderText {
// ResetLayout and on |display_rect_| changes.
std::vector<internal::Line> lines_;
+ // ICU grapheme iterator for the layout text. Can be NULL in case of an error.
+ scoped_ptr<base::i18n::BreakIterator> grapheme_iterator_;
msw 2014/07/25 00:37:00 Move this to RenderTextHarfBuzz if it's only used
ckocagil 2014/07/29 23:13:41 Done.
+
DISALLOW_COPY_AND_ASSIGN(RenderText);
};

Powered by Google App Engine
This is Rietveld 408576698