| 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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 | 1195 |
| 1196 ItemizeTextToRuns(display_text, display_run_list_.get()); | 1196 ItemizeTextToRuns(display_text, display_run_list_.get()); |
| 1197 | 1197 |
| 1198 // TODO(ckocagil): Remove ScopedTracker below once crbug.com/441028 is | 1198 // TODO(ckocagil): Remove ScopedTracker below once crbug.com/441028 is |
| 1199 // fixed. | 1199 // fixed. |
| 1200 tracked_objects::ScopedTracker tracking_profile( | 1200 tracked_objects::ScopedTracker tracking_profile( |
| 1201 FROM_HERE_WITH_EXPLICIT_FUNCTION("441028 ShapeRunList() 1")); | 1201 FROM_HERE_WITH_EXPLICIT_FUNCTION("441028 ShapeRunList() 1")); |
| 1202 ShapeRunList(display_text, display_run_list_.get()); | 1202 ShapeRunList(display_text, display_run_list_.get()); |
| 1203 } | 1203 } |
| 1204 update_display_run_list_ = false; | 1204 update_display_run_list_ = false; |
| 1205 | |
| 1206 std::vector<internal::Line> empty_lines; | 1205 std::vector<internal::Line> empty_lines; |
| 1207 set_lines(&empty_lines); | 1206 set_lines(&empty_lines); |
| 1208 } | 1207 } |
| 1209 | 1208 |
| 1210 if (lines().empty()) { | 1209 if (lines().empty()) { |
| 1211 // TODO(ckocagil): Remove ScopedTracker below once crbug.com/441028 is | 1210 // TODO(ckocagil): Remove ScopedTracker below once crbug.com/441028 is |
| 1212 // fixed. | 1211 // fixed. |
| 1213 std::unique_ptr<tracked_objects::ScopedTracker> tracking_profile( | 1212 std::unique_ptr<tracked_objects::ScopedTracker> tracking_profile( |
| 1214 new tracked_objects::ScopedTracker( | 1213 new tracked_objects::ScopedTracker( |
| 1215 FROM_HERE_WITH_EXPLICIT_FUNCTION("441028 HarfBuzzLineBreaker"))); | 1214 FROM_HERE_WITH_EXPLICIT_FUNCTION("441028 HarfBuzzLineBreaker"))); |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 TRACE_EVENT0("ui", "RenderTextHarfBuzz:EnsureLayoutRunList"); | 1640 TRACE_EVENT0("ui", "RenderTextHarfBuzz:EnsureLayoutRunList"); |
| 1642 ItemizeTextToRuns(text, &layout_run_list_); | 1641 ItemizeTextToRuns(text, &layout_run_list_); |
| 1643 | 1642 |
| 1644 // TODO(ckocagil): Remove ScopedTracker below once crbug.com/441028 is | 1643 // TODO(ckocagil): Remove ScopedTracker below once crbug.com/441028 is |
| 1645 // fixed. | 1644 // fixed. |
| 1646 tracked_objects::ScopedTracker tracking_profile( | 1645 tracked_objects::ScopedTracker tracking_profile( |
| 1647 FROM_HERE_WITH_EXPLICIT_FUNCTION("441028 ShapeRunList() 2")); | 1646 FROM_HERE_WITH_EXPLICIT_FUNCTION("441028 ShapeRunList() 2")); |
| 1648 ShapeRunList(text, &layout_run_list_); | 1647 ShapeRunList(text, &layout_run_list_); |
| 1649 } | 1648 } |
| 1650 | 1649 |
| 1651 std::vector<internal::Line> empty_lines; | |
| 1652 set_lines(&empty_lines); | |
| 1653 display_run_list_.reset(); | 1650 display_run_list_.reset(); |
| 1654 update_display_text_ = true; | 1651 update_display_text_ = true; |
| 1655 update_layout_run_list_ = false; | 1652 update_layout_run_list_ = false; |
| 1656 } | 1653 } |
| 1657 if (update_display_text_) { | 1654 if (update_display_text_) { |
| 1655 std::vector<internal::Line> empty_lines; |
| 1656 set_lines(&empty_lines); |
| 1658 UpdateDisplayText(multiline() ? 0 : layout_run_list_.width()); | 1657 UpdateDisplayText(multiline() ? 0 : layout_run_list_.width()); |
| 1659 update_display_text_ = false; | 1658 update_display_text_ = false; |
| 1660 update_display_run_list_ = text_elided(); | 1659 update_display_run_list_ = text_elided(); |
| 1661 } | 1660 } |
| 1662 } | 1661 } |
| 1663 | 1662 |
| 1664 internal::TextRunList* RenderTextHarfBuzz::GetRunList() { | 1663 internal::TextRunList* RenderTextHarfBuzz::GetRunList() { |
| 1665 DCHECK(!update_layout_run_list_); | 1664 DCHECK(!update_layout_run_list_); |
| 1666 DCHECK(!update_display_run_list_); | 1665 DCHECK(!update_display_run_list_); |
| 1667 return text_elided() ? display_run_list_.get() : &layout_run_list_; | 1666 return text_elided() ? display_run_list_.get() : &layout_run_list_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1704 | 1703 |
| 1705 attribute.strike = run.strike; | 1704 attribute.strike = run.strike; |
| 1706 attribute.diagonal_strike = run.diagonal_strike; | 1705 attribute.diagonal_strike = run.diagonal_strike; |
| 1707 decorated_text->attributes.push_back(attribute); | 1706 decorated_text->attributes.push_back(attribute); |
| 1708 } | 1707 } |
| 1709 } | 1708 } |
| 1710 return true; | 1709 return true; |
| 1711 } | 1710 } |
| 1712 | 1711 |
| 1713 } // namespace gfx | 1712 } // namespace gfx |
| OLD | NEW |