OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_win.h" | 5 #include "ui/gfx/render_text_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/break_iterator.h" | 9 #include "base/i18n/break_iterator.h" |
10 #include "base/i18n/char_iterator.h" | 10 #include "base/i18n/char_iterator.h" |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 void RenderTextWin::DrawVisualText(Canvas* canvas) { | 802 void RenderTextWin::DrawVisualText(Canvas* canvas) { |
803 DCHECK(!needs_layout_); | 803 DCHECK(!needs_layout_); |
804 DCHECK(!lines().empty()); | 804 DCHECK(!lines().empty()); |
805 | 805 |
806 std::vector<SkPoint> pos; | 806 std::vector<SkPoint> pos; |
807 | 807 |
808 internal::SkiaTextRenderer renderer(canvas); | 808 internal::SkiaTextRenderer renderer(canvas); |
809 ApplyFadeEffects(&renderer); | 809 ApplyFadeEffects(&renderer); |
810 ApplyTextShadows(&renderer); | 810 ApplyTextShadows(&renderer); |
811 | 811 |
812 renderer.SetFontRenderParams(GetDefaultFontRenderParams(), | 812 renderer.SetFontRenderParams( |
813 background_is_transparent()); | 813 font_list().GetPrimaryFont().GetFontRenderParams(), |
| 814 background_is_transparent()); |
814 | 815 |
815 ApplyCompositionAndSelectionStyles(); | 816 ApplyCompositionAndSelectionStyles(); |
816 | 817 |
817 for (size_t i = 0; i < lines().size(); ++i) { | 818 for (size_t i = 0; i < lines().size(); ++i) { |
818 const internal::Line& line = lines()[i]; | 819 const internal::Line& line = lines()[i]; |
819 const Vector2d line_offset = GetLineOffset(i); | 820 const Vector2d line_offset = GetLineOffset(i); |
820 | 821 |
821 // Skip painting empty lines or lines outside the display rect area. | 822 // Skip painting empty lines or lines outside the display rect area. |
822 if (!display_rect().Intersects(Rect(PointAtOffsetFromOrigin(line_offset), | 823 if (!display_rect().Intersects(Rect(PointAtOffsetFromOrigin(line_offset), |
823 line.size))) | 824 line.size))) |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 size_t position = LayoutIndexToTextIndex(run->range.end()); | 1282 size_t position = LayoutIndexToTextIndex(run->range.end()); |
1282 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); | 1283 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); |
1283 return SelectionModel(position, CURSOR_FORWARD); | 1284 return SelectionModel(position, CURSOR_FORWARD); |
1284 } | 1285 } |
1285 | 1286 |
1286 RenderText* RenderText::CreateNativeInstance() { | 1287 RenderText* RenderText::CreateNativeInstance() { |
1287 return new RenderTextWin; | 1288 return new RenderTextWin; |
1288 } | 1289 } |
1289 | 1290 |
1290 } // namespace gfx | 1291 } // namespace gfx |
OLD | NEW |