[WinCairo][WK1] Accelerated Compositing can't be disabled by using WebPreferences...
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2019 08:20:48 +0000 (08:20 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2019 08:20:48 +0000 (08:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=201749

Reviewed by Don Olmstead.

WebPreferences::acceleratedCompositingEnabled always returned TRUE
for !USE(CA). It should reflect the pref value set by
setAcceleratedCompositingEnabled.

* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings): Set kCFBooleanTrue to WebKitAcceleratedCompositingEnabledPreferenceKey even for !USE(CG).
(WebPreferences::acceleratedCompositingEnabled): Return the pref value for !USE(CA).

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

Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebPreferences.cpp

index 3141a83..10e8603 100644 (file)
@@ -1,3 +1,18 @@
+2019-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [WinCairo][WK1] Accelerated Compositing can't be disabled by using WebPreferences::setAcceleratedCompositingEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=201749
+
+        Reviewed by Don Olmstead.
+
+        WebPreferences::acceleratedCompositingEnabled always returned TRUE
+        for !USE(CA). It should reflect the pref value set by
+        setAcceleratedCompositingEnabled.
+
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings): Set kCFBooleanTrue to WebKitAcceleratedCompositingEnabledPreferenceKey even for !USE(CG).
+        (WebPreferences::acceleratedCompositingEnabled): Return the pref value for !USE(CA).
+
 2019-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         [Win][WK1] Invert Colors inverts a part of the viewport in high DPI
index 8ce6288..349672e 100644 (file)
@@ -286,11 +286,7 @@ void WebPreferences::initializeDefaultSettings()
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitUseHighResolutionTimersPreferenceKey), kCFBooleanTrue);
 
-#if USE(CG)
     CFDictionaryAddValue(defaults, CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey), kCFBooleanTrue);
-#else
-    CFDictionaryAddValue(defaults, CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey), kCFBooleanFalse);
-#endif
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitShowDebugBordersPreferenceKey), kCFBooleanFalse);
 
@@ -1740,12 +1736,10 @@ HRESULT WebPreferences::acceleratedCompositingEnabled(_Out_ BOOL* enabled)
 {
     if (!enabled)
         return E_POINTER;
+    *enabled = boolValueForKey(WebKitAcceleratedCompositingEnabledPreferenceKey);
 #if USE(CA)
-    *enabled = CACFLayerTreeHost::acceleratedCompositingAvailable() && boolValueForKey(WebKitAcceleratedCompositingEnabledPreferenceKey);
-#else
-    *enabled = TRUE;
+    *enabled = *enabled && CACFLayerTreeHost::acceleratedCompositingAvailable();
 #endif
-
     return S_OK;
 }