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?
Created attachment 16250 [details] 0001 - Made setFont() easier
Created attachment 16251 [details] 0002 - Removed m_fontFace
Created attachment 16252 [details] 0003 - Removed m_fontMatrix
Created attachment 16253 [details] 0004 - Removed m_options This is the last patch for now…
This is the diffstat output: FontDataGdk.cpp | 6 ------ FontPlatformData.h | 11 +---------- FontPlatformDataGdk.cpp | 17 ++++++++--------- 3 files changed, 9 insertions(+), 25 deletions(-)
Created attachment 16254 [details] Final Patch (all in one) Final patch (included the 4 previous ones plus a changelog entry)
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.
Landed in r25489.