| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov | 3 * Copyright (C) 2006 Alexey Proskuryakov |
| 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 | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 bool SimpleFontData::isTextOrientationFallbackOf( | 351 bool SimpleFontData::isTextOrientationFallbackOf( |
| 352 const SimpleFontData* fontData) const { | 352 const SimpleFontData* fontData) const { |
| 353 if (!isTextOrientationFallback() || !fontData->m_derivedFontData) | 353 if (!isTextOrientationFallback() || !fontData->m_derivedFontData) |
| 354 return false; | 354 return false; |
| 355 return fontData->m_derivedFontData->uprightOrientation == this || | 355 return fontData->m_derivedFontData->uprightOrientation == this || |
| 356 fontData->m_derivedFontData->verticalRightOrientation == this; | 356 fontData->m_derivedFontData->verticalRightOrientation == this; |
| 357 } | 357 } |
| 358 | 358 |
| 359 std::unique_ptr<SimpleFontData::DerivedFontData> | 359 std::unique_ptr<SimpleFontData::DerivedFontData> |
| 360 SimpleFontData::DerivedFontData::create() { | 360 SimpleFontData::DerivedFontData::create() { |
| 361 return wrapUnique(new DerivedFontData()); | 361 return WTF::wrapUnique(new DerivedFontData()); |
| 362 } | 362 } |
| 363 | 363 |
| 364 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData( | 364 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData( |
| 365 const FontDescription& fontDescription, | 365 const FontDescription& fontDescription, |
| 366 float scaleFactor) const { | 366 float scaleFactor) const { |
| 367 const float scaledSize = | 367 const float scaledSize = |
| 368 lroundf(fontDescription.computedSize() * scaleFactor); | 368 lroundf(fontDescription.computedSize() * scaleFactor); |
| 369 return SimpleFontData::create( | 369 return SimpleFontData::create( |
| 370 FontPlatformData(m_platformData, scaledSize), | 370 FontPlatformData(m_platformData, scaledSize), |
| 371 isCustomFont() ? CustomFontData::create() : nullptr); | 371 isCustomFont() ? CustomFontData::create() : nullptr); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 385 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const { | 385 float SimpleFontData::platformWidthForGlyph(Glyph glyph) const { |
| 386 if (!m_platformData.size()) | 386 if (!m_platformData.size()) |
| 387 return 0; | 387 return 0; |
| 388 | 388 |
| 389 static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); | 389 static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated."); |
| 390 | 390 |
| 391 return SkiaTextMetrics(&m_paint).getSkiaWidthForGlyph(glyph); | 391 return SkiaTextMetrics(&m_paint).getSkiaWidthForGlyph(glyph); |
| 392 } | 392 } |
| 393 | 393 |
| 394 } // namespace blink | 394 } // namespace blink |
| OLD | NEW |