| 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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 } | 772 } |
| 773 } | 773 } |
| 774 | 774 |
| 775 void RenderTextHarfBuzz::DrawVisualText(Canvas* canvas) { | 775 void RenderTextHarfBuzz::DrawVisualText(Canvas* canvas) { |
| 776 DCHECK(!needs_layout_); | 776 DCHECK(!needs_layout_); |
| 777 internal::SkiaTextRenderer renderer(canvas); | 777 internal::SkiaTextRenderer renderer(canvas); |
| 778 ApplyFadeEffects(&renderer); | 778 ApplyFadeEffects(&renderer); |
| 779 ApplyTextShadows(&renderer); | 779 ApplyTextShadows(&renderer); |
| 780 | 780 |
| 781 #if defined(OS_WIN) || defined(OS_LINUX) | 781 #if defined(OS_WIN) || defined(OS_LINUX) |
| 782 // TODO(derat): Use font-specific params: http://crbug.com/125235 | 782 renderer.SetFontRenderParams(font_list().GetFontRenderParams(), |
| 783 renderer.SetFontRenderParams(GetDefaultFontRenderParams(), | |
| 784 background_is_transparent()); | 783 background_is_transparent()); |
| 785 #endif | 784 #endif |
| 786 | 785 |
| 787 ApplyCompositionAndSelectionStyles(); | 786 ApplyCompositionAndSelectionStyles(); |
| 788 | 787 |
| 789 int current_x = 0; | 788 int current_x = 0; |
| 790 const Vector2d line_offset = GetLineOffset(0); | 789 const Vector2d line_offset = GetLineOffset(0); |
| 791 for (size_t i = 0; i < runs_.size(); ++i) { | 790 for (size_t i = 0; i < runs_.size(); ++i) { |
| 792 const internal::TextRunHarfBuzz& run = *runs_[visual_to_logical_[i]]; | 791 const internal::TextRunHarfBuzz& run = *runs_[visual_to_logical_[i]]; |
| 793 renderer.SetTypeface(run.skia_face.get()); | 792 renderer.SetTypeface(run.skia_face.get()); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 run->positions[i].set(run->width + x_offset, y_offset); | 992 run->positions[i].set(run->width + x_offset, y_offset); |
| 994 run->width += | 993 run->width += |
| 995 SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_advance)); | 994 SkScalarRoundToInt(SkFixedToScalar(hb_positions[i].x_advance)); |
| 996 } | 995 } |
| 997 | 996 |
| 998 hb_buffer_destroy(buffer); | 997 hb_buffer_destroy(buffer); |
| 999 hb_font_destroy(harfbuzz_font); | 998 hb_font_destroy(harfbuzz_font); |
| 1000 } | 999 } |
| 1001 | 1000 |
| 1002 } // namespace gfx | 1001 } // namespace gfx |
| OLD | NEW |