| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #include "SkPaint.h" | 32 #include "SkPaint.h" |
| 33 #include "SkPath.h" | 33 #include "SkPath.h" |
| 34 #include "SkTypeface.h" | 34 #include "SkTypeface.h" |
| 35 #include "SkTypes.h" | 35 #include "SkTypes.h" |
| 36 #include "platform/fonts/FontDescription.h" | 36 #include "platform/fonts/FontDescription.h" |
| 37 #include "platform/fonts/GlyphPage.h" | 37 #include "platform/fonts/GlyphPage.h" |
| 38 #include "platform/fonts/VDMXParser.h" | 38 #include "platform/fonts/VDMXParser.h" |
| 39 #include "platform/geometry/FloatRect.h" | 39 #include "platform/geometry/FloatRect.h" |
| 40 #include "wtf/MathExtras.h" | 40 #include "wtf/MathExtras.h" |
| 41 #include "wtf/PtrUtil.h" | |
| 42 #include "wtf/allocator/Partitions.h" | 41 #include "wtf/allocator/Partitions.h" |
| 43 #include "wtf/text/CharacterNames.h" | 42 #include "wtf/text/CharacterNames.h" |
| 44 #include "wtf/text/Unicode.h" | 43 #include "wtf/text/Unicode.h" |
| 45 #include <memory> | |
| 46 #include <unicode/unorm.h> | 44 #include <unicode/unorm.h> |
| 47 #include <unicode/utf16.h> | 45 #include <unicode/utf16.h> |
| 48 | 46 |
| 49 namespace blink { | 47 namespace blink { |
| 50 | 48 |
| 51 const float smallCapsFontSizeMultiplier = 0.7f; | 49 const float smallCapsFontSizeMultiplier = 0.7f; |
| 52 const float emphasisMarkFontSizeMultiplier = 0.5f; | 50 const float emphasisMarkFontSizeMultiplier = 0.5f; |
| 53 | 51 |
| 54 #if OS(LINUX) || OS(ANDROID) | 52 #if OS(LINUX) || OS(ANDROID) |
| 55 // This is the largest VDMX table which we'll try to load and parse. | 53 // This is the largest VDMX table which we'll try to load and parse. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 } | 336 } |
| 339 | 337 |
| 340 bool SimpleFontData::isTextOrientationFallbackOf(const SimpleFontData* fontData)
const | 338 bool SimpleFontData::isTextOrientationFallbackOf(const SimpleFontData* fontData)
const |
| 341 { | 339 { |
| 342 if (!isTextOrientationFallback() || !fontData->m_derivedFontData) | 340 if (!isTextOrientationFallback() || !fontData->m_derivedFontData) |
| 343 return false; | 341 return false; |
| 344 return fontData->m_derivedFontData->uprightOrientation == this | 342 return fontData->m_derivedFontData->uprightOrientation == this |
| 345 || fontData->m_derivedFontData->verticalRightOrientation == this; | 343 || fontData->m_derivedFontData->verticalRightOrientation == this; |
| 346 } | 344 } |
| 347 | 345 |
| 348 std::unique_ptr<SimpleFontData::DerivedFontData> SimpleFontData::DerivedFontData
::create(bool forCustomFont) | 346 PassOwnPtr<SimpleFontData::DerivedFontData> SimpleFontData::DerivedFontData::cre
ate(bool forCustomFont) |
| 349 { | 347 { |
| 350 return wrapUnique(new DerivedFontData(forCustomFont)); | 348 return adoptPtr(new DerivedFontData(forCustomFont)); |
| 351 } | 349 } |
| 352 | 350 |
| 353 SimpleFontData::DerivedFontData::~DerivedFontData() | 351 SimpleFontData::DerivedFontData::~DerivedFontData() |
| 354 { | 352 { |
| 355 if (!forCustomFont) | 353 if (!forCustomFont) |
| 356 return; | 354 return; |
| 357 | 355 |
| 358 if (smallCaps) | 356 if (smallCaps) |
| 359 GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get()); | 357 GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get()); |
| 360 if (emphasisMark) | 358 if (emphasisMark) |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 if (glyphs[i]) { | 439 if (glyphs[i]) { |
| 442 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); | 440 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); |
| 443 haveGlyphs = true; | 441 haveGlyphs = true; |
| 444 } | 442 } |
| 445 } | 443 } |
| 446 | 444 |
| 447 return haveGlyphs; | 445 return haveGlyphs; |
| 448 } | 446 } |
| 449 | 447 |
| 450 } // namespace blink | 448 } // namespace blink |
| OLD | NEW |