Bug 15177 - [gtk] FontPlatformData contains more fields than required
Summary: [gtk] FontPlatformData contains more fields than required
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-11 07:32 PDT by Sven Herzberg
Modified: 2007-09-11 08:11 PDT (History)
1 user (show)

See Also:


Attachments
0001 - Made setFont() easier (1.19 KB, patch)
2007-09-11 07:34 PDT, Sven Herzberg
no flags Details | Formatted Diff | Diff
0002 - Removed m_fontFace (3.31 KB, patch)
2007-09-11 07:35 PDT, Sven Herzberg
no flags Details | Formatted Diff | Diff
0003 - Removed m_fontMatrix (3.67 KB, patch)
2007-09-11 07:36 PDT, Sven Herzberg
no flags Details | Formatted Diff | Diff
0004 - Removed m_options (3.14 KB, patch)
2007-09-11 07:36 PDT, Sven Herzberg
no flags Details | Formatted Diff | Diff
Final Patch (all in one) (4.52 KB, patch)
2007-09-11 07:58 PDT, Sven Herzberg
mrowe: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Herzberg 2007-09-11 07:32:38 PDT
FontPlatformData::setFont(cairo_t*) can be changed to use m_scaledFont directly. This makes the function easier readable and still works exactly as expected.

m_fontFace, m_fontMatrix, and m_options are used in the main constructor in FontPlatformDataGdk.cpp only then. So they should be turned into local variables instead of extra fields.

The attached patch-set reduces the memory footprint of each FontPlatformData by 3*sizeof(void*).

The only issue that's left is that the former fields are not renamed according the the code conventions in my patches, do you want another patch for that?
Comment 1 Sven Herzberg 2007-09-11 07:34:55 PDT
Created attachment 16250 [details]
0001 - Made setFont() easier
Comment 2 Sven Herzberg 2007-09-11 07:35:28 PDT
Created attachment 16251 [details]
0002 - Removed m_fontFace
Comment 3 Sven Herzberg 2007-09-11 07:36:09 PDT
Created attachment 16252 [details]
0003 - Removed m_fontMatrix
Comment 4 Sven Herzberg 2007-09-11 07:36:49 PDT
Created attachment 16253 [details]
0004 - Removed m_options

This is the last patch for now…
Comment 5 Sven Herzberg 2007-09-11 07:37:57 PDT
This is the diffstat output:
 FontDataGdk.cpp         |    6 ------
 FontPlatformData.h      |   11 +----------
 FontPlatformDataGdk.cpp |   17 ++++++++---------
 3 files changed, 9 insertions(+), 25 deletions(-)
Comment 6 Sven Herzberg 2007-09-11 07:58:50 PDT
Created attachment 16254 [details]
Final Patch (all in one)

Final patch (included the 4 previous ones plus a changelog entry)
Comment 7 Mark Rowe (bdash) 2007-09-11 08:03:10 PDT
Comment on attachment 16254 [details]
Final Patch (all in one)

Some minor comments:
The local variables inside FontPlatformData::FontPlatformData should lose the m_ prefix, which is used only for members.  I think the declarations can be moved to their point of first use too.
Our coding style also requires no space between the function name and it's arguments.

I'll make those minor tweaks when I land this.
Comment 8 Mark Rowe (bdash) 2007-09-11 08:11:06 PDT
Landed in r25489.