Open Bug 1298142 Opened 8 years ago Updated 2 years ago

Make all image decoders anonymous

Categories

(Core :: Graphics: ImageLib, defect)

defect

Tracking

()

People

(Reporter: seth, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

In ImageLib, the status quo has been that decoders were associated with a RasterImage object. Each decoder gets a RasterImage passed to its constructor, which was used to send notifications back to the RasterImage and to insert things into the surface cache with the appropriate ImageKey. Recently, though, IDecodingTasks have been added as a kind of "glue layer" between RasterImage objects and decoders, and they're responsible for handling notifications. Similarly, ISurfaceProviders are a "glue layer" between decoders and the surface cache, and decoders no longer interact with the surface cache at all. Because of these changes, there's no reason for decoders to continue to hold a reference to their associated RasterImage.

There's precedent for this; we already have the notion of "anonymous decoders", which aren't associated with a RasterImage. Originally they were primarily used for utility functions and for unit testing, but as the IDecodingTask / ISurfaceProvider conversion has progressed, we've gotten to the point where almost all decoders are anonymous decoders.

Let's complete the job - only metadata decoders remain non-anonymous. Once we make that change, we can remove and simplify some code, and importantly we've further reduced the coupling between different subsystems in ImageLib.
Pretty much what it says on the tin.
Attachment #8784961 - Flags: review?(edwin)
OK, this is the big change. We can delete all the code related to
Decoder::mImage, since nothing interacts with it anymore. All of the decoder
subclasses can be updated to stop taking a RasterImage argument to their
constructors. That enables some simplification in DecoderFactory, too.

Overall, 74 fewer lines of code. Nice.
Attachment #8784962 - Flags: review?(edwin)
Blocks: 1298145
Comment on attachment 8784962 [details] [diff] [review]
(Part 2) - Make all decoders anonymous decoders.

Review of attachment 8784962 [details] [diff] [review]:
-----------------------------------------------------------------

Nice indeed.

Sorry for the late reviews; just back from PTO.
Attachment #8784962 - Flags: review?(edwin) → review+

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: seth.bugzilla → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: