Chromium Code Reviews| Index: Source/platform/fonts/shaping/HarfBuzzFace.cpp |
| diff --git a/Source/platform/fonts/shaping/HarfBuzzFace.cpp b/Source/platform/fonts/shaping/HarfBuzzFace.cpp |
| index 5c345269de13eb618ab926ce2483c9148a98a74e..59b97c18f6f2f5a8c9ae2aae8416c6f670c8d7f2 100644 |
| --- a/Source/platform/fonts/shaping/HarfBuzzFace.cpp |
| +++ b/Source/platform/fonts/shaping/HarfBuzzFace.cpp |
| @@ -146,9 +146,17 @@ static void SkiaGetGlyphWidthAndExtents(SkPaint* paint, hb_codepoint_t codepoint |
| uint16_t glyph = codepoint; |
| paint->getTextWidths(&glyph, sizeof(glyph), &skWidth, &skBounds); |
| - if (width) |
| + if (width) { |
| + if (!paint->isSubpixelText()) |
| + skWidth = SkScalarRoundToInt(skWidth); |
| *width = SkiaScalarToHarfBuzzPosition(skWidth); |
| + } |
| if (extents) { |
| + if (!paint->isSubpixelText()) { |
|
jbroman
2015/08/30 16:08:05
drive-by question: Are these used to populate the
|
| + SkIRect ir; |
| + skBounds.round(&ir); |
| + skBounds.set(ir); |
| + } |
| // Invert y-axis because Skia is y-grows-down but we set up HarfBuzz to be y-grows-up. |
| extents->x_bearing = SkiaScalarToHarfBuzzPosition(skBounds.fLeft); |
| extents->y_bearing = SkiaScalarToHarfBuzzPosition(-skBounds.fTop); |