cleanup of nsIImage: Removal of several (virtual) members

RESOLVED FIXED

Status

Core Graveyard
Image: Painting
RESOLVED FIXED
11 years ago
9 years ago

People

(Reporter: Alfred Kayser, Assigned: Alfred Kayser)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

11 years ago
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
(Assignee)

Comment 1

11 years ago
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
(Assignee)

Comment 2

11 years ago
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).
(Assignee)

Updated

11 years ago
Summary: Removal of GetIsRowOrderTopToBottom(); → nsIImage: Removal of GetIsRowOrderTopToBottom();
(Assignee)

Updated

11 years ago
Depends on: 376791
(Assignee)

Updated

11 years ago
Summary: nsIImage: Removal of GetIsRowOrderTopToBottom(); → cleanup of nsIImage: Removal of GetIsRowOrderTopToBottom() and others
(Assignee)

Updated

11 years ago
No longer depends on: 376791
(Assignee)

Updated

11 years ago
Depends on: 367281
(Assignee)

Comment 3

10 years ago
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
(Assignee)

Updated

10 years ago
Blocks: 430829
(Assignee)

Comment 4

9 years ago
Created attachment 370624 [details] [diff] [review]
V1: Cleanup of nsIImage.h and nsThebesImage

Simple code cleanup.
Attachment #370624 - Flags: review?(vladimir)
(Assignee)

Comment 5

9 years ago
Fixed by bug 753!
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

9 years ago
Component: Image: Painting → Image: Painting
Product: Core → Core Graveyard
(Assignee)

Updated

9 years ago
Attachment #370624 - Flags: review?(vladimir)
You need to log in before you can comment on or make changes to this bug.