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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (emphasisMark) | 360 if (emphasisMark) |
361 GlyphPageTreeNode::pruneTreeCustomFontData(emphasisMark.get()); | 361 GlyphPageTreeNode::pruneTreeCustomFontData(emphasisMark.get()); |
362 if (verticalRightOrientation) | 362 if (verticalRightOrientation) |
363 GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get(
)); | 363 GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get(
)); |
364 if (uprightOrientation) | 364 if (uprightOrientation) |
365 GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get()); | 365 GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get()); |
366 } | 366 } |
367 | 367 |
368 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri
ption& fontDescription, float scaleFactor) const | 368 PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri
ption& fontDescription, float scaleFactor) const |
369 { | 369 { |
370 return platformCreateScaledFontData(fontDescription, scaleFactor); | |
371 } | |
372 | |
373 PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const Fo
ntDescription& fontDescription, float scaleFactor) const | |
374 { | |
375 const float scaledSize = lroundf(fontDescription.computedSize() * scaleFacto
r); | 370 const float scaledSize = lroundf(fontDescription.computedSize() * scaleFacto
r); |
376 return SimpleFontData::create(FontPlatformData(m_platformData, scaledSize),
isCustomFont() ? CustomFontData::create() : nullptr); | 371 return SimpleFontData::create(FontPlatformData(m_platformData, scaledSize),
isCustomFont() ? CustomFontData::create() : nullptr); |
377 } | 372 } |
378 | 373 |
379 static inline void getSkiaBoundsForGlyph(SkPaint& paint, Glyph glyph, SkRect& bo
unds) | 374 static inline void getSkiaBoundsForGlyph(SkPaint& paint, Glyph glyph, SkRect& bo
unds) |
380 { | 375 { |
381 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); | 376 paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); |
382 | 377 |
383 SkPath path; | 378 SkPath path; |
384 paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path); | 379 paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 if (glyphs[i]) { | 441 if (glyphs[i]) { |
447 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); | 442 pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); |
448 haveGlyphs = true; | 443 haveGlyphs = true; |
449 } | 444 } |
450 } | 445 } |
451 | 446 |
452 return haveGlyphs; | 447 return haveGlyphs; |
453 } | 448 } |
454 | 449 |
455 } // namespace blink | 450 } // namespace blink |
OLD | NEW |