Closed Bug 66461 Opened 24 years ago Closed 23 years ago

[libimg]stretched transparent GIFs should not eat CPU time

Categories

(Core :: Graphics: ImageLib, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.0

People

(Reporter: jesup, Assigned: tor)

References

Details

(Keywords: perf, Whiteboard: [imglib])

Attachments

(4 files)

From the footprint meeting:

Transparent GIFs (especially 1x1's) stretched into different sizes should be
optimized away - we shouldn't store a (say) 400x200 bitmap of 0's, then spend
lots of time rendering, compositing, the transparent GIF.  At least we should
save the memory, but avoiding rendering would be a significant performance win
as well.
Keywords: perf
Keywords: footprint
I'll take this, cc'ing pavlov too
Assignee: pnunn → saari
Blocks: 66959
Blocks: 66964
Fixing in libpr0n
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
Summary: stretched transparent GIFs should not eat memory/CPU time → [libimg]stretched transparent GIFs should not eat memory/CPU time
*** Bug 64631 has been marked as a duplicate of this bug. ***
Okay, in libpr0n we strech images at render time, we don't cache each 
scaled copy, so I'm going to close this. We could still optimize away 1x1 
transparent spacer GIFs entirely, but there isn't a big savings there. Feel 
free to open this bug again for that issue (but it won't be mozilla 0.9 
targeted)
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Ok, thanks for getting this.  Reopening for the performance item involved -
avoiding stretching and renderering 1x1 transparent gifs would be a noticable
win (scaling is not cheap).

Removing target milestone, changing subject to CPU only, removing footprint.
Status: RESOLVED → REOPENED
Keywords: footprint
Resolution: FIXED → ---
Summary: [libimg]stretched transparent GIFs should not eat memory/CPU time → [libimg]stretched transparent GIFs should not eat CPU time
Target Milestone: mozilla0.9 → ---
Okay, targeting 9.1 for totally optimizing away transparent spacers.
Status: REOPENED → ASSIGNED
Target Milestone: --- → mozilla0.9.1
changing status to [imglib]
Whiteboard: [imglib]
targeting 1.0
Target Milestone: mozilla0.9.1 → mozilla1.0
Very cool!  I looked over the patch; it seems quite reasonable.  This appears to
avoid drawing a transparent spacer of any size; does it avoid scaling it as
well, or has that already been handled?
Scaling happens on the fly in the nsImageGTK::Draw* methods, and this patch
causes all of those to bail before doing any work on a spacer.
I tried out the patch - it seems to work well.  The number of "alpha bitmap not
scaled" warnings is WAY down.  Everything renders fine (not surprising since we
only eliminate bitmaps with all alpha of 0).  This should be a nice little boost
in performance on complex pages.
Keywords: patch
Lots of these:

+  if ((mAlphaDepth==1) && mIsSpacer) {
+    return NS_OK;
+  }

Kill the braces around one-liners, and r=dr.
Taking bug.
Assignee: saari → tor
Status: ASSIGNED → NEW
r=dr
sr=blizzard if you comment some of the bit masking
Attached patch same + commentsSplinter Review
a= asa@mozilla.org for checkin to the trunk.
(on behalf of drivers)
Blocks: 83989
Checked in on trunk.
Status: NEW → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: