Title: [115752] trunk/Source/WebCore
Revision
115752
Author
ander...@apple.com
Date
2012-05-01 15:22:25 -0700 (Tue, 01 May 2012)

Log Message

Slow scrolling on www.sholby.net
https://bugs.webkit.org/show_bug.cgi?id=85304
<rdar://problem/11138952>

Reviewed by Beth Dakin.

Fix two performance issues that showed up on the profiles.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
Reset the relevant painted object counter; it's only interesting when loading.

* page/Page.cpp:
(WebCore::Page::startCountingRelevantRepaintedObjects):
Set m_isCountingRelevantRepaintedObjects to true after calling reset, since reset now sets it to false.

(WebCore::Page::resetRelevantPaintedObjectCounter):
Set m_isCountingRelevantRepaintedObjects to false.

(WebCore::Page::addRelevantRepaintedObject):
Use HashSet::find to avoid an extra hash lookup.

* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):
Remove the call to FrameView::updateCompositingLayersAfterLayout now, since FrameView::notifyScrollPositionChanged
already calls this and was making us to a lot of work twice.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115751 => 115752)


--- trunk/Source/WebCore/ChangeLog	2012-05-01 22:03:49 UTC (rev 115751)
+++ trunk/Source/WebCore/ChangeLog	2012-05-01 22:22:25 UTC (rev 115752)
@@ -1,3 +1,32 @@
+2012-05-01  Anders Carlsson  <ander...@apple.com>
+
+        Slow scrolling on www.sholby.net
+        https://bugs.webkit.org/show_bug.cgi?id=85304
+        <rdar://problem/11138952>
+
+        Reviewed by Beth Dakin.
+
+        Fix two performance issues that showed up on the profiles.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+        Reset the relevant painted object counter; it's only interesting when loading.
+
+        * page/Page.cpp:
+        (WebCore::Page::startCountingRelevantRepaintedObjects):
+        Set m_isCountingRelevantRepaintedObjects to true after calling reset, since reset now sets it to false.
+
+        (WebCore::Page::resetRelevantPaintedObjectCounter):
+        Set m_isCountingRelevantRepaintedObjects to false.
+
+        (WebCore::Page::addRelevantRepaintedObject):
+        Use HashSet::find to avoid an extra hash lookup.
+
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::updateMainFrameScrollPositionAndScrollLayerPosition):
+        Remove the call to FrameView::updateCompositingLayersAfterLayout now, since FrameView::notifyScrollPositionChanged
+        already calls this and was making us to a lot of work twice.
+
 2012-05-01  Silvia Pfeiffer  <silvi...@chromium.org>
 
         Audio controls have a 1px surplus outline coming from RenderImage::paintReplaced base class,

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (115751 => 115752)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2012-05-01 22:03:49 UTC (rev 115751)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2012-05-01 22:22:25 UTC (rev 115752)
@@ -2102,9 +2102,13 @@
             if (m_stateMachine.creatingInitialEmptyDocument() || !m_stateMachine.committedFirstRealDocumentLoad())
                 return;
 
-            if (Page* page = m_frame->page())
+            if (Page* page = m_frame->page()) {
                 page->progress()->progressCompleted(m_frame);
 
+                if (m_frame == page->mainFrame())
+                    page->resetRelevantPaintedObjectCounter();
+            }
+
             const ResourceError& error = dl->mainDocumentError();
 
             AXObjectCache::AXLoadingEvent loadingEvent;

Modified: trunk/Source/WebCore/page/Page.cpp (115751 => 115752)


--- trunk/Source/WebCore/page/Page.cpp	2012-05-01 22:03:49 UTC (rev 115751)
+++ trunk/Source/WebCore/page/Page.cpp	2012-05-01 22:22:25 UTC (rev 115752)
@@ -1039,14 +1039,15 @@
 
 void Page::startCountingRelevantRepaintedObjects()
 {
-    m_isCountingRelevantRepaintedObjects = true;
-
     // Reset everything in case we didn't hit the threshold last time.
     resetRelevantPaintedObjectCounter();
+
+    m_isCountingRelevantRepaintedObjects = true;
 }
 
 void Page::resetRelevantPaintedObjectCounter()
 {
+    m_isCountingRelevantRepaintedObjects = false;
     m_relevantUnpaintedRenderObjects.clear();
     m_relevantPaintedRegion = Region();
     m_relevantUnpaintedRegion = Region();
@@ -1067,8 +1068,9 @@
 
     // If this object was previously counted as an unpainted object, remove it from that HashSet
     // and corresponding Region. FIXME: This doesn't do the right thing if the objects overlap.
-    if (m_relevantUnpaintedRenderObjects.contains(object)) {
-        m_relevantUnpaintedRenderObjects.remove(object);
+    HashSet<RenderObject*>::iterator it = m_relevantUnpaintedRenderObjects.find(object);
+    if (it != m_relevantUnpaintedRenderObjects.end()) {
+        m_relevantUnpaintedRenderObjects.remove(it);
         m_relevantUnpaintedRegion.subtract(snappedPaintRect);
     }
 

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (115751 => 115752)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-05-01 22:03:49 UTC (rev 115751)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2012-05-01 22:22:25 UTC (rev 115752)
@@ -286,9 +286,6 @@
 
     IntPoint scrollPosition = m_scrollingTree->mainFrameScrollPosition();
 
-    // Make sure to update the main frame scroll position before changing the scroll layer position,
-    // otherwise we'll introduce jittering on pages with slow repaint objects (like background-attachment: fixed).
-    frameView->updateCompositingLayersAfterLayout();
     frameView->setConstrainsScrollingToContentEdge(false);
     frameView->notifyScrollPositionChanged(scrollPosition);
     frameView->setConstrainsScrollingToContentEdge(true);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to