| 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/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 style.strike = run->strike; | 586 style.strike = run->strike; |
| 587 style.diagonal_strike = run->diagonal_strike; | 587 style.diagonal_strike = run->diagonal_strike; |
| 588 style.underline = run->underline; | 588 style.underline = run->underline; |
| 589 renderer.DrawDecorations(x, y, run->width, style); | 589 renderer.DrawDecorations(x, y, run->width, style); |
| 590 | 590 |
| 591 x = glyph_x; | 591 x = glyph_x; |
| 592 } | 592 } |
| 593 } | 593 } |
| 594 | 594 |
| 595 void RenderTextWin::ItemizeLogicalText() { | 595 void RenderTextWin::ItemizeLogicalText() { |
| 596 runs_.reset(); | 596 runs_.clear(); |
| 597 string_size_ = Size(0, GetFont().GetHeight()); | 597 string_size_ = Size(0, GetFont().GetHeight()); |
| 598 common_baseline_ = 0; | 598 common_baseline_ = 0; |
| 599 | 599 |
| 600 // Use the first strong character direction as the base text direction. | 600 // Use the first strong character direction as the base text direction. |
| 601 // TODO(msw): Use the application text direction instead of LTR by default? | 601 // TODO(msw): Use the application text direction instead of LTR by default? |
| 602 script_state_.uBidiLevel = | 602 script_state_.uBidiLevel = |
| 603 (base::i18n::GetFirstStrongCharacterDirection(text()) == | 603 (base::i18n::GetFirstStrongCharacterDirection(text()) == |
| 604 base::i18n::RIGHT_TO_LEFT) ? 1 : 0; | 604 base::i18n::RIGHT_TO_LEFT) ? 1 : 0; |
| 605 | 605 |
| 606 if (text().empty()) | 606 if (text().empty()) |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 const internal::TextRun* run) { | 949 const internal::TextRun* run) { |
| 950 size_t caret = IndexOfAdjacentGrapheme(run->range.end(), CURSOR_BACKWARD); | 950 size_t caret = IndexOfAdjacentGrapheme(run->range.end(), CURSOR_BACKWARD); |
| 951 return SelectionModel(caret, CURSOR_FORWARD); | 951 return SelectionModel(caret, CURSOR_FORWARD); |
| 952 } | 952 } |
| 953 | 953 |
| 954 RenderText* RenderText::CreateInstance() { | 954 RenderText* RenderText::CreateInstance() { |
| 955 return new RenderTextWin; | 955 return new RenderTextWin; |
| 956 } | 956 } |
| 957 | 957 |
| 958 } // namespace gfx | 958 } // namespace gfx |
| OLD | NEW |