Closed Bug 1097405 Opened 7 years ago Closed 7 years ago

Clean up imgStatusTracker's Difference APIs

Categories

(Core :: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: seth, Assigned: seth)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Right now code that wants to use imgStatusTracker to send notifications has to correctly call imgStatusTracker::Difference (in some cases at least), imgStatusTracker::ApplyDifference, and finally imgStatusTracker::SyncNotifyDifference. We should simplify this API. All that's really required is:

- Difference. Only RasterImage::FinishedSomeDecoding needs this, to support the loop that lets us avoid recursive notifications. It should never produce incorrect results to *not* all Difference before SyncNotifyDifference, as it can now.

- SyncNotifyDifference. Internally, this method should call both Difference and ApplyDifference (or really, just inline ApplyDifference, since it's trivial now).

Since we never need to call ApplyDifference independently from SyncNotifyDifference, we'll remove that method from the API totally.

Making this change will let us send notifications in two or three lines of simple, easy-to-understand code. Later refactorings will get this down to one line.
Here's the patch.
Attachment #8521076 - Flags: review?(tnikkel)
Attachment #8521076 - Flags: review?(tnikkel) → review+
https://hg.mozilla.org/mozilla-central/rev/9a3e7bca8051
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Depends on: 1133356
No longer depends on: 1133356
You need to log in before you can comment on or make changes to this bug.