Closed
Bug 556027
Opened 15 years ago
Closed 15 years ago
Allow setting an attribute to use Hardware layermanagers
Categories
(Core :: Widget, defect)
Core
Widget
Tracking
()
RESOLVED
FIXED
People
(Reporter: bas.schouten, Assigned: bas.schouten)
References
Details
(Keywords: dev-doc-complete)
Attachments
(2 files, 1 obsolete file)
33.89 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
1.70 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
We need to allow setting an attribute on XUL windows in order to tell them to use a hardware layers manager. This will allow us to enable hardware acceleration on a per widget basis.
Assignee | ||
Comment 1•15 years ago
|
||
This patch adds a boolean to nsWidgetInitData to flag if a widget should use hardware layers. It will then try and create and initialize a LayerManagerOGL on that platform. If this fails to initialize it will fallback to a normal basic layer manager.
Other platforms should have their paint routines adapted to not always assume basic layer managers once we make the OGL initializations succeed there.
Sadly a large part of this patch is indentation depth changing in OnPaint on windows!
Attachment #436008 -
Flags: review?(roc)
+ } else if (GetLayerManager()->GetBackendType() ==
+ LayerManager::LAYERS_OPENGL) {
+ static_cast<mozilla::layers::LayerManagerOGL*>(GetLayerManager())->
+ SetClippingRegion(event.region);
+ result = DispatchWindowEvent(&event, eventStatus);
}
Probably we should just switch on GetLayerManager()->GetBackendType(). There should be a "default" clause which does NS_ERROR.
How about mAcceleratedRendering instead of mUseHardwareLayers?
I think we should take this out of the initdata and just have a method SetAcceleratedRendering. Then we can switch dynamically if desired.
Assignee | ||
Comment 3•15 years ago
|
||
Updated to now have an AcceleratedRendering attribute. Setting this on child widgets is pointless, they will reset automatically to the parent widget setting.
Attachment #436008 -
Attachment is obsolete: true
Attachment #436100 -
Flags: review?(roc)
Attachment #436008 -
Flags: review?(roc)
Assignee | ||
Comment 4•15 years ago
|
||
Attachment #436101 -
Flags: review?(roc)
Comment on attachment 436100 [details] [diff] [review]
Part 1: Allow SetAcceleratedRendering on top level widgets
+ GetNSWindowPtr(GetTopLevelHWND(mWnd, PR_TRUE))->
+ GetAcceleratedRendering(&useAcceleration);
Null-check the result of GetNSWindowPtr. In embedded situations this could be null when we don't own the toplevel window.
+ "AutoLayerManagerSetup instantiated for none basic layer backend!");
non-basic
+ NS_IMETHOD GetAcceleratedRendering(PRBool *aEnabled);
Just make this virtual PRBool (returning the value directly)
Attachment #436100 -
Flags: review?(roc) → review+
Comment on attachment 436101 [details] [diff] [review]
Part 2: Add 'accelerated' attribute to nsXULWindow
+GK_ATOM(accelerated, "accelerated")
Don't add this, since we don't use it.
Attachment #436101 -
Flags: review?(roc) → review+
Assignee | ||
Comment 7•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•15 years ago
|
||
Comment 9•15 years ago
|
||
Most other boolean XUL attributes work via case-sensitive comparison to "true", not via hasAttribute.
Updated•15 years ago
|
Keywords: dev-doc-needed
That's true, but the Web works differently ... anyway, it doesn't matter too much. This code is actually temporary because sooner or later all our windows will be accelerated.
Comment 11•15 years ago
|
||
Documented here:
https://developer.mozilla.org/en/XUL/Attribute/accelerated
With appropriate entry added to:
https://developer.mozilla.org/en/XUL/window
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•