- Revision
- 213869
- Author
- [email protected]
- Date
- 2017-03-13 14:36:46 -0700 (Mon, 13 Mar 2017)
Log Message
Source/WebCore:
Respect the runtime flag for WebGPU, default feature to off.
https://bugs.webkit.org/show_bug.cgi?id=169564
<rdar://problems/31018864>
Reviewed by Tim Horton.
Make sure WebGPU respects its runtime feature flag. Also, since
this implementation doesn't validate content, it should default
to being disabled.
Test: fast/canvas/webgpu/webgpu-runtime-flag.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::getContextWebGPU):
Source/WebKit2:
Respect the runtime flag for WebGPU, default feature to off, and print a warning
https://bugs.webkit.org/show_bug.cgi?id=169564
<rdar://problems/31018864>
Reviewed by Tim Horton.
Make sure WebGPU respects its runtime feature flag. Also, since
this implementation doesn't validate content, it should default
to being disabled.
* Shared/WebPreferencesDefinitions.h:
LayoutTests:
Respect the runtime flag for WebGPU, default feature to off, and print a warning
https://bugs.webkit.org/show_bug.cgi?id=169564
<rdar://problem/31018864>
Reviewed by Tim Horton.
* fast/canvas/webgpu/webgpu-runtime-flag-expected.txt: Added.
* fast/canvas/webgpu/webgpu-runtime-flag.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (213868 => 213869)
--- trunk/LayoutTests/ChangeLog 2017-03-13 21:26:11 UTC (rev 213868)
+++ trunk/LayoutTests/ChangeLog 2017-03-13 21:36:46 UTC (rev 213869)
@@ -1,3 +1,14 @@
+2017-03-13 Dean Jackson <[email protected]>
+
+ Respect the runtime flag for WebGPU, default feature to off, and print a warning
+ https://bugs.webkit.org/show_bug.cgi?id=169564
+ <rdar://problem/31018864>
+
+ Reviewed by Tim Horton.
+
+ * fast/canvas/webgpu/webgpu-runtime-flag-expected.txt: Added.
+ * fast/canvas/webgpu/webgpu-runtime-flag.html: Added.
+
2017-03-13 Caio Lima <[email protected]>
[JSC] It should be possible create a label named let when parsing Statement in non strict mode
Added: trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag-expected.txt (0 => 213869)
--- trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag-expected.txt 2017-03-13 21:36:46 UTC (rev 213869)
@@ -0,0 +1,2 @@
+PASS: WebGPU was available when enabled.
+PASS: WebGPU was not available when disabled.
Property changes on: trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag-expected.txt
___________________________________________________________________
Added: svn:eol-style
+native
\ No newline at end of property
Added: svn:keywords
+Date Revision
\ No newline at end of property
Added: svn:mime-type
+text/plain
\ No newline at end of property
Added: trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag.html (0 => 213869)
--- trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag.html (rev 0)
+++ trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag.html 2017-03-13 21:36:46 UTC (rev 213869)
@@ -0,0 +1,42 @@
+<script>
+
+if (window.testRunner)
+ window.testRunner.dumpAsText();
+
+function getContext(name) {
+ var c = document.createElement("canvas");
+ return c.getContext(name);
+}
+
+function run() {
+ var output;
+
+ output = document.getElementById("output1");
+
+ if (!window.testRunner) {
+ output.textContent = "This test only runs inside DRT/WKTR.";
+ return;
+ }
+
+ window.internals.settings.setWebGPUEnabled(true);
+ var ctx = getContext("webgpu");
+ if (ctx)
+ output.textContent = "PASS: WebGPU was available when enabled.";
+ else
+ output.textContent = "FAIL: WebGPU was not available when enabled.";
+
+ output = document.getElementById("output2");
+
+ window.internals.settings.setWebGPUEnabled(false);
+ var ctx = getContext("webgpu");
+ if (ctx)
+ output.textContent = "FAIL: WebGPU was available when disabled.";
+ else
+ output.textContent = "PASS: WebGPU was not available when disabled.";
+}
+
+window.addEventListener("load", run, false);
+
+</script>
+<div id="output1"></div>
+<div id="output2"></div>
Property changes on: trunk/LayoutTests/fast/canvas/webgpu/webgpu-runtime-flag.html
___________________________________________________________________
Added: svn:eol-style
+native
\ No newline at end of property
Added: svn:keywords
+Date Revision
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Modified: trunk/Source/WebCore/ChangeLog (213868 => 213869)
--- trunk/Source/WebCore/ChangeLog 2017-03-13 21:26:11 UTC (rev 213868)
+++ trunk/Source/WebCore/ChangeLog 2017-03-13 21:36:46 UTC (rev 213869)
@@ -1,3 +1,21 @@
+2017-03-13 Dean Jackson <[email protected]>
+
+ Respect the runtime flag for WebGPU, default feature to off.
+ https://bugs.webkit.org/show_bug.cgi?id=169564
+ <rdar://problems/31018864>
+
+ Reviewed by Tim Horton.
+
+ Make sure WebGPU respects its runtime feature flag. Also, since
+ this implementation doesn't validate content, it should default
+ to being disabled.
+
+ Test: fast/canvas/webgpu/webgpu-runtime-flag.html
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::getContext):
+ (WebCore::HTMLCanvasElement::getContextWebGPU):
+
2017-03-13 Alex Christensen <[email protected]>
Fix CMake build.
Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (213868 => 213869)
--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2017-03-13 21:26:11 UTC (rev 213868)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp 2017-03-13 21:36:46 UTC (rev 213869)
@@ -44,6 +44,7 @@
#include "ImageData.h"
#include "MIMETypeRegistry.h"
#include "RenderHTMLCanvas.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptController.h"
#include "Settings.h"
#include <math.h>
@@ -200,7 +201,7 @@
return getContext2d(type);
#if ENABLE(WEBGPU)
- if (HTMLCanvasElement::isWebGPUType(type))
+ if (HTMLCanvasElement::isWebGPUType(type) && RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled())
return getContextWebGPU(type);
#endif
@@ -317,6 +318,9 @@
{
ASSERT_UNUSED(type, HTMLCanvasElement::isWebGPUType(type));
+ if (!RuntimeEnabledFeatures::sharedFeatures().webGPUEnabled())
+ return nullptr;
+
if (m_context && !m_context->isGPU())
return nullptr;
Modified: trunk/Source/WebKit2/ChangeLog (213868 => 213869)
--- trunk/Source/WebKit2/ChangeLog 2017-03-13 21:26:11 UTC (rev 213868)
+++ trunk/Source/WebKit2/ChangeLog 2017-03-13 21:36:46 UTC (rev 213869)
@@ -1,3 +1,17 @@
+2017-03-13 Dean Jackson <[email protected]>
+
+ Respect the runtime flag for WebGPU, default feature to off, and print a warning
+ https://bugs.webkit.org/show_bug.cgi?id=169564
+ <rdar://problems/31018864>
+
+ Reviewed by Tim Horton.
+
+ Make sure WebGPU respects its runtime feature flag. Also, since
+ this implementation doesn't validate content, it should default
+ to being disabled.
+
+ * Shared/WebPreferencesDefinitions.h:
+
2017-03-13 Anders Carlsson <[email protected]>
Fix more build warnings.
Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (213868 => 213869)
--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2017-03-13 21:26:11 UTC (rev 213868)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2017-03-13 21:36:46 UTC (rev 213869)
@@ -333,7 +333,7 @@
macro(UserTimingEnabled, userTimingEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "User Timing", "Enable UserTiming API") \
macro(WebAnimationsEnabled, webAnimationsEnabled, Bool, bool, false, "Web Animations", "Web Animations prototype") \
macro(WebGL2Enabled, webGL2Enabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "WebGL 2.0", "WebGL 2 prototype") \
- macro(WebGPUEnabled, webGPUEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "WebGPU", "WebGPU prototype") \
+ macro(WebGPUEnabled, webGPUEnabled, Bool, bool, false, "WebGPU", "WebGPU prototype") \
\
#if PLATFORM(COCOA)