Bug 1090329 - gfxHarfBuzzShaper::GetGlyphVAdvance should never use the backend-specific GetGlyphWidth method, which is for horizontal width only. r=smontagu
authorJonathan Kew <jkew@mozilla.com>
Tue, 06 Jan 2015 20:56:01 +0000
changeset 239004 67960aabce3a3bbd721fe910060d0a418123c84b
parent 239003 d8541085a5d5db35923abaf900aded4b1e1a3a3e
child 239005 d260f281dfe6dc46fb7398f86e5ed77d1f5ebf45
push id7472
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 20:36:27 +0000
treeherdermozilla-aurora@300ca104f8fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs1090329
milestone37.0a1
Bug 1090329 - gfxHarfBuzzShaper::GetGlyphVAdvance should never use the backend-specific GetGlyphWidth method, which is for horizontal width only. r=smontagu
gfx/thebes/gfxHarfBuzzShaper.cpp
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -248,20 +248,20 @@ gfxHarfBuzzShaper::HBGetGlyphHAdvance(hb
 
 /* static */
 hb_position_t
 gfxHarfBuzzShaper::HBGetGlyphVAdvance(hb_font_t *font, void *font_data,
                                       hb_codepoint_t glyph, void *user_data)
 {
     const gfxHarfBuzzShaper::FontCallbackData *fcd =
         static_cast<const gfxHarfBuzzShaper::FontCallbackData*>(font_data);
-    gfxFont *gfxfont = fcd->mShaper->GetFont();
-    if (gfxfont->ProvidesGlyphWidths()) {
-        return gfxfont->GetGlyphWidth(*fcd->mContext->GetDrawTarget(), glyph);
-    }
+    // Currently, we don't offer gfxFont subclasses a method to override this
+    // and provide hinted platform-specific vertical advances (analogous to the
+    // GetGlyphWidth method for horizontal advances). If that proves necessary,
+    // we'll add a new gfxFont method and call it from here.
     return fcd->mShaper->GetGlyphVAdvance(glyph);
 }
 
 /* static */
 hb_bool_t
 gfxHarfBuzzShaper::HBGetGlyphHOrigin(hb_font_t *font, void *font_data,
                                      hb_codepoint_t glyph,
                                      hb_position_t *x, hb_position_t *y,