| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Brent Fulgham | 2 * Copyright (C) 2011 Brent Fulgham |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (!foundSpaceInTable && (features & Ligatures)) | 303 if (!foundSpaceInTable && (features & Ligatures)) |
| 304 foundSpaceInTable = tableHasSpace(face, glyphs, HB_OT_TAG_GSUB, space); | 304 foundSpaceInTable = tableHasSpace(face, glyphs, HB_OT_TAG_GSUB, space); |
| 305 | 305 |
| 306 hb_set_destroy(glyphs); | 306 hb_set_destroy(glyphs); |
| 307 | 307 |
| 308 return foundSpaceInTable; | 308 return foundSpaceInTable; |
| 309 } | 309 } |
| 310 | 310 |
| 311 unsigned FontPlatformData::hash() const { | 311 unsigned FontPlatformData::hash() const { |
| 312 unsigned h = SkTypeface::UniqueID(typeface()); | 312 unsigned h = SkTypeface::UniqueID(typeface()); |
| 313 h ^= 0x01010101 * ((static_cast<int>(m_isHashTableDeletedValue) << 3) | | 313 h ^= 0x01010101 * |
| 314 (static_cast<int>(m_orientation) << 2) | | 314 ((static_cast<int>(m_isHashTableDeletedValue) << 3) | |
| 315 (static_cast<int>(m_syntheticBold) << 1) | | 315 (static_cast<int>(m_orientation) << 2) | |
| 316 static_cast<int>(m_syntheticItalic)); | 316 (static_cast<int>(m_syntheticBold) << 1) | |
| 317 static_cast<int>(m_syntheticItalic)); |
| 317 | 318 |
| 318 // This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing | 319 // This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing |
| 319 // rules. Memcpy is generally optimized enough so that performance doesn't | 320 // rules. Memcpy is generally optimized enough so that performance doesn't |
| 320 // matter here. | 321 // matter here. |
| 321 uint32_t textSizeBytes; | 322 uint32_t textSizeBytes; |
| 322 memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t)); | 323 memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t)); |
| 323 h ^= textSizeBytes; | 324 h ^= textSizeBytes; |
| 324 | 325 |
| 325 return h; | 326 return h; |
| 326 } | 327 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 349 const size_t tableSize = m_typeface->getTableSize(tag); | 350 const size_t tableSize = m_typeface->getTableSize(tag); |
| 350 if (tableSize) { | 351 if (tableSize) { |
| 351 Vector<char> tableBuffer(tableSize); | 352 Vector<char> tableBuffer(tableSize); |
| 352 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); | 353 m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); |
| 353 buffer = SharedBuffer::adoptVector(tableBuffer); | 354 buffer = SharedBuffer::adoptVector(tableBuffer); |
| 354 } | 355 } |
| 355 return buffer.release(); | 356 return buffer.release(); |
| 356 } | 357 } |
| 357 | 358 |
| 358 } // namespace blink | 359 } // namespace blink |
| OLD | NEW |