Simplify nsTransform2D

VERIFIED FIXED in mozilla1.9beta4

Status

defect
VERIFIED FIXED
12 years ago
10 years ago

People

(Reporter: alfredkayser, Assigned: alfredkayser)

Tracking

Trunk
mozilla1.9beta4
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

12 years ago
Remove 'type' from nsTransform2D, and remove all 'if'/'switch' branching.
This reduces size of nsTransform2D: datasize 16 bytes instead of 20. (although type is short, the class is 4byte padded). codesize: as many functions are now much simplier, and can be inlined in lot of cases.
Attachment #294786 - Flags: review?(vladimir)
(Assignee)

Updated

12 years ago
Assignee: nobody → alfredkayser
(Assignee)

Comment 1

11 years ago
Keep the body of the methods in the .cpp file, and remove the unused methods.
This version saves about 5K objectsize (on Windows).
Attachment #294786 - Attachment is obsolete: true
Attachment #304824 - Flags: review?
Attachment #294786 - Flags: review?(vladimir)
(Assignee)

Updated

11 years ago
Attachment #304824 - Flags: review? → review?(vladimir)
(Assignee)

Updated

11 years ago
Attachment #304824 - Flags: review?(vladimir) → review?(roc)
(Assignee)

Comment 2

11 years ago
This is a kind of a followup from bug 291636 and bug 290885 where similar cleanups where done.
ScaleXCoords and ScaleYCoords are not used (gfx/src/windows and gfx/src/mac are not built).

SetToIdentity is not used (the code in nsBulletFrame is #if 0'ed out and should just be removed). Ditto SetToScale.

gfx/src/photon isn't built, so GetX/YTranslation(Coord) can be removed (no point in keeping them just for debug printf in SVG).

I haven't checked all the others ... basically just take a closer look at the users, most of them aren't real.
(Assignee)

Comment 4

11 years ago
Created bug 419000 to remove the old debug code from SVG.
Attachment #304824 - Attachment is obsolete: true
Attachment #304942 - Flags: review?(roc)
Attachment #304824 - Flags: review?(roc)
(Assignee)

Comment 5

11 years ago
Created bug 419004 to remove /gfx/src/beos.
Bug 384057 is for the removal of /gfx/src/photon.
Bug 418104 is for the removal of /gfx/src/windows
Depends on: 384057, 418104, 419000
(Assignee)

Updated

11 years ago
Depends on: 419004
Version: unspecified → Trunk
(Assignee)

Updated

11 years ago
Attachment #304942 - Flags: approval1.9?
Comment on attachment 304942 [details] [diff] [review]
V3: Much more cleanup, including removal of "#if 0" from nsBulletFrame

a1.9+=damons
Attachment #304942 - Flags: approval1.9? → approval1.9+
(Assignee)

Updated

11 years ago
Keywords: checkin-needed
Checking in gfx/public/nsTransform2D.h;
/cvsroot/mozilla/gfx/public/nsTransform2D.h,v  <--  nsTransform2D.h
new revision: 1.12; previous revision: 1.11
done
Checking in gfx/src/nsTransform2D.cpp;
/cvsroot/mozilla/gfx/src/nsTransform2D.cpp,v  <--  nsTransform2D.cpp
new revision: 3.19; previous revision: 3.18
done
Checking in layout/generic/nsBulletFrame.cpp;
/cvsroot/mozilla/layout/generic/nsBulletFrame.cpp,v  <--  nsBulletFrame.cpp
new revision: 1.169; previous revision: 1.168
done
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta4
(Assignee)

Comment 8

11 years ago
Thanks.

1200 code bytes saved:
 libxul.so
  	Total:	      -1200 (+52/-1252)
  	Code:	      -1195 (+0/+0)
  	Data:	         -5 (+52/-1252)
Status: RESOLVED → VERIFIED
(Assignee)

Updated

11 years ago
Blocks: 376791
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.