Closed Bug 202751 Opened 22 years ago Closed 22 years ago

nsBlender can have issues on 24-bit GTK setups

Categories

(Core Graveyard :: GFX, defect, P2)

x86
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: roc)

References

Details

(Keywords: crash)

Attachments

(1 file, 1 obsolete file)

The basic problem is that the nsDrawingSurfaceGTK::Lock sets the drawing surface width in bytes as: 177 *aWidthBytes = aWidth*(mImage->bpp >> 3); and mImage->bpp is actually 32, not 24, on 24-bit setups. The following patch makes the octopus not crash (not suitable for checkin; needs a zero-check at the very least): Index: gfx/src/nsBlender.cpp =================================================================== RCS file: /cvsroot/mozilla/gfx/src/nsBlender.cpp,v retrieving revision 3.35 diff -p -u -2 -r3.35 nsBlender.cpp --- gfx/src/nsBlender.cpp 6 Apr 2003 02:49:30 -0000 3.35 +++ gfx/src/nsBlender.cpp 21 Apr 2003 04:46:49 -0000 @@ -383,6 +383,5 @@ NS_IMETHODIMP nsBlender::GetAlphas(const *aAlphas = new PRUint8[r.width*r.height]; if (*aAlphas) { - PRUint32 depth; - mContext->GetDepth(depth); + PRUint32 depth = (blackBytesPerLine/r.width)*8; ComputeAlphas(r.height, blackBytesPerLine, depth, blackBytes, whiteBytes, blackSpan,
This is a crash, actually.... ;)
Severity: normal → critical
Keywords: crash
The patch seems to stop the crash for me, but makes the window appear kind of transparent instead. You can see right through to the window underneath where it's supposed to be white.
Sorry, please ignore my last comment-- now that I can see the window under Phoenix, I find that the CSS was subtly broken, hence the transparency.
Attached patch fixes (obsolete) — Splinter Review
OK, this fixes the crash ... it's just the bz patch. It also restores transparent chrome functionality --- the window is set to transparent before it is shown, but it isn't painted before it is shown, so the alpha mask bitmap is never setup. We should just test the transparency state directly.
Attachment #130754 - Flags: superreview?(blizzard)
Attachment #130754 - Flags: review?(blizzard)
Attachment #130754 - Flags: superreview?(blizzard)
Attachment #130754 - Flags: superreview?(blizzard)
Attachment #130754 - Flags: review?(blizzard)
Attachment #130754 - Flags: review?(blizzard)
Comment on attachment 130754 [details] [diff] [review] fixes What's with the PAINT_SEPERATELY in this patch?
Attached patch better patchSplinter Review
that patch was bogus. Check this out.
Attachment #130754 - Attachment is obsolete: true
Attachment #130754 - Flags: superreview?(blizzard)
Attachment #130754 - Flags: review?(blizzard)
Attachment #131756 - Flags: superreview?(blizzard)
Attachment #131756 - Flags: review?(blizzard)
Attachment #131756 - Flags: superreview?(blizzard)
Attachment #131756 - Flags: superreview+
Attachment #131756 - Flags: review?(blizzard)
Attachment #131756 - Flags: review+
Fix checked in.
Status: NEW → RESOLVED
Closed: 22 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: