mozilla-1228540-1.patch 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # HG changeset patch
  2. # User Jonathan Kew <jkew@mozilla.com>
  3. # Date 1452675061 0
  4. # Wed Jan 13 08:51:01 2016 +0000
  5. # Node ID cf699e95e98829b465b64a7e0281d95ec851ce8c
  6. # Parent 3c9f357598e86c2f593e9895d5725bf3498f8f5a
  7. Bug 1228540 - pt 2 - Remove our HBGetGlyphHOrigin callback, as the default behavior is sufficient.
  8. diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp
  9. --- a/gfx/thebes/gfxHarfBuzzShaper.cpp
  10. +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
  11. @@ -349,27 +349,16 @@ gfxHarfBuzzShaper::HBGetGlyphVAdvance(hb
  12. static_cast<const gfxHarfBuzzShaper::FontCallbackData*>(font_data);
  13. // Currently, we don't offer gfxFont subclasses a method to override this
  14. // and provide hinted platform-specific vertical advances (analogous to the
  15. // GetGlyphWidth method for horizontal advances). If that proves necessary,
  16. // we'll add a new gfxFont method and call it from here.
  17. return fcd->mShaper->GetGlyphVAdvance(glyph);
  18. }
  19. -/* static */
  20. -hb_bool_t
  21. -gfxHarfBuzzShaper::HBGetGlyphHOrigin(hb_font_t *font, void *font_data,
  22. - hb_codepoint_t glyph,
  23. - hb_position_t *x, hb_position_t *y,
  24. - void *user_data)
  25. -{
  26. - // We work in horizontal coordinates, so no origin adjustment needed here.
  27. - return true;
  28. -}
  29. -
  30. struct VORG {
  31. AutoSwap_PRUint16 majorVersion;
  32. AutoSwap_PRUint16 minorVersion;
  33. AutoSwap_PRInt16 defaultVertOriginY;
  34. AutoSwap_PRUint16 numVertOriginYMetrics;
  35. };
  36. struct VORGrec {
  37. @@ -1262,19 +1251,16 @@ gfxHarfBuzzShaper::Initialize()
  38. hb_font_funcs_set_glyph_func(sHBFontFuncs, HBGetGlyph,
  39. nullptr, nullptr);
  40. hb_font_funcs_set_glyph_h_advance_func(sHBFontFuncs,
  41. HBGetGlyphHAdvance,
  42. nullptr, nullptr);
  43. hb_font_funcs_set_glyph_v_advance_func(sHBFontFuncs,
  44. HBGetGlyphVAdvance,
  45. nullptr, nullptr);
  46. - hb_font_funcs_set_glyph_h_origin_func(sHBFontFuncs,
  47. - HBGetGlyphHOrigin,
  48. - nullptr, nullptr);
  49. hb_font_funcs_set_glyph_v_origin_func(sHBFontFuncs,
  50. HBGetGlyphVOrigin,
  51. nullptr, nullptr);
  52. hb_font_funcs_set_glyph_extents_func(sHBFontFuncs,
  53. HBGetGlyphExtents,
  54. nullptr, nullptr);
  55. hb_font_funcs_set_glyph_contour_point_func(sHBFontFuncs,
  56. HBGetContourPoint,
  57. diff --git a/gfx/thebes/gfxHarfBuzzShaper.h b/gfx/thebes/gfxHarfBuzzShaper.h
  58. --- a/gfx/thebes/gfxHarfBuzzShaper.h
  59. +++ b/gfx/thebes/gfxHarfBuzzShaper.h
  60. @@ -56,21 +56,16 @@ public:
  61. hb_codepoint_t glyph, void *user_data);
  62. // get harfbuzz vertical advance in 16.16 fixed point format.
  63. static hb_position_t
  64. HBGetGlyphVAdvance(hb_font_t *font, void *font_data,
  65. hb_codepoint_t glyph, void *user_data);
  66. static hb_bool_t
  67. - HBGetGlyphHOrigin(hb_font_t *font, void *font_data,
  68. - hb_codepoint_t glyph,
  69. - hb_position_t *x, hb_position_t *y,
  70. - void *user_data);
  71. - static hb_bool_t
  72. HBGetGlyphVOrigin(hb_font_t *font, void *font_data,
  73. hb_codepoint_t glyph,
  74. hb_position_t *x, hb_position_t *y,
  75. void *user_data);
  76. hb_position_t GetHKerning(uint16_t aFirstGlyph,
  77. uint16_t aSecondGlyph) const;