Closed Bug 1116719 Opened 10 years ago Closed 10 years ago

Remove the Image::FrameRect method

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: seth, Assigned: seth)

References

Details

Attachments

(1 file, 1 obsolete file)

It turns out that RasterImage's implementation of FrameRect is the only caller of FrameBlender::RawGetFrame outside of FrameBlender itself. We're going to start storing animated frames in the SurfaceCache, and while it wouldn't be impossible to implement FrameBlender::RawGetFrame with the new design, it will add more complexity than I'd like. FrameRect is actually only called in one place: ProgressTracker::SyncNotify, which is typically called when an imgRequestProxy gets cloned. In that situation, generally the new imgRequestProxy is being used by a new nsImageFrame or other client of imgIContainer which hasn't yet drawn itself for the first time. Therefore, it's not important to get the smallest possible invalidation rect for the current frame - and I'm not even sure it's desirable (though client code shouldn't be so naive that it would matter). In this bug, the code in ProgressTracker::SyncNotify will be changed to always invalidate the entire image. For the vast majority of images, this produces identical results to the old approach, but the calculation is much cheaper. (Since we don't have to look up a frame and so forth.) For images with no intrinsic size, we fall back to nsIntRect::GetMaxSizedIntRect(), which is exactly what VectorImage::FrameRect always returned in any case. (Since some SVG images have an intrinsic size, the new approach is thus "better" in this case, though presumably client code would client the invalidation rect to their bounds anyway.) The rest of the patch will just consist of ripping out all the FrameRect implementations.
Attached patch Remove Image::FrameRect (obsolete) (deleted) — Splinter Review
Here's the patch.
Attachment #8542897 - Flags: review?(tnikkel)
Attachment #8542897 - Attachment is obsolete: true
Attachment #8542897 - Flags: review?(tnikkel)
Attached patch Remove Image::FrameRect (deleted) — Splinter Review
Ack, messed up the patch upload. *Here's* the patch.
Attachment #8542898 - Flags: review?(tnikkel)
Try looks green.
Attachment #8542898 - Flags: review?(tnikkel) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Depends on: 1145496
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: