| Index: ui/gfx/render_text.h
|
| diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
|
| index 5913f4dcb68cb40b63885d37f6b788aaef8f8069..9cc003d505679964cde751dec50230bc06a462d3 100644
|
| --- a/ui/gfx/render_text.h
|
| +++ b/ui/gfx/render_text.h
|
| @@ -62,7 +62,7 @@ class GFX_EXPORT SkiaTextRenderer {
|
| bool subpixel_rendering_suppressed);
|
| void SetTypeface(SkTypeface* typeface);
|
| void SetTextSize(SkScalar size);
|
| - void SetFontWithStyle(const Font& font, int font_style);
|
| + void SetFont(const Font& font, bool italic, gfx::Font::Weight weight);
|
| void SetForegroundColor(SkColor foreground);
|
| void SetShader(sk_sp<SkShader> shader);
|
| // Sets underline metrics to use if the text will be drawn with an underline.
|
| @@ -123,6 +123,7 @@ class StyleIterator {
|
| public:
|
| StyleIterator(const BreakList<SkColor>& colors,
|
| const BreakList<BaselineStyle>& baselines,
|
| + const BreakList<gfx::Font::Weight>& weights,
|
| const std::vector<BreakList<bool>>& styles);
|
| ~StyleIterator();
|
|
|
| @@ -130,6 +131,7 @@ class StyleIterator {
|
| SkColor color() const { return color_->second; }
|
| BaselineStyle baseline() const { return baseline_->second; }
|
| bool style(TextStyle s) const { return style_[s]->second; }
|
| + gfx::Font::Weight weight() const { return weight_->second; }
|
|
|
| // Get the intersecting range of the current iterator set.
|
| Range GetRange() const;
|
| @@ -140,10 +142,12 @@ class StyleIterator {
|
| private:
|
| BreakList<SkColor> colors_;
|
| BreakList<BaselineStyle> baselines_;
|
| + BreakList<gfx::Font::Weight> weights_;
|
| std::vector<BreakList<bool> > styles_;
|
|
|
| BreakList<SkColor>::const_iterator color_;
|
| BreakList<BaselineStyle>::const_iterator baseline_;
|
| + BreakList<gfx::Font::Weight>::const_iterator weight_;
|
| std::vector<BreakList<bool>::const_iterator> style_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(StyleIterator);
|
| @@ -186,9 +190,10 @@ struct Line {
|
| int baseline;
|
| };
|
|
|
| -// Creates an SkTypeface from a font and a |gfx::Font::FontStyle|.
|
| -// May return NULL.
|
| -skia::RefPtr<SkTypeface> CreateSkiaTypeface(const gfx::Font& font, int style);
|
| +// Creates an SkTypeface from a font, italic flag and weight. May return NULL.
|
| +skia::RefPtr<SkTypeface> CreateSkiaTypeface(const gfx::Font& font,
|
| + bool italic,
|
| + gfx::Font::Weight weight);
|
|
|
| // Applies the given FontRenderParams to a Skia |paint|.
|
| void ApplyRenderParams(const FontRenderParams& params,
|
| @@ -363,6 +368,9 @@ class GFX_EXPORT RenderText {
|
| void SetStyle(TextStyle style, bool value);
|
| void ApplyStyle(TextStyle style, bool value, const Range& range);
|
|
|
| + void SetWeight(gfx::Font::Weight weight);
|
| + void ApplyWeight(gfx::Font::Weight weight, const Range& range);
|
| +
|
| // Returns whether this style is enabled consistently across the entire
|
| // RenderText.
|
| bool GetStyle(TextStyle style) const;
|
| @@ -486,6 +494,7 @@ class GFX_EXPORT RenderText {
|
|
|
| const BreakList<SkColor>& colors() const { return colors_; }
|
| const BreakList<BaselineStyle>& baselines() const { return baselines_; }
|
| + const BreakList<gfx::Font::Weight>& weights() const { return weights_; }
|
| const std::vector<BreakList<bool> >& styles() const { return styles_; }
|
|
|
| const std::vector<internal::Line>& lines() const { return lines_; }
|
| @@ -741,6 +750,7 @@ class GFX_EXPORT RenderText {
|
| // TODO(msw): Expand to support cursor, selection, background, etc. colors.
|
| BreakList<SkColor> colors_;
|
| BreakList<BaselineStyle> baselines_;
|
| + BreakList<gfx::Font::Weight> weights_;
|
| std::vector<BreakList<bool> > styles_;
|
|
|
| // Breaks saved without temporary composition and selection styling.
|
|
|