[ThreadedCompositor] position:fixed elements do not have their own layers when thread...
authorchangseok.oh@collabora.com <changseok.oh@collabora.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Feb 2016 05:39:57 +0000 (05:39 +0000)
committerchangseok.oh@collabora.com <changseok.oh@collabora.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Feb 2016 05:39:57 +0000 (05:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154100

Reviewed by Carlos Garcia Campos.

Currently, fixed elements are redrawn to a backing store every time layout or scroll happens.
It results in the bad effect on performance-wise. Letting fixed element have separate layers is
necessary when threaded compositor is enabled at least. Because async scrolling requires it.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::updatePreferences):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp

index 8cad599..0cfa444 100644 (file)
@@ -1,3 +1,17 @@
+2016-02-15  ChangSeok Oh  <changseok.oh@collabora.com>
+
+        [ThreadedCompositor] position:fixed elements do not have their own layers when threaded compositor is enabled.
+        https://bugs.webkit.org/show_bug.cgi?id=154100
+
+        Reviewed by Carlos Garcia Campos.
+
+        Currently, fixed elements are redrawn to a backing store every time layout or scroll happens.
+        It results in the bad effect on performance-wise. Letting fixed element have separate layers is
+        necessary when threaded compositor is enabled at least. Because async scrolling requires it.
+
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::updatePreferences):
+
 2016-02-15  Alex Christensen  <achristensen@webkit.org>
 
         Implement content sniffing check with NetworkSession
index 093a502..5e5857b 100644 (file)
@@ -248,7 +248,15 @@ void DrawingAreaImpl::mainFrameContentSizeChanged(const WebCore::IntSize& newSiz
 
 void DrawingAreaImpl::updatePreferences(const WebPreferencesStore& store)
 {
-    m_webPage.corePage()->settings().setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()));
+    Settings& settings = m_webPage.corePage()->settings();
+    settings.setForceCompositingMode(store.getBoolValueForKey(WebPreferencesKey::forceCompositingModeKey()));
+
+#if USE(COORDINATED_GRAPHICS_THREADED)
+    // Fixed position elements need to be composited and create stacking contexts
+    // in order to be scrolled by the ScrollingCoordinator.
+    settings.setAcceleratedCompositingForFixedPositionEnabled(true);
+    settings.setFixedPositionCreatesStackingContext(true);
+#endif
 }
 
 void DrawingAreaImpl::layerHostDidFlushLayers()