OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. | 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 | 832 |
833 hb_buffer_set_language(harfBuzzBuffer.get(), hb_language_from_string(loc
ale.data(), locale.length())); | 833 hb_buffer_set_language(harfBuzzBuffer.get(), hb_language_from_string(loc
ale.data(), locale.length())); |
834 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); | 834 hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); |
835 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction()); | 835 hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction()); |
836 | 836 |
837 const UChar* src = m_normalizedBuffer.get() + currentRun->startIndex(); | 837 const UChar* src = m_normalizedBuffer.get() + currentRun->startIndex(); |
838 std::wstring key(src, src + currentRun->numCharacters()); | 838 std::wstring key(src, src + currentRun->numCharacters()); |
839 | 839 |
840 CachedShapingResults* cachedResults = runCache.find(key); | 840 CachedShapingResults* cachedResults = runCache.find(key); |
841 if (cachedResults) { | 841 if (cachedResults) { |
842 if (cachedResults->dir == currentRun->direction() && cachedResults->
font == *m_font && cachedResults->locale == localeString) { | 842 if (cachedResults->dir == currentRun->direction() && cachedResults->
font == *m_font |
| 843 && !cachedResults->font.loadingCustomFonts() && !m_font->loading
CustomFonts() && cachedResults->locale == localeString) { |
843 currentRun->applyShapeResult(cachedResults->buffer); | 844 currentRun->applyShapeResult(cachedResults->buffer); |
844 setGlyphPositionsForHarfBuzzRun(currentRun, cachedResults->buffe
r); | 845 setGlyphPositionsForHarfBuzzRun(currentRun, cachedResults->buffe
r); |
845 | 846 |
846 hb_buffer_clear_contents(harfBuzzBuffer.get()); | 847 hb_buffer_clear_contents(harfBuzzBuffer.get()); |
847 | 848 |
848 runCache.moveToBack(cachedResults); | 849 runCache.moveToBack(cachedResults); |
849 | 850 |
850 continue; | 851 continue; |
851 } | 852 } |
852 | 853 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 fromX = 0; | 1143 fromX = 0; |
1143 if (!foundToX) | 1144 if (!foundToX) |
1144 toX = m_run.rtl() ? 0 : m_totalWidth; | 1145 toX = m_run.rtl() ? 0 : m_totalWidth; |
1145 | 1146 |
1146 if (fromX < toX) | 1147 if (fromX < toX) |
1147 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); | 1148 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); |
1148 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); | 1149 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); |
1149 } | 1150 } |
1150 | 1151 |
1151 } // namespace blink | 1152 } // namespace blink |
OLD | NEW |