| Index: third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
|
| diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
|
| index 07c733561eb673c384bae6c7bf0d828326a4b6d3..ec4178843c45a72f90f71ec4e3314d3e510f402a 100644
|
| --- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
|
| +++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.cpp
|
| @@ -373,6 +373,11 @@ PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescri
|
|
|
| FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
|
| {
|
| + if (!m_platformData.size())
|
| + return FloatRect();
|
| +
|
| + static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated.");
|
| +
|
| SkRect bounds;
|
| SkiaTextMetrics(&m_paint).getSkiaBoundsForGlyph(glyph, &bounds);
|
| return FloatRect(bounds);
|
| @@ -380,6 +385,11 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
|
|
|
| float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
|
| {
|
| + if (!m_platformData.size())
|
| + return 0;
|
| +
|
| + static_assert(sizeof(glyph) == 2, "Glyph id should not be truncated.");
|
| +
|
| return SkiaTextMetrics(&m_paint).getSkiaWidthForGlyph(glyph);
|
| }
|
|
|
|
|