Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Feb 2017 23:31:12 +0000 (23:31 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Feb 2017 23:31:12 +0000 (23:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168339
Source/WebCore:

<rdar://problem/30522092>

Reviewed by Simon Fraser.

Use a setting name that more clearly reflects what it is doing. It's not
preferring to use the low-power GPU, it's forcing it.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* page/Settings.in:

Source/WebKit/mac:

Reviewed by Simon Fraser.

Use a better name.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences forceLowPowerGPUForWebGL]):
(-[WebPreferences setForceLowPowerGPUForWebGL:]):
(-[WebPreferences preferLowPowerWebGLRendering]): Deleted.
(-[WebPreferences setPreferLowPowerWebGLRendering:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/page/Settings.in
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm

index ab4e2d1..7049275 100644 (file)
@@ -1,3 +1,18 @@
+2017-02-14  Dean Jackson  <dino@apple.com>
+
+        Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
+        https://bugs.webkit.org/show_bug.cgi?id=168339
+        <rdar://problem/30522092>
+
+        Reviewed by Simon Fraser.
+
+        Use a setting name that more clearly reflects what it is doing. It's not
+        preferring to use the low-power GPU, it's forcing it.
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::create):
+        * page/Settings.in:
+
 2017-02-14  Brady Eidson  <beidson@apple.com>
 
         Speculative fix for: Crash in DocumentThreadableLoader::redirectReceived.
index 192c7db..a0bc23f 100644 (file)
@@ -398,7 +398,7 @@ std::unique_ptr<WebGLRenderingContextBase> WebGLRenderingContextBase::create(HTM
         attributes.forceSoftwareRenderer = true;
 
     attributes.initialPowerPreference = attributes.powerPreference;
-    if (frame->settings().preferLowPowerWebGLRendering())
+    if (frame->settings().forceWebGLUsesLowPower())
         attributes.powerPreference = GraphicsContext3DPowerPreference::LowPower;
 
     if (page)
index d38773f..b86cf88 100644 (file)
@@ -108,7 +108,7 @@ experimentalNotificationsEnabled initial=false
 webGLEnabled initial=false
 webGLErrorsToConsoleEnabled initial=true
 forceSoftwareWebGLRendering initial=false
-preferLowPowerWebGLRendering initial=true
+forceWebGLUsesLowPower initial=true
 accelerated2dCanvasEnabled initial=false
 loadDeferringEnabled initial=true
 webAudioEnabled initial=false
index 8917555..d63859d 100644 (file)
@@ -1,3 +1,23 @@
+2017-02-14  Dean Jackson  <dino@apple.com>
+
+        Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
+        https://bugs.webkit.org/show_bug.cgi?id=168339
+
+        Reviewed by Simon Fraser.
+
+        Use a better name.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences forceLowPowerGPUForWebGL]):
+        (-[WebPreferences setForceLowPowerGPUForWebGL:]):
+        (-[WebPreferences preferLowPowerWebGLRendering]): Deleted.
+        (-[WebPreferences setPreferLowPowerWebGLRendering:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2017-02-14  Chris Dumez  <cdumez@apple.com>
 
         HTML Form Validation bubble should take minimum font size setting into consideration
index ffaa7d7..9db3520 100644 (file)
 #define WebKitWebGLEnabledPreferenceKey @"WebKitWebGLEnabled"
 #define WebKitWebGL2EnabledPreferenceKey @"WebKitWebGL2Enabled"
 #define WebKitForceSoftwareWebGLRenderingPreferenceKey @"WebKitForceSoftwareWebGLRendering"
-#define WebKitPreferLowPowerWebGLRenderingPreferenceKey @"WebKitPreferLowPowerWebGLRendering"
+#define WebKitForceWebGLUsesLowPowerPreferenceKey @"WebKitForceWebGLUsesLowPower"
 #define WebKitAccelerated2dCanvasEnabledPreferenceKey @"WebKitAccelerated2dCanvasEnabled"
 #define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled"
 #define WebKitSpatialNavigationEnabledPreferenceKey @"WebKitSpatialNavigationEnabled"
index 0afb409..bbf9fe2 100644 (file)
@@ -505,7 +505,7 @@ public:
         [NSNumber numberWithBool:NO],   WebKitShowRepaintCounterPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitWebGLEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],  WebKitForceSoftwareWebGLRenderingPreferenceKey,
-        [NSNumber numberWithBool:YES],   WebKitPreferLowPowerWebGLRenderingPreferenceKey,
+        [NSNumber numberWithBool:YES],   WebKitForceWebGLUsesLowPowerPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitAccelerated2dCanvasEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],  WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],  WebKitResourceLoadStatisticsEnabledPreferenceKey,
@@ -2043,14 +2043,14 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:forced forKey:WebKitForceSoftwareWebGLRenderingPreferenceKey];
 }
 
-- (BOOL)preferLowPowerWebGLRendering
+- (BOOL)forceLowPowerGPUForWebGL
 {
-    return [self _boolValueForKey:WebKitPreferLowPowerWebGLRenderingPreferenceKey];
+    return [self _boolValueForKey:WebKitForceWebGLUsesLowPowerPreferenceKey];
 }
 
-- (void)setPreferLowPowerWebGLRendering:(BOOL)preferLowPower
+- (void)setForceWebGLUsesLowPower:(BOOL)forceLowPower
 {
-    [self _setBoolValue:preferLowPower forKey:WebKitPreferLowPowerWebGLRenderingPreferenceKey];
+    [self _setBoolValue:forceLowPower forKey:WebKitForceWebGLUsesLowPowerPreferenceKey];
 }
 
 - (BOOL)accelerated2dCanvasEnabled
index e5c2678..50f573a 100644 (file)
@@ -251,8 +251,8 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 - (BOOL)forceSoftwareWebGLRendering;
 - (void)setForceSoftwareWebGLRendering:(BOOL)forced;
 
-- (BOOL)preferLowPowerWebGLRendering;
-- (void)setPreferLowPowerWebGLRendering:(BOOL)preferLowPower;
+- (BOOL)forceLowPowerGPUForWebGL;
+- (void)setForceWebGLUsesLowPower:(BOOL)forceLowPower;
 
 - (BOOL)accelerated2dCanvasEnabled;
 - (void)setAccelerated2dCanvasEnabled:(BOOL)enabled;
index 5c82cc2..0dd2fca 100644 (file)
@@ -2695,7 +2695,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setSubpixelCSSOMElementMetricsEnabled([preferences subpixelCSSOMElementMetricsEnabled]);
 
     settings.setForceSoftwareWebGLRendering([preferences forceSoftwareWebGLRendering]);
-    settings.setPreferLowPowerWebGLRendering([preferences preferLowPowerWebGLRendering]);
+    settings.setForceWebGLUsesLowPower([preferences forceLowPowerGPUForWebGL]);
     settings.setAccelerated2dCanvasEnabled([preferences accelerated2dCanvasEnabled]);
     settings.setLoadDeferringEnabled(shouldEnableLoadDeferring());
     settings.setWindowFocusRestricted(shouldRestrictWindowFocus());