Revert of Merge HarfBuzz kerning support from Blink (https://codereview.chromium.org/290993011/)

Reason for revert:
It broke this build:
http://build.chromium.org/p/chromium.chromiumos/builders/ChromiumOS%20%28amd64%29/builds/16352/steps/cbuildbot/logs/stdio

Sorry for the trouble.

Original issue's description:
> Merge HarfBuzz kerning support from Blink
> 
> Original CL: https://codereview.chromium.org/69513002
> 
> BUG=321868
> R=msw@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273181

TBR=msw@chromium.org,ckocagil@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=321868

Review URL: https://codereview.chromium.org/299313009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273189 0039d316-1c4b-4281-b951-d872f2087c98
parent 0d95a4b6
...@@ -127,50 +127,6 @@ hb_bool_t GetGlyphHorizontalOrigin(hb_font_t* font, ...@@ -127,50 +127,6 @@ hb_bool_t GetGlyphHorizontalOrigin(hb_font_t* font,
return true; return true;
} }
hb_position_t GetGlyphKerning(FontData* font_data,
hb_codepoint_t first_glyph,
hb_codepoint_t second_glyph) {
SkTypeface* typeface = font_data->paint_.getTypeface();
const uint16_t glyphs[2] = { first_glyph, second_glyph };
int32_t kerning_adjustments[1] = { 0 };
if (!typeface->getKerningPairAdjustments(glyphs, 2, kerning_adjustments))
return 0;
SkScalar upm = SkIntToScalar(typeface->getUnitsPerEm());
SkScalar size = font_data->paint_.getTextSize();
return SkiaScalarToHarfBuzzPosition(
SkScalarMulDiv(SkIntToScalar(kerning_adjustments[0]), size, upm));
}
hb_position_t GetGlyphHorizontalKerning(hb_font_t* font,
void* data,
hb_codepoint_t left_glyph,
hb_codepoint_t right_glyph,
void* user_data) {
FontData* font_data = reinterpret_cast<FontData*>(data);
if (font_data->paint_.isVerticalText()) {
// We don't support cross-stream kerning.
return 0;
}
return GetGlyphKerning(font_data, left_glyph, right_glyph);
}
hb_position_t GetGlyphVerticalKerning(hb_font_t* font,
void* data,
hb_codepoint_t top_glyph,
hb_codepoint_t bottom_glyph,
void* user_data) {
FontData* font_data = reinterpret_cast<FontData*>(data);
if (!font_data->paint_.isVerticalText()) {
// We don't support cross-stream kerning.
return 0;
}
return GetGlyphKerning(font_data, top_glyph, bottom_glyph);
}
// Writes the |extents| of |glyph|. // Writes the |extents| of |glyph|.
hb_bool_t GetGlyphExtents(hb_font_t* font, hb_bool_t GetGlyphExtents(hb_font_t* font,
void* data, void* data,
...@@ -189,6 +145,7 @@ hb_font_funcs_t* GetFontFuncs() { ...@@ -189,6 +145,7 @@ hb_font_funcs_t* GetFontFuncs() {
// We don't set callback functions which we can't support. // We don't set callback functions which we can't support.
// HarfBuzz will use the fallback implementation if they aren't set. // HarfBuzz will use the fallback implementation if they aren't set.
// TODO(ckocagil): Merge Blink's kerning funcs.
if (!font_funcs) { if (!font_funcs) {
// The object created by |hb_font_funcs_create()| below lives indefinitely // The object created by |hb_font_funcs_create()| below lives indefinitely
// and is intentionally leaked. // and is intentionally leaked.
...@@ -196,12 +153,8 @@ hb_font_funcs_t* GetFontFuncs() { ...@@ -196,12 +153,8 @@ hb_font_funcs_t* GetFontFuncs() {
hb_font_funcs_set_glyph_func(font_funcs, GetGlyph, 0, 0); hb_font_funcs_set_glyph_func(font_funcs, GetGlyph, 0, 0);
hb_font_funcs_set_glyph_h_advance_func( hb_font_funcs_set_glyph_h_advance_func(
font_funcs, GetGlyphHorizontalAdvance, 0, 0); font_funcs, GetGlyphHorizontalAdvance, 0, 0);
hb_font_funcs_set_glyph_h_kerning_func(
font_funcs, GetGlyphHorizontalKerning, 0, 0);
hb_font_funcs_set_glyph_h_origin_func( hb_font_funcs_set_glyph_h_origin_func(
font_funcs, GetGlyphHorizontalOrigin, 0, 0); font_funcs, GetGlyphHorizontalOrigin, 0, 0);
hb_font_funcs_set_glyph_v_kerning_func(
font_funcs, GetGlyphVerticalKerning, 0, 0);
hb_font_funcs_set_glyph_extents_func( hb_font_funcs_set_glyph_extents_func(
font_funcs, GetGlyphExtents, 0, 0); font_funcs, GetGlyphExtents, 0, 0);
hb_font_funcs_make_immutable(font_funcs); hb_font_funcs_make_immutable(font_funcs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment