| 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 <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/debug/leak_annotations.h" | 9 #include "base/debug/leak_annotations.h" |
| 10 #include "base/i18n/bidi_line_iterator.h" | 10 #include "base/i18n/bidi_line_iterator.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 } // namespace | 398 } // namespace |
| 399 | 399 |
| 400 namespace internal { | 400 namespace internal { |
| 401 | 401 |
| 402 TextRunHarfBuzz::TextRunHarfBuzz() | 402 TextRunHarfBuzz::TextRunHarfBuzz() |
| 403 : width(0), | 403 : width(0), |
| 404 preceding_run_widths(0), | 404 preceding_run_widths(0), |
| 405 is_rtl(false), | 405 is_rtl(false), |
| 406 level(0), | 406 level(0), |
| 407 script(USCRIPT_INVALID_CODE), | 407 script(USCRIPT_INVALID_CODE), |
| 408 glyph_count(-1), | 408 glyph_count(static_cast<size_t>(-1)), |
| 409 font_size(0), | 409 font_size(0), |
| 410 font_style(0), | 410 font_style(0), |
| 411 strike(false), | 411 strike(false), |
| 412 diagonal_strike(false), | 412 diagonal_strike(false), |
| 413 underline(false) {} | 413 underline(false) {} |
| 414 | 414 |
| 415 TextRunHarfBuzz::~TextRunHarfBuzz() {} | 415 TextRunHarfBuzz::~TextRunHarfBuzz() {} |
| 416 | 416 |
| 417 size_t TextRunHarfBuzz::CharToGlyph(size_t pos) const { | 417 size_t TextRunHarfBuzz::CharToGlyph(size_t pos) const { |
| 418 DCHECK(range.start() <= pos && pos < range.end()); | 418 DCHECK(range.start() <= pos && pos < range.end()); |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 run->positions[i].set(run->width + x_offset, -y_offset); | 992 run->positions[i].set(run->width + x_offset, -y_offset); |
| 993 run->width += | 993 run->width += |
| 994 SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_advance)); | 994 SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_advance)); |
| 995 } | 995 } |
| 996 | 996 |
| 997 hb_buffer_destroy(buffer); | 997 hb_buffer_destroy(buffer); |
| 998 hb_font_destroy(harfbuzz_font); | 998 hb_font_destroy(harfbuzz_font); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 } // namespace gfx | 1001 } // namespace gfx |
| OLD | NEW |