Closed
Bug 195223
Opened 22 years ago
Closed 12 years ago
Make some GIF Frames non-mutable
Categories
(Core Graveyard :: Image: Painting, defect)
Core Graveyard
Image: Painting
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: paper, Assigned: alfredkayser)
Details
(Keywords: perf)
Attachments
(1 file, 2 obsolete files)
We can now set GIF frames to non-mutable if they are never going to be accessed
again by the current implementations of BlackenFrame, SetMaskInvisibility,
CopyImageFrame, and nsImage::DrawToImage (or gfxImageFrame::DrawTo)
That leaves not very many cases where the frame can be set to non-mutable, but
enough to warrant a little patch, since when the circumstances do occur, CPU
usage seems to drop by at least 1/2.
This appears to be the cause of slow animated GIFs on some (particularly some
nVidia) video cards.
Once the above mentioned imgContainerGIF functions are moved to nsIImage, all
frames can be set non-mutable (although there should be some limit, like only
the first 15 frames, so that we don't run out of resources). That's not this
bug. I'll file a new bug for that.
Comment 1•22 years ago
|
||
This one from http://bugzilla.mozilla.org/show_bug.cgi?id=195044#c9 rocks! 0%
CPU usage. Athlon 1.8, WinXP, GeForce4
Great work Arron!
Reporter | ||
Comment 2•22 years ago
|
||
If we never need the frame's bits, then we can SetMutable(PR_FALSE), which
optimizes the frame and makes it go vroom vroom on nVidia cards. :)
Eventually I'll be able to set all the frames as non-mutable, but that won't
happen for a long while.
Reporter | ||
Updated•22 years ago
|
Attachment #116350 -
Flags: review?(cbiesinger)
Reporter | ||
Comment 5•22 years ago
|
||
Comment on attachment 116350 [details] [diff] [review]
Set some GIF frames as NonMutable
Found a nasty crasher with this code. Marking Obselete and removing review
request.
Attachment #116350 -
Attachment is obsolete: true
Attachment #116350 -
Flags: review?(cbiesinger)
Assignee | ||
Comment 6•20 years ago
|
||
This patch does the following:
* Helper function to only optimize if not allready optimized
* For each added frame,
+ check if the this frame is full, and its disposal is clear then current may
be optimized
+ check if this frame does not need previous to be restored, and is not
transparent, than previous may be optimized.
* When a frame is composited and is not needed, instead of copy whole frame
into 'nextFrame' replace the object nextFrame with it in the array, and
optimize the prevFrame (because displosal is CLEAR_ALL)
This patch is tested and works with all of the tests of:
http://mozilla.animecity.nu/IMGTest
http://jogi.austin.ibm.com/animatedgif.html
QA Contact: tpreston → image.gfx
Comment 7•17 years ago
|
||
Alfred in comment #6)
> Created an attachment (id=173357) [details]
> Updated version, doing more with less code, and tested with current build
Alfred is the patch suitable to ask for approvals and checkin?
> This patch is tested and works with all of the tests of:
> http://mozilla.animecity.nu/IMGTest
> http://jogi.austin.ibm.com/animatedgif.html
these URLs are dead
Assignee | ||
Comment 8•17 years ago
|
||
I need first to check to if this patch is still valid, and there are currently other patches pending for this code...
Assignee | ||
Comment 9•17 years ago
|
||
Taking this bug, but the large part of it is not relevant anymore.
So, this needs to be checked first...
Assignee: paper → alfredkayser
Assignee | ||
Comment 10•12 years ago
|
||
This is no longer relevant, as image data is treated in completely different way now.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•