Closed Bug 593898 Opened 14 years ago Closed 14 years ago

MOZ_ACCELERATED=1 or layers.accelerated-all does not work anymore on widget QT

Categories

(Core Graveyard :: Widget: Qt, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: romaxa, Assigned: romaxa)

References

Details

Attachments

(1 file, 2 obsolete files)

After recent changes in MOZ_ACCELERATED value handler GL enabler stopped working in Qt widget. There are 2 problems: 1) nsWindow::SetAccelerated is not called anymore (need for Qt to enable QGLWidget before GL context creation) 2) mUseAccelerated need to be set to toplevel window, otherwise..
I think this come from bug 590599
Blocks: 590599
I think we can also remove PREFS and MOZ_ACCELERATED values reading from http://mxr.mozilla.org/mozilla-central/source/widget/src/windows/nsWindow.cpp#3177
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #472518 - Flags: review?(roc)
+ PRBool newAcceleratedValue = PR_FALSE; if (disableAcceleration || safeMode) - mUseAcceleratedRendering = PR_FALSE; + newAcceleratedValue = PR_FALSE; else if (accelerateByDefault) - mUseAcceleratedRendering = PR_TRUE; + newAcceleratedValue = PR_TRUE; + + if (newAccelValue != mUseAcceleratedRendering) + SetAcceleratedRendering(newAcceleratedValue); This doesn't seem right. You're going to override any other setting of SetAcceleratedRendering, e.g. if the window has the 'accelerated' attribute. Can't you move whatever QGL stuff you need to do into context creation?
Attached patch Fix QGL init for Qt port (obsolete) — Splinter Review
Attachment #472518 - Attachment is obsolete: true
Attachment #472552 - Flags: review?(roc)
Attachment #472518 - Flags: review?(roc)
I think the code in nsBaseWidget::GetLayerManager that checks prefs and environment should move to SetLayerManager so that mUseAcceleratedRendering is always correct. Then, I think you can just call GetAcceleratedRendering from nsWindow::createQWidget. Although, does that happen before we call SetAcceleratedRendering from nsXULWindow? If so, then I guess you have to give up on supporting the 'accelerated' attribute. If that's OK, then I suggest you add a call to SetAcceleratedRendering(PR_FALSE) somewhere before you call GetAcceleratedRendering to ensure that the prefs and environment are consulted.
(In reply to comment #5) > I think the code in nsBaseWidget::GetLayerManager that checks prefs and > environment should move to SetLayerManager so that mUseAcceleratedRendering is SetLayerManager - it is gfx/layers code IIUC? do we really want to keep prefs check code there? > Then, I think you can just call GetAcceleratedRendering from > nsWindow::createQWidget. Although, does that happen before we call GetAcceleratedRendering - just return mUseAcceleratedRendering right now. and someone should call SetAcceleratedRendering to set that as true.
Attached patch Simple versionSplinter Review
Ok MOZ_ACCELERATED stuff has been fixed... And now we only need to enable QGLWidget with Qt GL context when MOZ_ACCELERATED==1
Attachment #472552 - Attachment is obsolete: true
Attachment #475266 - Flags: review?(doug.turner)
Attachment #472552 - Flags: review?(roc)
Comment on attachment 475266 [details] [diff] [review] Simple version plz add a comment above the test. no need to set Qt::WA_PaintOnScreen or Qt::WA_NoSystemBackground on the widget?
no, Qt::WA flags are not needed anymore
Attachment #475266 - Flags: review?(doug.turner) → review+
a=npodb
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
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: