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.h" | 5 #include "ui/gfx/render_text.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <climits> | 10 #include <climits> |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 Rect text_rect = display_rect(); | 1325 Rect text_rect = display_rect(); |
1326 text_rect.Inset(GetAlignmentOffset(0).x(), 0, 0, 0); | 1326 text_rect.Inset(GetAlignmentOffset(0).x(), 0, 0, 0); |
1327 | 1327 |
1328 // TODO(msw): Use the actual text colors corresponding to each faded part. | 1328 // TODO(msw): Use the actual text colors corresponding to each faded part. |
1329 renderer->SetShader( | 1329 renderer->SetShader( |
1330 CreateFadeShader(font_list(), text_rect, left_part, right_part, | 1330 CreateFadeShader(font_list(), text_rect, left_part, right_part, |
1331 SkColorSetA(colors_.breaks().front().second, 0xff))); | 1331 SkColorSetA(colors_.breaks().front().second, 0xff))); |
1332 } | 1332 } |
1333 | 1333 |
1334 void RenderText::ApplyTextShadows(internal::SkiaTextRenderer* renderer) { | 1334 void RenderText::ApplyTextShadows(internal::SkiaTextRenderer* renderer) { |
1335 renderer->SetDrawLooper(CreateShadowDrawLooperCorrectBlur(shadows_)); | 1335 renderer->SetDrawLooper(CreateShadowDrawLooper(shadows_)); |
1336 } | 1336 } |
1337 | 1337 |
1338 base::i18n::TextDirection RenderText::GetTextDirection( | 1338 base::i18n::TextDirection RenderText::GetTextDirection( |
1339 const base::string16& text) { | 1339 const base::string16& text) { |
1340 if (text_direction_ == base::i18n::UNKNOWN_DIRECTION) { | 1340 if (text_direction_ == base::i18n::UNKNOWN_DIRECTION) { |
1341 switch (directionality_mode_) { | 1341 switch (directionality_mode_) { |
1342 case DIRECTIONALITY_FROM_TEXT: | 1342 case DIRECTIONALITY_FROM_TEXT: |
1343 // Derive the direction from the display text, which differs from text() | 1343 // Derive the direction from the display text, which differs from text() |
1344 // in the case of obscured (password) textfields. | 1344 // in the case of obscured (password) textfields. |
1345 text_direction_ = | 1345 text_direction_ = |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 | 1702 |
1703 for (; range_max < length; ++range_max) | 1703 for (; range_max < length; ++range_max) |
1704 if (iter.IsEndOfWord(range_max) || iter.IsStartOfWord(range_max)) | 1704 if (iter.IsEndOfWord(range_max) || iter.IsStartOfWord(range_max)) |
1705 break; | 1705 break; |
1706 | 1706 |
1707 return range.is_reversed() ? Range(range_max, range_min) | 1707 return range.is_reversed() ? Range(range_max, range_min) |
1708 : Range(range_min, range_max); | 1708 : Range(range_min, range_max); |
1709 } | 1709 } |
1710 | 1710 |
1711 } // namespace gfx | 1711 } // namespace gfx |
OLD | NEW |