Closed Bug 715952 Opened 13 years ago Closed 13 years ago

glxtest incorrectly creates the backing pixmap and causes X errors

Categories

(Core :: Graphics, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: nmiell, Assigned: nmiell)

Details

Attachments

(1 file)

The call to XCreatePixmap() at http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/glxtest.cpp#205 hardcodes the depth to be 32, while the call to glXCreatePixmap() on the next line uses the first GLXFBConfig returned by the previous glXChooseFBConfig() which doesn't necessarily have a depth of 32. 

This appears to work without error with Mesa hardware rendering, but it will cause a BadMatch error when glMakeCurrent(dpy, None, NULL) is called on line 246 with Mesa software rendering as Mesa attempts to XPutImage() a 24-bit pixmap created internally on the 32-bit pixmap supplied by Firefox. Not surprisingly, the first GLXFBConfig returned by glXChooseFBConfig() with Mesa software rendering has a depth of 24.

This has a very easy fix, change the 32 in the call to XCreatePixmap to vInfo->depth. I've tested it on Firefox 9.0.1 on a 64-bit Fedora 16 system, and Firefox now works with Mesa software rendering.
Moving over to Toolkit -> General for further triage.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Product: Firefox → Toolkit
QA Contact: general → general
Version: unspecified → Trunk
Attachment #586472 - Flags: review?(bjacob)
Component: General → Graphics
Product: Toolkit → Core
QA Contact: general → thebes
Comment on attachment 586472 [details] [diff] [review]
Fix glxtest pixmap creation

Review of attachment 586472 [details] [diff] [review]:
-----------------------------------------------------------------

Many thanks for the debugging and the patch!
Attachment #586472 - Flags: review?(bjacob) → review+
Also, support for Mesa software rendering is very important as it's the only way to make WebGL support ubiquitous without involving proprietary software (Mesa seems to be the only competitive open source software OpenGL implementation).
http://hg.mozilla.org/integration/mozilla-inbound/rev/23d71e342b3e
Assignee: nobody → nmiell
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla12
Whiteboard: [needs landing]
Whiteboard: [needs landing]
https://hg.mozilla.org/mozilla-central/rev/23d71e342b3e
Status: ASSIGNED → RESOLVED
Closed: 13 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: