Title: [199055] trunk
Revision
199055
Author
[email protected]
Date
2016-04-05 04:22:17 -0700 (Tue, 05 Apr 2016)

Log Message

[WebGL2] Allow enabling WebGL2 with a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=156166
<rdar://problem/25526929>

Source/WebCore:

Added new runtime flags for WebGL2.

Patch by Antoine Quint <[email protected]> on 2016-04-05
Reviewed by Dean Jackson.

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebGL2Enabled):
(WebCore::RuntimeEnabledFeatures::webGL2Enabled):

Source/WebKit/mac:

Set the WebGL2 runtime flag based on preferences, disabled by default.

Patch by Antoine Quint <[email protected]> on 2016-04-05
Reviewed by Dean Jackson.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences webGL2Enabled]):
(-[WebPreferences setWebGL2Enabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Set the WebGL2 runtime flag based on preferences, disabled by default.

Patch by Antoine Quint <[email protected]> on 2016-04-05
Reviewed by Dean Jackson.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebGL2Enabled):
(WKPreferencesGetWebGL2Enabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

Removed the manual overrides of ENABLE_WEBGL2.

Patch by Antoine Quint <[email protected]> on 2016-04-05
Reviewed by Dean Jackson.

* wtf/FeatureDefines.h:

Tools:

Always enable WebGL2 during testing.

Patch by Antoine Quint <[email protected]> on 2016-04-05
Reviewed by Dean Jackson.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebGL2Enabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (199054 => 199055)


--- trunk/Source/WTF/ChangeLog	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WTF/ChangeLog	2016-04-05 11:22:17 UTC (rev 199055)
@@ -1,3 +1,15 @@
+2016-04-05  Antoine Quint  <[email protected]>
+
+        [WebGL2] Allow enabling WebGL2 with a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=156166
+        <rdar://problem/25526929>
+
+        Removed the manual overrides of ENABLE_WEBGL2.
+
+        Reviewed by Dean Jackson.
+
+        * wtf/FeatureDefines.h:
+
 2016-03-31  Konstantin Tokarev  <[email protected]>
 
         Removed leftovers of ENABLE(INSPECTOR) and ENABLE(VIEWPORT).

Modified: trunk/Source/WTF/wtf/FeatureDefines.h (199054 => 199055)


--- trunk/Source/WTF/wtf/FeatureDefines.h	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WTF/wtf/FeatureDefines.h	2016-04-05 11:22:17 UTC (rev 199055)
@@ -747,10 +747,6 @@
 #define ENABLE_WEBGL 0
 #endif
 
-#if !defined(ENABLE_WEBGL2)
-#define ENABLE_WEBGL2 0
-#endif
-
 #if !defined(ENABLE_GRAPHICS_CONTEXT_3D)
 #define ENABLE_GRAPHICS_CONTEXT_3D ENABLE_WEBGL
 #endif

Modified: trunk/Source/WebCore/ChangeLog (199054 => 199055)


--- trunk/Source/WebCore/ChangeLog	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebCore/ChangeLog	2016-04-05 11:22:17 UTC (rev 199055)
@@ -1,3 +1,17 @@
+2016-04-05  Antoine Quint  <[email protected]>
+
+        [WebGL2] Allow enabling WebGL2 with a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=156166
+        <rdar://problem/25526929>
+
+        Added new runtime flags for WebGL2.
+
+        Reviewed by Dean Jackson.
+
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setWebGL2Enabled):
+        (WebCore::RuntimeEnabledFeatures::webGL2Enabled):
+
 2016-04-05  Antti Koivisto  <[email protected]>
 
         Use RenderTreeUpdater for text node mutations

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (199054 => 199055)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-04-05 11:22:17 UTC (rev 199055)
@@ -217,6 +217,11 @@
     bool customElementsEnabled() const { return m_areCustomElementsEnabled; }
 #endif
 
+#if ENABLE(WEBGL2)
+    void setWebGL2Enabled(bool isEnabled) { m_isWebGL2Enabled = isEnabled; }
+    bool webGL2Enabled() const { return m_isWebGL2Enabled; }
+#endif
+
     WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures();
 
 private:
@@ -310,6 +315,10 @@
     bool m_areCustomElementsEnabled;
 #endif
 
+#if ENABLE(WEBGL2)
+    bool m_isWebGL2Enabled;
+#endif
+
     friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>;
 };
 

Modified: trunk/Source/WebKit/mac/ChangeLog (199054 => 199055)


--- trunk/Source/WebKit/mac/ChangeLog	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-04-05 11:22:17 UTC (rev 199055)
@@ -1,3 +1,22 @@
+2016-04-05  Antoine Quint  <[email protected]>
+
+        [WebGL2] Allow enabling WebGL2 with a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=156166
+        <rdar://problem/25526929>
+
+        Set the WebGL2 runtime flag based on preferences, disabled by default.
+
+        Reviewed by Dean Jackson.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences webGL2Enabled]):
+        (-[WebPreferences setWebGL2Enabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2016-04-01  Alex Christensen  <[email protected]>
 
         Compile DumpRenderTree with CMake on Mac

Modified: trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h (199054 => 199055)


--- trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h	2016-04-05 11:22:17 UTC (rev 199055)
@@ -109,6 +109,7 @@
 #define WebKitShowRepaintCounterPreferenceKey @"WebKitShowRepaintCounter"
 #define WebKitWebAudioEnabledPreferenceKey @"WebKitWebAudioEnabled"
 #define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
+#define WebKitWebGL2EnabledPreferenceKey @"WebKitWebGL2Enabled"
 #define WebKitForceSoftwareWebGLRenderingPreferenceKey @"WebKitForceSoftwareWebGLRendering"
 #define WebKitAccelerated2dCanvasEnabledPreferenceKey @"WebKitAccelerated2dCanvasEnabled"
 #define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"

Modified: trunk/Source/WebKit/mac/WebView/WebPreferences.mm (199054 => 199055)


--- trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit/mac/WebView/WebPreferences.mm	2016-04-05 11:22:17 UTC (rev 199055)
@@ -610,6 +610,9 @@
 #if ENABLE(CUSTOM_ELEMENTS)
         [NSNumber numberWithBool:NO], WebKitCustomElementsEnabledPreferenceKey,
 #endif
+#if ENABLE(WEBGL2)
+        [NSNumber numberWithBool:NO], WebKitWebGL2EnabledPreferenceKey,
+#endif
         nil];
 
 #if !PLATFORM(IOS)
@@ -1948,6 +1951,16 @@
     [self _setBoolValue:enabled forKey:WebKitWebGLEnabledPreferenceKey];
 }
 
+- (BOOL)webGL2Enabled
+{
+    return [self _boolValueForKey:WebKitWebGL2EnabledPreferenceKey];
+}
+
+- (void)setWebGL2Enabled:(BOOL)enabled
+{
+    [self _setBoolValue:enabled forKey:WebKitWebGL2EnabledPreferenceKey];
+}
+
 - (BOOL)forceSoftwareWebGLRendering
 {
     return [self _boolValueForKey:WebKitForceSoftwareWebGLRenderingPreferenceKey];

Modified: trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h (199054 => 199055)


--- trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h	2016-04-05 11:22:17 UTC (rev 199055)
@@ -236,6 +236,9 @@
 - (BOOL)webGLEnabled;
 - (void)setWebGLEnabled:(BOOL)enabled;
 
+- (BOOL)webGL2Enabled;
+- (void)setWebGL2Enabled:(BOOL)enabled;
+
 - (BOOL)forceSoftwareWebGLRendering;
 - (void)setForceSoftwareWebGLRendering:(BOOL)forced;
 

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (199054 => 199055)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2016-04-05 11:22:17 UTC (rev 199055)
@@ -2488,6 +2488,9 @@
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled([preferences customElementsEnabled]);
 #endif
 
+#if ENABLE(WEBGL2)
+    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled([preferences webGL2Enabled]);
+#endif
 
     NSTimeInterval timeout = [preferences incrementalRenderingSuppressionTimeoutInSeconds];
     if (timeout > 0)

Modified: trunk/Source/WebKit2/ChangeLog (199054 => 199055)


--- trunk/Source/WebKit2/ChangeLog	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit2/ChangeLog	2016-04-05 11:22:17 UTC (rev 199055)
@@ -1,3 +1,23 @@
+2016-04-05  Antoine Quint  <[email protected]>
+
+        [WebGL2] Allow enabling WebGL2 with a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=156166
+        <rdar://problem/25526929>
+
+        Set the WebGL2 runtime flag based on preferences, disabled by default.
+
+        Reviewed by Dean Jackson.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetWebGL2Enabled):
+        (WKPreferencesGetWebGL2Enabled):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2016-04-04  Zan Dobersek  <[email protected]>
 
         [ThreadedCompositor] Move CompositingRunLoop class into a separate file

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (199054 => 199055)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2016-04-05 11:22:17 UTC (rev 199055)
@@ -227,6 +227,7 @@
     macro(MockCaptureDevicesEnabled, mockCaptureDevicesEnabled, Bool, bool, false) \
     macro(ShadowDOMEnabled, shadowDOMEnabled, Bool, bool, true) \
     macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, false) \
+    macro(WebGL2Enabled, webGL2Enabled, Bool, bool, false) \
     FOR_EACH_ADDITIONAL_WEBKIT_BOOL_PREFERENCE(macro) \
     \
 

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (199054 => 199055)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp	2016-04-05 11:22:17 UTC (rev 199055)
@@ -459,6 +459,16 @@
     return toImpl(preferencesRef)->webGLEnabled();
 }
 
+void WKPreferencesSetWebGL2Enabled(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)->setWebGL2Enabled(flag);
+}
+
+bool WKPreferencesGetWebGL2Enabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->webGL2Enabled();
+}
+
 void WKPreferencesSetForceSoftwareWebGLRendering(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setForceSoftwareWebGLRendering(flag);

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (199054 => 199055)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h	2016-04-05 11:22:17 UTC (rev 199055)
@@ -98,6 +98,10 @@
 WK_EXPORT bool WKPreferencesGetWebGLEnabled(WKPreferencesRef);
 
 // Defaults to false.
+WK_EXPORT void WKPreferencesSetWebGL2Enabled(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetWebGL2Enabled(WKPreferencesRef);
+
+// Defaults to false.
 WK_EXPORT void WKPreferencesSetForceSoftwareWebGLRendering(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetForceSoftwareWebGLRendering(WKPreferencesRef);
 

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (199054 => 199055)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2016-04-05 11:22:17 UTC (rev 199055)
@@ -203,6 +203,11 @@
         RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled(enabled);
 #endif
 
+#if ENABLE(WEBGL2)
+    if (preference == "WebKitWebGL2Enabled")
+        RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(enabled);
+#endif
+
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
     macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (199054 => 199055)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-04-05 11:22:17 UTC (rev 199055)
@@ -3095,6 +3095,10 @@
     RuntimeEnabledFeatures::sharedFeatures().setCustomElementsEnabled(store.getBoolValueForKey(WebPreferencesKey::customElementsEnabledKey()));
 #endif
 
+#if ENABLE(WEBGL2)
+    RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(store.getBoolValueForKey(WebPreferencesKey::webGL2EnabledKey()));
+#endif
+
     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
     if (m_processSuppressionEnabled != processSuppressionEnabled) {
         m_processSuppressionEnabled = processSuppressionEnabled;

Modified: trunk/Tools/ChangeLog (199054 => 199055)


--- trunk/Tools/ChangeLog	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Tools/ChangeLog	2016-04-05 11:22:17 UTC (rev 199055)
@@ -1,3 +1,21 @@
+2016-04-05  Antoine Quint  <[email protected]>
+
+        [WebGL2] Allow enabling WebGL2 with a runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=156166
+        <rdar://problem/25526929>
+
+        Always enable WebGL2 during testing.
+
+        Reviewed by Dean Jackson.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setWebGL2Enabled):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+
 2016-04-04  Bill Ming  <[email protected]>
 
         [win] run-webkit-tests failed to launch DumpRenderTree

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (199054 => 199055)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2016-04-05 11:22:17 UTC (rev 199055)
@@ -987,6 +987,8 @@
     [preferences setShadowDOMEnabled:YES];
     [preferences setCustomElementsEnabled:YES];
 
+    [preferences setWebGL2Enabled:YES];
+
     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (199054 => 199055)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2016-04-05 11:22:17 UTC (rev 199055)
@@ -313,6 +313,8 @@
     m_testRunner->setShadowDOMEnabled(true);
     m_testRunner->setCustomElementsEnabled(true);
 
+    m_testRunner->setWebGL2Enabled(true);
+
     m_testRunner->setCloseRemainingWindowsWhenComplete(false);
     m_testRunner->setAcceptsEditing(true);
     m_testRunner->setTabKeyCyclesThroughElements(true);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (199054 => 199055)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2016-04-05 11:22:17 UTC (rev 199055)
@@ -338,6 +338,13 @@
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
+void TestRunner::setWebGL2Enabled(bool enabled)
+{
+    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitWebGL2Enabled"));
+    auto& injectedBundle = InjectedBundle::singleton();
+    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
+}
+
 void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
 {
     auto& injectedBundle = InjectedBundle::singleton();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (199054 => 199055)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-04-05 10:29:31 UTC (rev 199054)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2016-04-05 11:22:17 UTC (rev 199055)
@@ -101,6 +101,7 @@
     void setXSSAuditorEnabled(bool);
     void setShadowDOMEnabled(bool);
     void setCustomElementsEnabled(bool);
+    void setWebGL2Enabled(bool);
     void setAllowUniversalAccessFromFileURLs(bool);
     void setAllowFileAccessFromFileURLs(bool);
     void setPluginsEnabled(bool);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to