Title: [103007] trunk/Source/WebCore
Revision
103007
Author
[email protected]
Date
2011-12-15 17:50:47 -0800 (Thu, 15 Dec 2011)

Log Message

Lazily create the scrolling coordinator and add a setting for enabling it
https://bugs.webkit.org/show_bug.cgi?id=74667

Reviewed by Darin Adler.

* WebCore.xcodeproj/project.pbxproj:
Make ScrollingCoordinator.h a private header so it can be used in WebKit.
* page/Page.cpp:
(WebCore::Page::Page):
Don't create the scrolling coordinator.

(WebCore::Page::~Page):
Check for a null scrolling coordinator.

(WebCore::Page::scrollingCoordinator):
Create the scrolling coordinator lazily.

* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setScrollingCoordinatorEnabled):
(WebCore::Settings::scrollingCoordinatorEnabled):
Add a setting for enabling the scrolling coordinator.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
Use a tile cache layer for the main frame when the scrolling coordinator is neabled.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (103006 => 103007)


--- trunk/Source/WebCore/ChangeLog	2011-12-16 01:33:56 UTC (rev 103006)
+++ trunk/Source/WebCore/ChangeLog	2011-12-16 01:50:47 UTC (rev 103007)
@@ -1,3 +1,33 @@
+2011-12-15  Anders Carlsson  <[email protected]>
+
+        Lazily create the scrolling coordinator and add a setting for enabling it
+        https://bugs.webkit.org/show_bug.cgi?id=74667
+
+        Reviewed by Darin Adler.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Make ScrollingCoordinator.h a private header so it can be used in WebKit.
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        Don't create the scrolling coordinator.
+
+        (WebCore::Page::~Page):
+        Check for a null scrolling coordinator.
+
+        (WebCore::Page::scrollingCoordinator):
+        Create the scrolling coordinator lazily.
+
+        * page/Settings.cpp:
+        (WebCore::Settings::Settings):
+        * page/Settings.h:
+        (WebCore::Settings::setScrollingCoordinatorEnabled):
+        (WebCore::Settings::scrollingCoordinatorEnabled):
+        Add a setting for enabling the scrolling coordinator.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::RenderLayerBacking):
+        Use a tile cache layer for the main frame when the scrolling coordinator is neabled.
+
 2011-12-15  Gyuyoung Kim  <[email protected]>
 
         Unreviewed. Fix build break when data-transfer-items is enabled.

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (103006 => 103007)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-12-16 01:33:56 UTC (rev 103006)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-12-16 01:50:47 UTC (rev 103007)
@@ -373,7 +373,7 @@
 		1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2E6E580CC55213004A2062 /* SQLValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A2E6E7A0CC556D5004A2062 /* SQLiteAuthorizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */; };
 		1A2F9D7914968C740065AC63 /* ScrollingCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2F9D7714968C740065AC63 /* ScrollingCoordinator.cpp */; };
-		1A2F9D7A14968C740065AC63 /* ScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2F9D7814968C740065AC63 /* ScrollingCoordinator.h */; };
+		1A2F9D7A14968C740065AC63 /* ScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2F9D7814968C740065AC63 /* ScrollingCoordinator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1A3417C90CECFF250049CBDE /* JSCustomVoidCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3417C70CECFF250049CBDE /* JSCustomVoidCallback.h */; };
 		1A3417CA0CECFF250049CBDE /* JSCustomVoidCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3417C80CECFF250049CBDE /* JSCustomVoidCallback.cpp */; };
 		1A494BFA0A122F4400FDAFC1 /* JSHTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */; };

Modified: trunk/Source/WebCore/page/Page.cpp (103006 => 103007)


--- trunk/Source/WebCore/page/Page.cpp	2011-12-16 01:33:56 UTC (rev 103006)
+++ trunk/Source/WebCore/page/Page.cpp	2011-12-16 01:50:47 UTC (rev 103007)
@@ -152,9 +152,6 @@
 #if ENABLE(MEDIA_STREAM)
     , m_userMediaClient(pageClients.userMediaClient)
 #endif
-#if ENABLE(THREADED_SCROLLING)
-    , m_scrollingCoordinator(ScrollingCoordinator::create(this))
-#endif
     , m_settings(adoptPtr(new Settings(this)))
     , m_progress(adoptPtr(new ProgressTracker))
     , m_backForwardController(adoptPtr(new BackForwardController(this, pageClients.backForwardClient)))
@@ -227,7 +224,8 @@
 #endif
 
 #if ENABLE(THREADED_SCROLLING)
-    m_scrollingCoordinator->pageDestroyed();
+    if (m_scrollingCoordinator)
+        m_scrollingCoordinator->pageDestroyed();
 #endif
 
     backForward()->close();
@@ -237,6 +235,16 @@
 #endif
 }
 
+#if ENABLE(THREADED_SCROLLING)
+ScrollingCoordinator* Page::scrollingCoordinator()
+{
+    if (!m_scrollingCoordinator && m_settings->scrollingCoordinatorEnabled())
+        m_scrollingCoordinator = ScrollingCoordinator::create(this);
+
+    return m_scrollingCoordinator.get();
+}
+#endif
+
 struct ViewModeInfo {
     const char* name;
     Page::ViewMode type;

Modified: trunk/Source/WebCore/page/Page.h (103006 => 103007)


--- trunk/Source/WebCore/page/Page.h	2011-12-16 01:33:56 UTC (rev 103006)
+++ trunk/Source/WebCore/page/Page.h	2011-12-16 01:50:47 UTC (rev 103007)
@@ -197,8 +197,9 @@
         UserMediaClient* userMediaClient() const { return m_userMediaClient; }
 #endif
 #if ENABLE(THREADED_SCROLLING)
-        ScrollingCoordinator* scrollingCoordinator() const { return m_scrollingCoordinator.get(); }
+        ScrollingCoordinator* scrollingCoordinator();
 #endif
+
         Settings* settings() const { return m_settings.get(); }
         ProgressTracker* progress() const { return m_progress.get(); }
         BackForwardController* backForward() const { return m_backForwardController.get(); }

Modified: trunk/Source/WebCore/page/Settings.cpp (103006 => 103007)


--- trunk/Source/WebCore/page/Settings.cpp	2011-12-16 01:33:56 UTC (rev 103006)
+++ trunk/Source/WebCore/page/Settings.cpp	2011-12-16 01:50:47 UTC (rev 103007)
@@ -234,6 +234,9 @@
 #endif
     , m_perTileDrawingEnabled(false)
     , m_partialSwapEnabled(false)
+#if ENABLE(THREADED_SCROLLING)
+    , m_scrollingCoordinatorEnabled(false)
+#endif
     , m_loadsImagesAutomaticallyTimer(this, &Settings::loadsImagesAutomaticallyTimerFired)
 {
     // A Frame may not have been created yet, so we initialize the AtomicString 

Modified: trunk/Source/WebCore/page/Settings.h (103006 => 103007)


--- trunk/Source/WebCore/page/Settings.h	2011-12-16 01:33:56 UTC (rev 103006)
+++ trunk/Source/WebCore/page/Settings.h	2011-12-16 01:50:47 UTC (rev 103007)
@@ -509,6 +509,11 @@
         void setPartialSwapEnabled(bool enabled) { m_partialSwapEnabled = enabled; }
         bool partialSwapEnabled() const { return m_partialSwapEnabled; }
 
+#if ENABLE(THREADED_SCROLLING)
+        void setScrollingCoordinatorEnabled(bool enabled) { m_scrollingCoordinatorEnabled = enabled; }
+        bool scrollingCoordinatorEnabled() const { return m_scrollingCoordinatorEnabled; }
+#endif
+
     private:
         Page* m_page;
 
@@ -645,6 +650,10 @@
         bool m_perTileDrawingEnabled : 1;
         bool m_partialSwapEnabled : 1;
 
+#if ENABLE(THREADED_SCROLLING)
+        bool m_scrollingCoordinatorEnabled : 1;
+#endif
+
         Timer<Settings> m_loadsImagesAutomaticallyTimer;
         void loadsImagesAutomaticallyTimerFired(Timer<Settings>*);
 

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (103006 => 103007)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2011-12-16 01:33:56 UTC (rev 103006)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2011-12-16 01:50:47 UTC (rev 103007)
@@ -91,12 +91,17 @@
     if (renderer()->isRenderView()) {
         Frame* frame = toRenderView(renderer())->frameView()->frame();
         Page* page = frame ? frame->page() : 0;
-        if (page && frame && page->mainFrame() == frame)
+        if (page && frame && page->mainFrame() == frame) {
             m_isMainFrameRenderViewLayer = true;
+
+#if ENABLE(THREADED_SCROLLING)
+            // FIXME: It's a little weird that we base this decision on whether there's a scrolling coordinator or not.
+            if (page->scrollingCoordinator())
+                m_usingTiledCacheLayer = true;
+#endif
+        }
     }
     
-    m_usingTiledCacheLayer = false; // FIXME: At some point this will test m_isMainFrameRenderViewLayer and check a Setting.
-
     createPrimaryGraphicsLayer();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to