Disabling WebGL2 should mean no context is created
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 22:27:58 +0000 (22:27 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 22:27:58 +0000 (22:27 +0000)
commit498e5827ddca403553c9008dea2d30a7634aac28
tree16eb2ea9b07bd367c1e4919ed57fc4da8b07274a
parent65b112258ac21317351672abb88541f268e21032
Disabling WebGL2 should mean no context is created
https://bugs.webkit.org/show_bug.cgi?id=157352
<rdar://problem/26096346>

Reviewed by Eric Carlson.

Source/WebCore:

If WebGL2 is disabled by the runtime flag, we should
not create a context.

Test: fast/canvas/webgl/webgl2-runtime-flag.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* testing/Internals.cpp: Added some helpers to toggle the runtime setting.
(WebCore::Internals::webGL2Enabled):
(WebCore::Internals::setWebGL2Enabled):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Check that toggling the runtime flag enables/disables WebGL 2.0.

* fast/canvas/webgl/webgl2-runtime-flag-expected.txt: Added.
* fast/canvas/webgl/webgl2-runtime-flag.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/webgl2-runtime-flag-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/webgl2-runtime-flag.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl