Title: [140475] trunk/Source/WebCore
Revision
140475
Author
simon.fra...@apple.com
Date
2013-01-22 15:03:28 -0800 (Tue, 22 Jan 2013)

Log Message

Fix scrollperf logging
https://bugs.webkit.org/show_bug.cgi?id=107589

Reviewed by Tim Horton.

The scrollperf logging had two issues:

1. It relied on a paint logging a "filled" event, but it's possible
for existing tiles to be moved into the viewport and filling it, so
we need to log from the scrolling thread both when we have unfilled pixels,
and when the last scroll revealed unfilled pixels.

2. On some pages, z-index:-1 elements behind the body cause the root
TileCache to have drawsContent set to false, so none of its tiles paint. In
that case, the check for a non-zero paintCount in TileCache::blankPixelCountForTiles()
was wrong; we don't think there's a way to have an unpainted tile in the tree.

Also fix the signature of blankPixelCountForTiles() to take references.

* page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
(ScrollingTreeScrollingNodeMac):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::ScrollingTreeScrollingNodeMac):
(WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea):
* platform/graphics/ca/mac/TileCache.h:
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::blankPixelCountForTiles):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140474 => 140475)


--- trunk/Source/WebCore/ChangeLog	2013-01-22 22:46:49 UTC (rev 140474)
+++ trunk/Source/WebCore/ChangeLog	2013-01-22 23:03:28 UTC (rev 140475)
@@ -1,3 +1,33 @@
+2013-01-22  Simon Fraser  <simon.fra...@apple.com>
+
+        Fix scrollperf logging
+        https://bugs.webkit.org/show_bug.cgi?id=107589
+
+        Reviewed by Tim Horton.
+
+        The scrollperf logging had two issues:
+
+        1. It relied on a paint logging a "filled" event, but it's possible
+        for existing tiles to be moved into the viewport and filling it, so
+        we need to log from the scrolling thread both when we have unfilled pixels,
+        and when the last scroll revealed unfilled pixels.
+        
+        2. On some pages, z-index:-1 elements behind the body cause the root
+        TileCache to have drawsContent set to false, so none of its tiles paint. In
+        that case, the check for a non-zero paintCount in TileCache::blankPixelCountForTiles()
+        was wrong; we don't think there's a way to have an unpainted tile in the tree.
+        
+        Also fix the signature of blankPixelCountForTiles() to take references.
+
+        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
+        (ScrollingTreeScrollingNodeMac):
+        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeScrollingNodeMac::ScrollingTreeScrollingNodeMac):
+        (WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea):
+        * platform/graphics/ca/mac/TileCache.h:
+        * platform/graphics/ca/mac/TileCache.mm:
+        (WebCore::TileCache::blankPixelCountForTiles):
+
 2013-01-22  Eric Seidel  <e...@webkit.org>
 
         Make CompactHTMLToken a little more compact

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h (140474 => 140475)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h	2013-01-22 22:46:49 UTC (rev 140474)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h	2013-01-22 23:03:28 UTC (rev 140475)
@@ -82,6 +82,7 @@
     RetainPtr<CALayer> m_scrollLayer;
     RetainPtr<CALayer> m_counterScrollingLayer;
     IntPoint m_probableMainThreadScrollPosition;
+    bool m_lastScrollHadUnfilledPixels;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm (140474 => 140475)


--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm	2013-01-22 22:46:49 UTC (rev 140474)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm	2013-01-22 23:03:28 UTC (rev 140475)
@@ -53,6 +53,7 @@
 ScrollingTreeScrollingNodeMac::ScrollingTreeScrollingNodeMac(ScrollingTree* scrollingTree)
     : ScrollingTreeScrollingNode(scrollingTree)
     , m_scrollElasticityController(this)
+    , m_lastScrollHadUnfilledPixels(false)
 {
 }
 
@@ -356,8 +357,10 @@
     IntPoint scrollPosition = this->scrollPosition();
     unsigned unfilledArea = TileCache::blankPixelCountForTiles(tiles, viewportRect(), IntPoint(-scrollPosition.x(), -scrollPosition.y()));
 
-    if (unfilledArea)
+    if (unfilledArea || m_lastScrollHadUnfilledPixels)
         WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), unfilledArea);
+
+    m_lastScrollHadUnfilledPixels = unfilledArea;
 }
 
 static void logThreadedScrollingMode(unsigned mainThreadScrollingReasons)

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h (140474 => 140475)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2013-01-22 22:46:49 UTC (rev 140474)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h	2013-01-22 23:03:28 UTC (rev 140475)
@@ -79,7 +79,7 @@
     virtual IntRect visibleRect() const OVERRIDE { return m_visibleRect; }
 
     unsigned blankPixelCount() const;
-    static unsigned blankPixelCountForTiles(const WebTileLayerList&, IntRect, IntPoint);
+    static unsigned blankPixelCountForTiles(const WebTileLayerList&, const IntRect&, const IntPoint&);
 
     // Only public for the WebTileCacheMapLayer.
     void drawTileMapContents(CGContextRef, CGRect);

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm (140474 => 140475)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2013-01-22 22:46:49 UTC (rev 140474)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm	2013-01-22 23:03:28 UTC (rev 140475)
@@ -488,7 +488,7 @@
     return blankPixelCountForTiles(tiles, m_visibleRect, IntPoint(0,0));
 }
 
-unsigned TileCache::blankPixelCountForTiles(const WebTileLayerList& tiles, IntRect visibleRect, IntPoint tileTranslation)
+unsigned TileCache::blankPixelCountForTiles(const WebTileLayerList& tiles, const IntRect& visibleRect, const IntPoint& tileTranslation)
 {
     Region paintedVisibleTiles;
 
@@ -498,7 +498,7 @@
         IntRect visiblePart(CGRectOffset([tileLayer frame], tileTranslation.x(), tileTranslation.y()));
         visiblePart.intersect(visibleRect);
 
-        if (!visiblePart.isEmpty() && [tileLayer paintCount])
+        if (!visiblePart.isEmpty())
             paintedVisibleTiles.unite(visiblePart);
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to