Implement preferLowPowerToHighPerformance for WebGL
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2016 22:52:24 +0000 (22:52 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2016 22:52:24 +0000 (22:52 +0000)
commit0d507daa8c59eec210cb29cdf4dcf7c12e955805
treeeeebb137b458ed94972133c611cac834b6cd82eb
parent1c70b250a2dc0cc3c914073187ae9f0f4e6ecffa
Implement preferLowPowerToHighPerformance for WebGL
https://bugs.webkit.org/show_bug.cgi?id=161017
<rdar://problem/26819135>

Reviewed by Myles Maxfield.

.:

A manual test that creates contexts with and without preferLowPowerToHighPerformance
to see what is used. This has to be manual because it depends on the hardware
configuration, and we don't have a way to detect it up-front. Also, if the
code was failing, it would be the same result as on a single GPU system.

* ManualTests/webgl-preferLowPowerToHighPerformance.html: Added.

Source/WebCore:

Implement preferLowPowerToHighPerformance on macOS by
passing the correct CGL attribute when creating the
pixel format.

* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::get3DContextAttributes):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::setPixelFormat):
(WebCore::GraphicsContext3D::GraphicsContext3D):

LayoutTests:

Now that we implement preferLowPowerToHighPerformance we can
retain its value in the context creation attributes object.

* fast/canvas/webgl/context-creation-attributes-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt
ManualTests/webgl-preferLowPowerToHighPerformance.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm