| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/render_text_harfbuzz.h" | 5 #include "ui/gfx/render_text_harfbuzz.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/i18n/bidi_line_iterator.h" | 10 #include "base/i18n/bidi_line_iterator.h" |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 run_list_out->InitIndexMap(); | 1264 run_list_out->InitIndexMap(); |
| 1265 return; | 1265 return; |
| 1266 } | 1266 } |
| 1267 | 1267 |
| 1268 // Temporarily apply composition underlines and selection colors. | 1268 // Temporarily apply composition underlines and selection colors. |
| 1269 ApplyCompositionAndSelectionStyles(); | 1269 ApplyCompositionAndSelectionStyles(); |
| 1270 | 1270 |
| 1271 // Build the run list from the script items and ranged styles and baselines. | 1271 // Build the run list from the script items and ranged styles and baselines. |
| 1272 // Use an empty color BreakList to avoid breaking runs at color boundaries. | 1272 // Use an empty color BreakList to avoid breaking runs at color boundaries. |
| 1273 BreakList<SkColor> empty_colors; | 1273 BreakList<SkColor> empty_colors; |
| 1274 empty_colors.SetMax(text.length()); | 1274 empty_colors.SetMax(colors().max()); |
| 1275 DCHECK_LE(text.size(), baselines().max()); | 1275 DCHECK_LE(text.size(), baselines().max()); |
| 1276 for (const BreakList<bool>& style : styles()) | 1276 for (const BreakList<bool>& style : styles()) |
| 1277 DCHECK_LE(text.size(), style.max()); | 1277 DCHECK_LE(text.size(), style.max()); |
| 1278 internal::StyleIterator style(empty_colors, baselines(), weights(), styles()); | 1278 internal::StyleIterator style(empty_colors, baselines(), weights(), styles()); |
| 1279 | 1279 |
| 1280 for (size_t run_break = 0; run_break < text.length();) { | 1280 for (size_t run_break = 0; run_break < text.length();) { |
| 1281 internal::TextRunHarfBuzz* run = | 1281 internal::TextRunHarfBuzz* run = |
| 1282 new internal::TextRunHarfBuzz(font_list().GetPrimaryFont()); | 1282 new internal::TextRunHarfBuzz(font_list().GetPrimaryFont()); |
| 1283 run->range.set_start(run_break); | 1283 run->range.set_start(run_break); |
| 1284 run->italic = style.style(ITALIC); | 1284 run->italic = style.style(ITALIC); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1584 DCHECK(!update_layout_run_list_); | 1584 DCHECK(!update_layout_run_list_); |
| 1585 DCHECK(!update_display_run_list_); | 1585 DCHECK(!update_display_run_list_); |
| 1586 return text_elided() ? display_run_list_.get() : &layout_run_list_; | 1586 return text_elided() ? display_run_list_.get() : &layout_run_list_; |
| 1587 } | 1587 } |
| 1588 | 1588 |
| 1589 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const { | 1589 const internal::TextRunList* RenderTextHarfBuzz::GetRunList() const { |
| 1590 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList(); | 1590 return const_cast<RenderTextHarfBuzz*>(this)->GetRunList(); |
| 1591 } | 1591 } |
| 1592 | 1592 |
| 1593 } // namespace gfx | 1593 } // namespace gfx |
| OLD | NEW |