Chromium Code Reviews| Index: ui/gfx/render_text_harfbuzz.cc |
| diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc |
| index 590537ebe63c281f96724e670dc537190cdada03..59e82f82b6614841282196ff035719e3e82d4514 100644 |
| --- a/ui/gfx/render_text_harfbuzz.cc |
| +++ b/ui/gfx/render_text_harfbuzz.cc |
| @@ -576,11 +576,11 @@ TextRunHarfBuzz::TextRunHarfBuzz() |
| font_size(0), |
| baseline_offset(0), |
| baseline_type(0), |
| - font_style(0), |
| + italic(false), |
| + weight(gfx::Font::Weight::NORMAL), |
|
Alexei Svitkine (slow)
2016/04/05 16:38:53
Remove gfx::
|
| strike(false), |
| diagonal_strike(false), |
| - underline(false) { |
| -} |
| + underline(false) {} |
| TextRunHarfBuzz::~TextRunHarfBuzz() {} |
| @@ -1260,17 +1260,17 @@ void RenderTextHarfBuzz::ItemizeTextToRuns( |
| DCHECK_LE(text.size(), baselines().max()); |
| for (const BreakList<bool>& style : styles()) |
| DCHECK_LE(text.size(), style.max()); |
| - internal::StyleIterator style(empty_colors, baselines(), styles()); |
| + internal::StyleIterator style(empty_colors, baselines(), weights(), styles()); |
| for (size_t run_break = 0; run_break < text.length();) { |
| internal::TextRunHarfBuzz* run = new internal::TextRunHarfBuzz; |
| run->range.set_start(run_break); |
| - run->font_style = (style.style(BOLD) ? Font::BOLD : 0) | |
| - (style.style(ITALIC) ? Font::ITALIC : 0); |
| + run->italic = style.style(ITALIC); |
| run->baseline_type = style.baseline(); |
| run->strike = style.style(STRIKE); |
| run->diagonal_strike = style.style(DIAGONAL_STRIKE); |
| run->underline = style.style(UNDERLINE); |
| + run->weight = style.weight(); |
| int32_t script_item_break = 0; |
| bidi_iterator.GetLogicalRun(run_break, &script_item_break, &run->level); |
| CHECK_GT(static_cast<size_t>(script_item_break), run_break); |
| @@ -1435,7 +1435,7 @@ void RenderTextHarfBuzz::ShapeRun(const base::string16& text, |
| FontRenderParamsQuery query; |
| query.families.push_back(font_name); |
| query.pixel_size = run->font_size; |
| - query.style = run->font_style; |
| + query.style = run->italic ? gfx::Font::ITALIC : 0; |
|
Alexei Svitkine (slow)
2016/04/05 16:38:53
Remove gfx::
|
| FontRenderParams fallback_render_params = GetFontRenderParams(query, NULL); |
| if (CompareFamily(text, font, fallback_render_params, run, &best_font, |
| &best_render_params, &best_missing_glyphs)) |
| @@ -1456,7 +1456,7 @@ bool RenderTextHarfBuzz::ShapeRunWithFont(const base::string16& text, |
| const FontRenderParams& params, |
| internal::TextRunHarfBuzz* run) { |
| skia::RefPtr<SkTypeface> skia_face = |
| - internal::CreateSkiaTypeface(font, run->font_style); |
| + internal::CreateSkiaTypeface(font, run->italic, run->weight); |
| if (skia_face == NULL) |
| return false; |
| run->skia_face = skia_face; |