| 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 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 Rect text_rect = display_rect(); | 1333 Rect text_rect = display_rect(); |
| 1334 text_rect.Inset(GetAlignmentOffset(0).x(), 0, 0, 0); | 1334 text_rect.Inset(GetAlignmentOffset(0).x(), 0, 0, 0); |
| 1335 | 1335 |
| 1336 // TODO(msw): Use the actual text colors corresponding to each faded part. | 1336 // TODO(msw): Use the actual text colors corresponding to each faded part. |
| 1337 renderer->SetShader( | 1337 renderer->SetShader( |
| 1338 CreateFadeShader(font_list(), text_rect, left_part, right_part, | 1338 CreateFadeShader(font_list(), text_rect, left_part, right_part, |
| 1339 SkColorSetA(colors_.breaks().front().second, 0xff))); | 1339 SkColorSetA(colors_.breaks().front().second, 0xff))); |
| 1340 } | 1340 } |
| 1341 | 1341 |
| 1342 void RenderText::ApplyTextShadows(internal::SkiaTextRenderer* renderer) { | 1342 void RenderText::ApplyTextShadows(internal::SkiaTextRenderer* renderer) { |
| 1343 renderer->SetDrawLooper(CreateShadowDrawLooper(shadows_)); | 1343 renderer->SetDrawLooper(CreateShadowDrawLooperCorrectBlur(shadows_)); |
| 1344 } | 1344 } |
| 1345 | 1345 |
| 1346 base::i18n::TextDirection RenderText::GetTextDirection( | 1346 base::i18n::TextDirection RenderText::GetTextDirection( |
| 1347 const base::string16& text) { | 1347 const base::string16& text) { |
| 1348 if (text_direction_ == base::i18n::UNKNOWN_DIRECTION) { | 1348 if (text_direction_ == base::i18n::UNKNOWN_DIRECTION) { |
| 1349 switch (directionality_mode_) { | 1349 switch (directionality_mode_) { |
| 1350 case DIRECTIONALITY_FROM_TEXT: | 1350 case DIRECTIONALITY_FROM_TEXT: |
| 1351 // Derive the direction from the display text, which differs from text() | 1351 // Derive the direction from the display text, which differs from text() |
| 1352 // in the case of obscured (password) textfields. | 1352 // in the case of obscured (password) textfields. |
| 1353 text_direction_ = | 1353 text_direction_ = |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 | 1710 |
| 1711 for (; range_max < length; ++range_max) | 1711 for (; range_max < length; ++range_max) |
| 1712 if (iter.IsEndOfWord(range_max) || iter.IsStartOfWord(range_max)) | 1712 if (iter.IsEndOfWord(range_max) || iter.IsStartOfWord(range_max)) |
| 1713 break; | 1713 break; |
| 1714 | 1714 |
| 1715 return range.is_reversed() ? Range(range_max, range_min) | 1715 return range.is_reversed() ? Range(range_max, range_min) |
| 1716 : Range(range_min, range_max); | 1716 : Range(range_min, range_max); |
| 1717 } | 1717 } |
| 1718 | 1718 |
| 1719 } // namespace gfx | 1719 } // namespace gfx |
| OLD | NEW |