Bug 97245 - Reduce redundant code in SimpleFontData[platform]
Summary: Reduce redundant code in SimpleFontData[platform]
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Stephen Chenney
URL:
Keywords:
Depends on: 95866
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-20 12:02 PDT by Stephen Chenney
Modified: 2012-11-02 15:30 PDT (History)
7 users (show)

See Also:


Attachments
Patch (16.75 KB, patch)
2012-11-02 08:58 PDT, Stephen Chenney
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Chenney 2012-09-20 12:02:10 PDT
There is a platform specific file for, e.g. SimpleFontData.h, but almost all of them have identical code. We can simplify this to reduce code duplication and the chance for errors. It will also make it much clearer exactly how platforms differ in font handling.
Comment 1 Eric Seidel (no email) 2012-09-20 13:23:25 PDT
Yay!
Comment 2 Stephen Chenney 2012-11-02 07:57:14 PDT
SimpleFontData::smallCapsFontData:
All platforms identical code with different ways of defining the constant for "small" and an extra comment for FreeType. All the constahnts are 0.7, but defined in different ways. There is absolutely no need for platform specific code here.

SimpleFontData::emphasisMarkFontData:
All platforms identical except for the way in which they define 0.5 for the constant.

SimpleFontData::boundsForGlyph
SimpleFontData::widthForGlyph
Already a common core with platform[] code.

SimpleFontData::determinePitch
Genuinely different methods

SimpleFontData::createScaledFontData
Genuinely different methods
Comment 3 Stephen Chenney 2012-11-02 08:58:14 PDT
Created attachment 172073 [details]
Patch

Easier than I thought.
Comment 4 Eric Seidel (no email) 2012-11-02 09:03:35 PDT
Comment on attachment 172073 [details]
Patch

LGTM.
Comment 5 Stephen Chenney 2012-11-02 15:30:39 PDT
Committed r133362: <http://trac.webkit.org/changeset/133362>