Chromium Code Reviews| Index: ui/gfx/render_text.h |
| diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h |
| index 6c094dcc36d51c6e29574aeedcedb47376a3a38c..1147c6723049d0304803c28152a140a7d756d440 100644 |
| --- a/ui/gfx/render_text.h |
| +++ b/ui/gfx/render_text.h |
| @@ -113,11 +113,13 @@ class SkiaTextRenderer { |
| class StyleIterator { |
| public: |
| StyleIterator(const BreakList<SkColor>& colors, |
| + const BreakList<BaselineStyle>& baselines, |
| const std::vector<BreakList<bool> >& styles); |
| ~StyleIterator(); |
| // Get the colors and styles at the current iterator position. |
| SkColor color() const { return color_->second; } |
| + BaselineStyle baseline() const { return (BaselineStyle)baseline_->second; } |
|
msw
2015/02/18 17:07:23
nit: is the cast needed? if so, use static_cast in
dschuyler
2015/02/18 22:36:02
Done.
|
| bool style(TextStyle s) const { return style_[s]->second; } |
| // Get the intersecting range of the current iterator set. |
| @@ -128,9 +130,11 @@ class StyleIterator { |
| private: |
| BreakList<SkColor> colors_; |
| + BreakList<BaselineStyle> baselines_; |
| std::vector<BreakList<bool> > styles_; |
| BreakList<SkColor>::const_iterator color_; |
| + BreakList<BaselineStyle>::const_iterator baseline_; |
| std::vector<BreakList<bool>::const_iterator> style_; |
| DISALLOW_COPY_AND_ASSIGN(StyleIterator); |
| @@ -336,6 +340,12 @@ class GFX_EXPORT RenderText { |
| void SetColor(SkColor value); |
| void ApplyColor(SkColor value, const Range& range); |
| + // Set the text baseline style over the entire text or a logical character |
|
msw
2015/02/18 17:07:23
nit: remove "text" for cleaner comment wrapping.
dschuyler
2015/02/18 22:36:02
Done.
|
| + // range. The |range| should be valid, non-reversed, and within |
| + // [0, text().length()]. |
| + void SetBaselineStyle(BaselineStyle value); |
| + void ApplyBaselineStyle(BaselineStyle value, const Range& range); |
| + |
| // Set various text styles over the entire text or a logical character range. |
| // The respective |style| is applied if |value| is true, or removed if false. |
| // The |range| should be valid, non-reversed, and within [0, text().length()]. |
| @@ -449,6 +459,7 @@ class GFX_EXPORT RenderText { |
| RenderText(); |
| const BreakList<SkColor>& colors() const { return colors_; } |
| + const BreakList<BaselineStyle>& baselines() const { return baselines_; } |
| const std::vector<BreakList<bool> >& styles() const { return styles_; } |
| const std::vector<internal::Line>& lines() const { return lines_; } |
| @@ -676,6 +687,7 @@ class GFX_EXPORT RenderText { |
| // BreakList positions are stored with text indices, not layout indices. |
| // TODO(msw): Expand to support cursor, selection, background, etc. colors. |
| BreakList<SkColor> colors_; |
| + BreakList<BaselineStyle> baselines_; |
| std::vector<BreakList<bool> > styles_; |
| // Breaks saved without temporary composition and selection styling. |