Closed Bug 1185592 Opened 5 years ago Closed 5 years ago

Store RasterImage's decoder type as an enum value instead of recomputing it from the MIME type string every time

Categories

(Core :: ImageLib, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: seth, Assigned: seth)

References

Details

Attachments

(2 files)

Right now every time RasterImage::CreateDecoder() runs, it recomputes the decoder type to use from the MIME type. The MIME type never changes, though, and we don't actually need it for any other purpose. Let's just compute the decoder type once and store it as a member variable on RasterImage.
Before the main patch, we need to remove some obsolete logging macros which
reference mSourceDataMimeType. Two of these macros are not used at all, and the
third is only used one time. I've inlined the macro that's actually used
(removing the reference to mSourceDataMimeType) and deleted the macro
definitions.
Attachment #8636124 - Flags: review?(amarchesini)
This patch replaces mSourceDataMimeType with an mDecoderType member variable. We
compute mDecoderType's value once in RasterImage::Init() and then just use it in
RasterImage::CreateDecoder().
Attachment #8636126 - Flags: review?(amarchesini)
Attachment #8636124 - Flags: review?(amarchesini) → review+
Attachment #8636126 - Flags: review?(amarchesini) → review+
Thanks for the review!
You need to log in before you can comment on or make changes to this bug.