Bug 88806 - [Chromium-Android] Remove Android-specific code in FontPlatformDataHarfBuzz.cpp
Summary: [Chromium-Android] Remove Android-specific code in FontPlatformDataHarfBuzz.cpp
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 66687
  Show dependency treegraph
 
Reported: 2012-06-11 14:14 PDT by Xianzhu Wang
Modified: 2012-06-11 16:18 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xianzhu Wang 2012-06-11 14:14:53 PDT
In FontPlatformDataHarfBuzz.cpp, FontPlatformData::emSizeInFontUnits(), the Android-specific code was added when skia's Android port didn't support Typeface::getAdvancedTypefaceMetrics().

Skia added Android support of the method in http://codereview.appspot.com/5396045, so the Android-specific code can be removed.
Comment 1 Peter Beverloo 2012-06-11 15:14:42 PDT
Since getAdvancedTypefaceMetrics() is only called to get the em size in font units (the caller disregards all other returned information), I don't think this would be the right approach. See the following bugs for more context (also referred to by a TODO in the code):

Bug 75702 ([Chromium] Use SkFontHost::GetUnitsPerEm instead of advanced type metrics for Android in FontPlatformData)
Bug 75961 ([Chromium] Switch to using the new SkTypeface::GetUnitsPerEm API)

http://code.google.com/p/skia/issues/detail?id=441 (Add SkTypeface::GetUnitsPerEm())

+reed
Comment 2 Xianzhu Wang 2012-06-11 16:07:15 PDT
(In reply to comment #1)
> Since getAdvancedTypefaceMetrics() is only called to get the em size in font units (the caller disregards all other returned information), I don't think this would be the right approach. See the following bugs for more context (also referred to by a TODO in the code):
> 
> Bug 75702 ([Chromium] Use SkFontHost::GetUnitsPerEm instead of advanced type metrics for Android in FontPlatformData)
> Bug 75961 ([Chromium] Switch to using the new SkTypeface::GetUnitsPerEm API)
> 
> http://code.google.com/p/skia/issues/detail?id=441 (Add SkTypeface::GetUnitsPerEm())
> 
> +reed

Yes, I saw those bugs, but this one just removes the Android-specific code with the bugs (to switch to SkTypeface::GetUnitsPerEm()) still open. That is, it combines two different 'incorrect' ways into one :)

Found this by the way when cleaning up Android-specific code in the file in downstream. I'm OK to delay this until we fix 75961.
Comment 3 Peter Beverloo 2012-06-11 16:09:44 PDT
Are you proposing to switch Android back to getAdvancedTypefaceMetrics(), and thus removing the compile-time branch, until emSizeInFontUnits() is available for all platforms?
Comment 4 Xianzhu Wang 2012-06-11 16:18:23 PDT
(In reply to comment #3)
> Are you proposing to switch Android back to getAdvancedTypefaceMetrics(), and thus removing the compile-time branch, until emSizeInFontUnits() is available for all platforms?

Yes. But now I think this is unnecessary as there's no diff about this in downstream/upstream. Closing this bug.