| 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 startCharacter, endCharacter - startCharacter, | 795 startCharacter, endCharacter - startCharacter, |
| 796 TextDirectionToHBDirection(m_run.direction(), m_font->fontDescription().
orientation(), fontData), | 796 TextDirectionToHBDirection(m_run.direction(), m_font->fontDescription().
orientation(), fontData), |
| 797 ICUScriptToHBScript(script))); | 797 ICUScriptToHBScript(script))); |
| 798 } | 798 } |
| 799 | 799 |
| 800 static const uint16_t* toUint16(const UChar* src) | 800 static const uint16_t* toUint16(const UChar* src) |
| 801 { | 801 { |
| 802 // FIXME: This relies on undefined behavior however it works on the | 802 // FIXME: This relies on undefined behavior however it works on the |
| 803 // current versions of all compilers we care about and avoids making | 803 // current versions of all compilers we care about and avoids making |
| 804 // a copy of the string. | 804 // a copy of the string. |
| 805 COMPILE_ASSERT(sizeof(UChar) == sizeof(uint16_t), UChar_is_the_same_size_as_
uint16_t); | 805 static_assert(sizeof(UChar) == sizeof(uint16_t), "UChar should be the same s
ize as uint16_t"); |
| 806 return reinterpret_cast<const uint16_t*>(src); | 806 return reinterpret_cast<const uint16_t*>(src); |
| 807 } | 807 } |
| 808 | 808 |
| 809 bool HarfBuzzShaper::shapeHarfBuzzRuns() | 809 bool HarfBuzzShaper::shapeHarfBuzzRuns() |
| 810 { | 810 { |
| 811 HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_
destroy); | 811 HarfBuzzScopedPtr<hb_buffer_t> harfBuzzBuffer(hb_buffer_create(), hb_buffer_
destroy); |
| 812 | 812 |
| 813 HarfBuzzRunCache& runCache = harfBuzzRunCache(); | 813 HarfBuzzRunCache& runCache = harfBuzzRunCache(); |
| 814 const FontDescription& fontDescription = m_font->fontDescription(); | 814 const FontDescription& fontDescription = m_font->fontDescription(); |
| 815 const String& localeString = fontDescription.locale(); | 815 const String& localeString = fontDescription.locale(); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 // possibly invalid from, to arguments. | 1144 // possibly invalid from, to arguments. |
| 1145 if (!foundToX && !foundFromX) | 1145 if (!foundToX && !foundFromX) |
| 1146 fromX = toX = 0; | 1146 fromX = toX = 0; |
| 1147 | 1147 |
| 1148 if (fromX < toX) | 1148 if (fromX < toX) |
| 1149 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); | 1149 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); |
| 1150 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); | 1150 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); |
| 1151 } | 1151 } |
| 1152 | 1152 |
| 1153 } // namespace blink | 1153 } // namespace blink |
| OLD | NEW |