Closed Bug 283091 Opened 20 years ago Closed 20 years ago

LockImagePixels doesn't regenerate alpha bits

Categories

(Core Graveyard :: GFX: Mac, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jhpedemonte, Assigned: jhpedemonte)

References

Details

Attachments

(1 file, 1 obsolete file)

The new Quartz code for nsImageMac doesn't regenerate mAlphaBits, and probably regenerates mImageBits incorrectly. This code path isn't normally hit, so it wasn't a problem. Luckily, Tim does make use of this for his SVG code, so he can test this for me. Patch coming up.
Attached patch patch (obsolete) — Splinter Review
This patch makes it so LockImagePixels() properly regenerates mAlphaBits and mImageBits, when necessary. Also cleans up the ImageUpdated() function, which closely mirrors LockImagePixels(). Lastly, decided to get rid of PERF_PREMULT_ALPHA define and make it the norm, since there is no reason to support the non-premultiplied alpha case. Tim says he do some more testing on this patch, but in the meantime, have a gander.
Blocks: 283092
Seems to work in my testing.
Attachment #175082 - Flags: review?(sfraser_bugs)
Comment on attachment 175082 [details] [diff] [review] patch Is this expected to have any impact on browser performance for most pages?
Attachment #175082 - Flags: review?(sfraser_bugs) → review+
Actually, I removed a loop for images with no alpha info when creating the CGImage, so it may actually speed things up a little. The LockImagePixels() function gets called rarely; that's why tor had to test it with his SVG code.
Attachment #175082 - Flags: superreview?(tor)
Comment on attachment 175082 [details] [diff] [review] patch You've got a number of unchecked PR_Malloc()s that should be handled.
Attachment #175082 - Flags: superreview?(tor) → superreview-
Attached patch patch v1.1Splinter Review
Now with malloc checks. Also cleaned up the DrawTile code; no reason to run SlowTile if DrawTile fails.
Attachment #175082 - Attachment is obsolete: true
Attachment #175351 - Flags: superreview?(tor)
Comment on attachment 175351 [details] [diff] [review] patch v1.1 sr=tor if you fix the LockImagePixels leak.
Attachment #175351 - Flags: superreview?(tor) → superreview+
Checked in. ->FIXED
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: