Closed Bug 393001 Opened 17 years ago Closed 15 years ago

cleanup of nsIImage: Removal of several (virtual) members

Categories

(Core Graveyard :: Image: Painting, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alfredkayser, Assigned: alfredkayser)

References

()

Details

Attachments

(1 file)

GetIsRowOrderTopToBottom() now always returns PR_TRUE, so we can remove this, and the callers can now always assume TopToBottom (as long as we use Cairo).

This simplifies in gfxImageFrame some code, as we have TopToBottom always true, and removes some API clutter from nsIImage
Note, also 'GetColorMap' is redundant.
Thebes/Cairo does:
273 nsThebesImage::GetColorMap()
274 {
275     return NULL;
276 }
And there are no callers for GetColorMap():
see http://lxr.mozilla.org/mozilla/search?string=GetColormap
Status: NEW → ASSIGNED
Also GetBytesPix() is redundant. One should now use sizeof(gfx_color), as defined in gfx/idl/gfxtypes.idl, line 53 (or just sizeof(PRUint32)).

Also GetBitInfo() is nowhere used, and not implemented as well.
Also GetAlphaDepth() is nowhere used.

Note, GetHasAlphaMask returns wrong result when SetHasNoAlpha() was used to change imageformat from ARGB32 to RGB24. It should not test for mAlphaDepth, but for the format ARGb32.

And of course GetAlphaBits and GetAlphaLineStride are no longer valid.
(Only user is gfxImageFrame in SetData which doesn't work anymore for alpha data) (this depends on bug 367281, so possibly do the cleanup in two steps).
Summary: Removal of GetIsRowOrderTopToBottom(); → nsIImage: Removal of GetIsRowOrderTopToBottom();
Depends on: 376791
Summary: nsIImage: Removal of GetIsRowOrderTopToBottom(); → cleanup of nsIImage: Removal of GetIsRowOrderTopToBottom() and others
No longer depends on: 376791
Depends on: 367281
With the completion of the switch to Cairo and the completion of the removal of platform specific code, GetIsRowOrderTopToBottom can now be removed completely (and possibly more of nsIImage.h). And most of the members of nsIImage don't need to be virtual anymore?

http://mxr.mozilla.org/mozilla-central/search?string=RowOrderTopToBottom&find=&RowOrderTopToBottom

Found 3 matching lines in 3 files:
/gfx/public/nsIImage.h (View change log or blame annotations)
    * line 108 -- virtual PRBool GetIsRowOrderTopToBottom() = 0;
/gfx/src/thebes/nsThebesImage.cpp (View change log or blame annotations)
    * line 162 -- nsThebesImage::GetIsRowOrderTopToBottom()
/gfx/src/thebes/nsThebesImage.h (View change log or blame annotations)
    * line 65 -- virtual PRBool GetIsRowOrderTopToBottom();

Others are:
GetColorMap (not used)
GetBytesPix (is used in one location, but for Cairo it is always 4 (sizeof(nscolor)).
GetBitInfo (not used)
GetAlphaDepth (not used)
GetHasAlphaMask (not used)
GetAlphaLineStride (not used)
GetAlphaBits (not used)
Summary: cleanup of nsIImage: Removal of GetIsRowOrderTopToBottom() and others → cleanup of nsIImage: Removal of several (virtual) members
Blocks: 430829
Simple code cleanup.
Attachment #370624 - Flags: review?(vladimir)
Fixed by bug 753!
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
Attachment #370624 - Flags: review?(vladimir)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: