Closed Bug 293586 Opened 20 years ago Closed 20 years ago

Navigation icons change their shade of grey after time

Categories

(Core Graveyard :: GFX: Win32, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stevee, Assigned: paper)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050510 Firefox/1.0+ 1. New profile, start firefox 2. Open some tabs: www.google.com www.neowin.net http://www.mozilla.org/products/firefox/central.html www.slashdot.org 3. Focus the www.slashdot.org tab 4. Nip outsite for a cigarette / wait a length of time (~3 mins) 5. Return to firefox, and select all the other tabs. Actual: Notice that any of firefox's greyed out navigation icons have changed colour, from being a light grey to a dark grey Expected: Navigation icons don't change their shade of grey. Picture: http://syskin.is.dreaming.org/b0rk.png I suspect bug 292051 caused this regression.
Keywords: regression
Flags: blocking1.8b2?
OS: Windows 2000 → All
Steve, can you tell me your resolution (specifically color mode.. 32 bit, 16 bit, 256 color, etc)? Also, anyone seeing this on a Seamonkey build? If I don't figure this out in the next day or two, I'll back out 292051 (for b2). By first guess is ConvertDDBtoDIB is somehow converting the DDB back to a DIB as a greyscale image.
I have 32 bit and see this
No the problem is not greyscale, the problem is in alpha channel: after some time, the weightned pixel values suddenly get darker, and the darkness level depends on the alpha value. On the picture, this is especially visible wth the Forecast icons - the suns are nicely anti-aliased, but with this bug they get a black outline. The icons are gray because they are in disabled state, which gives them semi-transparent look. The funny thing is, not all pictures are always affected - for example right now, a Up-Down autoscroller is very dark (it's semi transparent) while Up-Down-Left-Right autoscroller is white as it should be. If I wait some more, it'll become black too. This might be a png-only problem - quite difficuilt to tell since only pngs have such alpha channel. Transparent png files from websites are also affected.
Attached image screenshot
gradual degradation. from the top to bottom is ~30 minutes Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050510 Firefox/1.0+ Matrox G200 / 32-bit color
32bit, 1280x1024 @ 85Hz, nVidia GF4 Ti4400, Forceware 76.41
Thanks, I can reproduce now. Only affects 8 bit alphas (PNGs) ..I hope ;)
I have a fix for this, but I'll sleep on it before attaching the patch. The problem is we pre-multiply the imagebits by the alpha when optimizing (required by GDI). After 60s, we un-optimize and get back the bits (still pre-multiplied). When the image needs drawing again, we re-optimize, pre-multiplying the image again. This ends up in a layer effect of lowering opacity over time. The solution is to not pre-multiply the imagebits if the imagebits are already pre-multiplied.
*** Bug 293665 has been marked as a duplicate of this bug. ***
Testcase: 1) Load any PNG with 8-bit alpha (http://mozilla.animecity.nu/IMGTest/images/Mozilla.png for example) 2) Wait 60s (or 70s just to be sure). Don't touch mouse, move from page, etc 3) Press the Reload button (or find some other way to update the image, like hovering another window over it, or switching tabs) 4) Image will be darker. Repeat steps 2 and 3 and image will continually get darker
Patch that worked last night on a very dirty tree of mine. I'm in the process of compiling a clean tree.
Assignee: win32 → paper
Status: NEW → ASSIGNED
On that patch, did you mean to type mImagePreMultipled or mImagePreMultipl*i*ed?
Attachment #183217 - Flags: superreview?(tor)
Attachment #183217 - Flags: review?(emaijala)
Attachment #183217 - Attachment is obsolete: true
Attachment #183217 - Flags: superreview?(tor)
Attachment #183217 - Flags: review?(emaijala)
Fixed spelling error that Devin noticed. The scary thing is that I had to have mispelled it 4 times when writing the patch, yet I spelled it right on the bug comments
Attachment #183219 - Flags: superreview?(tor)
Attachment #183219 - Flags: review?(emaijala)
Attachment #183219 - Flags: superreview?(tor)
Attachment #183219 - Flags: superreview+
Attachment #183219 - Flags: review?(emaijala)
Attachment #183219 - Flags: review+
Attachment #183219 - Flags: approval1.8b2?
Comment on attachment 183219 [details] [diff] [review] Don't premultiply image with alpha if it's already premultiplied a=shaver to un-regress from a previous approval.
Attachment #183219 - Flags: approval1.8b2? → approval1.8b2+
Checked-in. Thanks for the help, everyone! I'll wait for reports before resolving the bug Checking in gfx/src/windows/nsImageWin.cpp; /cvsroot/mozilla/gfx/src/windows/nsImageWin.cpp,v <-- nsImageWin.cpp new revision: 3.149; previous revision: 3.148 done Checking in gfx/src/windows/nsImageWin.h; /cvsroot/mozilla/gfx/src/windows/nsImageWin.h,v <-- nsImageWin.h new revision: 3.66; previous revision: 3.65 done
No more problems for me, thank you!
Oh, two minutes after I sent that it's back. It might be because I have an older build. Will try again, but in the meantime scratch my confirmation. Sorry for the bugspam.
AronM, is it just me or your code only changes truecolour images with alpha, while 256-colour images are still multiplied just like before?
(In reply to comment #17) > AronM, is it just me or your code only changes truecolour images with alpha, > while 256-colour images are still multiplied just like before? You are right, but the function (CreateImageWithAlphaBits) only gets called on images with 8 bit alphas, and we never never create an 8 bit alpha image with a palette (256 colors). That function really needs a cleanup (on my list of TODOs sometime)
fixed for me with latest beast build
Can anyone else confirm that this is fixed?
Yup... it's fixed since yesterday's builds. Closing.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
(In reply to comment #21) > Yup... it's fixed since yesterday's builds. Closing. doesn't comment #18 imply this bug isn't completely fixed yet ?
It simply mentions a later function cleanup from what I can tell. The problem this bug was opened for though is indeed fixed in the nightlies. Did the patch author intend to keep this bug open until some unspecified later date that he can cleanup the code?
Thanks again everyone. I was only leaving the bug open until I had a few more verifies (which it now does!). Comment #18 is indeed a cleanup bug not related to this bug.
Flags: blocking1.8b2?
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: