Support passing preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2016 00:50:36 +0000 (00:50 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2016 00:50:36 +0000 (00:50 +0000)
commitd02cb66689a9578e9048da91f1931160072acf43
treef7b77a213ef0649aa4d82818c17ce02676f2d429
parent91ed5eb2d868073a214c4672ed1388ef240fd8f5
Support passing preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat
https://bugs.webkit.org/show_bug.cgi?id=160982
<rdar://problem/27915946>

Reviewed by Simon Fraser.

Source/WebCore:

Update WebGLContextAttributes to be compliant with the specification,
by adding preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat.
They are not implemented yet, so asking the created context what
values it used should give the default.

Test: fast/canvas/webgl/context-creation-attributes.html

* html/canvas/WebGLContextAttributes.cpp:
(WebCore::WebGLContextAttributes::preferLowPowerToHighPerformance):
(WebCore::WebGLContextAttributes::setPreferLowPowerToHighPerformance):
(WebCore::WebGLContextAttributes::failIfMajorPerformanceCaveat):
(WebCore::WebGLContextAttributes::setFailIfMajorPerformanceCaveat):
* html/canvas/WebGLContextAttributes.h:
* html/canvas/WebGLContextAttributes.idl:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create): Deleted.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::Attributes::Attributes): Deleted.

LayoutTests:

Very simple test that creates some WebGL contexts with various
creation attributes and outputs the result.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/context-creation-attributes-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/context-creation-attributes.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLContextAttributes.cpp
Source/WebCore/html/canvas/WebGLContextAttributes.h
Source/WebCore/html/canvas/WebGLContextAttributes.idl
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h