Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2250)

Unified Diff: Source/platform/fonts/shaping/HarfBuzzFace.cpp

Issue 1316843005: Round glyph width and bounds if !SkPaint.isSubpixelText() in complex path (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: NeedsRebaseline Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/text/complex-path-with-no-subpixel-fonts-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « LayoutTests/fast/text/complex-path-with-no-subpixel-fonts-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698