| 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(font_list().GetFontRenderParams(), |
| 813 background_is_transparent()); | 813 background_is_transparent()); |
| 814 | 814 |
| 815 ApplyCompositionAndSelectionStyles(); | 815 ApplyCompositionAndSelectionStyles(); |
| 816 | 816 |
| 817 for (size_t i = 0; i < lines().size(); ++i) { | 817 for (size_t i = 0; i < lines().size(); ++i) { |
| 818 const internal::Line& line = lines()[i]; | 818 const internal::Line& line = lines()[i]; |
| 819 const Vector2d line_offset = GetLineOffset(i); | 819 const Vector2d line_offset = GetLineOffset(i); |
| 820 | 820 |
| 821 // Skip painting empty lines or lines outside the display rect area. | 821 // Skip painting empty lines or lines outside the display rect area. |
| 822 if (!display_rect().Intersects(Rect(PointAtOffsetFromOrigin(line_offset), | 822 if (!display_rect().Intersects(Rect(PointAtOffsetFromOrigin(line_offset), |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 size_t position = LayoutIndexToTextIndex(run->range.end()); | 1275 size_t position = LayoutIndexToTextIndex(run->range.end()); |
| 1276 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); | 1276 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); |
| 1277 return SelectionModel(position, CURSOR_FORWARD); | 1277 return SelectionModel(position, CURSOR_FORWARD); |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 RenderText* RenderText::CreateNativeInstance() { | 1280 RenderText* RenderText::CreateNativeInstance() { |
| 1281 return new RenderTextWin; | 1281 return new RenderTextWin; |
| 1282 } | 1282 } |
| 1283 | 1283 |
| 1284 } // namespace gfx | 1284 } // namespace gfx |
| OLD | NEW |