Savings fom extra data/computations related to GetBoundingMetrics

RESOLVED FIXED in mozilla0.9

Status

()

Core
MathML
RESOLVED FIXED
18 years ago
17 years ago

People

(Reporter: rbs, Assigned: rbs)

Tracking

({memory-footprint, perf})

Trunk
mozilla0.9
memory-footprint, perf
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

18 years ago
The nsBoundingMetrics struct, defined in nsIRenderingContext.h, includes
the following members: 

  nscoord supItalicCorrection, subItalicCorrection, leftItalicCorrection;

They were not computed correctly (see below), and the XP code in layout/mathml
is not making any use of them. Instead, some simple estimations are proving 
quite satsifactory at the XP level. As a result, these members have become
useless and can be removed for performance and footprint reasons.

            // get italic correction
This is returning the angle, not the final value. Even that angle is
incorrect on X-based systems.
2066        XFontStruct *fontInfo = (XFontStruct *) GDK_FONT_XFONT (mFont);
2067        unsigned long pr = 0;
2068        if (::XGetFontProperty(fontInfo, XA_ITALIC_ANGLE, &pr)) {
2069           aBoundingMetrics.subItalicCorrection = (gint) pr; 
2070           aBoundingMetrics.supItalicCorrection = (gint) pr;
2071        }

gfx/src/xprint/nsFontMetricsXP.{h,cpp}
gfx/src/xprint/nsFontMetricsGTK.{h,cpp}

GetItalicSlope() is also not necessary anymore
gfx/src/xprint/nsFontMetricsWin.{h,cpp}
(Assignee)

Updated

18 years ago
Keywords: footprint, perf
(Assignee)

Comment 1

17 years ago
Created attachment 28202 [details] [diff] [review]
Proposed patch for the cleanup
(Assignee)

Comment 2

17 years ago
Guys, want to give me a quick r/sr on this - should be a no-brainer.
Target Milestone: --- → mozilla0.9
(Assignee)

Comment 3

17 years ago
Created attachment 28203 [details] [diff] [review]
patch which includes xprint too

Comment 4

17 years ago
sr=erik for 2nd patch
(Assignee)

Comment 6

17 years ago
Thanks guys. Checked-in.
Resolving as FIXED.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.