Changeset 140475 in webkit


Ignore:
Timestamp:
Jan 22, 2013, 3:03:28 PM (13 years ago)
Author:
Simon Fraser
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.

  1. 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):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140473 r140475  
     12013-01-22  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix scrollperf logging
     4        https://bugs.webkit.org/show_bug.cgi?id=107589
     5
     6        Reviewed by Tim Horton.
     7
     8        The scrollperf logging had two issues:
     9
     10        1. It relied on a paint logging a "filled" event, but it's possible
     11        for existing tiles to be moved into the viewport and filling it, so
     12        we need to log from the scrolling thread both when we have unfilled pixels,
     13        and when the last scroll revealed unfilled pixels.
     14       
     15        2. On some pages, z-index:-1 elements behind the body cause the root
     16        TileCache to have drawsContent set to false, so none of its tiles paint. In
     17        that case, the check for a non-zero paintCount in TileCache::blankPixelCountForTiles()
     18        was wrong; we don't think there's a way to have an unpainted tile in the tree.
     19       
     20        Also fix the signature of blankPixelCountForTiles() to take references.
     21
     22        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
     23        (ScrollingTreeScrollingNodeMac):
     24        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
     25        (WebCore::ScrollingTreeScrollingNodeMac::ScrollingTreeScrollingNodeMac):
     26        (WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea):
     27        * platform/graphics/ca/mac/TileCache.h:
     28        * platform/graphics/ca/mac/TileCache.mm:
     29        (WebCore::TileCache::blankPixelCountForTiles):
     30
    1312013-01-22  Eric Seidel  <eric@webkit.org>
    232
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.h

    r140223 r140475  
    8383    RetainPtr<CALayer> m_counterScrollingLayer;
    8484    IntPoint m_probableMainThreadScrollPosition;
     85    bool m_lastScrollHadUnfilledPixels;
    8586};
    8687
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm

    r140223 r140475  
    5454    : ScrollingTreeScrollingNode(scrollingTree)
    5555    , m_scrollElasticityController(this)
     56    , m_lastScrollHadUnfilledPixels(false)
    5657{
    5758}
     
    357358    unsigned unfilledArea = TileCache::blankPixelCountForTiles(tiles, viewportRect(), IntPoint(-scrollPosition.x(), -scrollPosition.y()));
    358359
    359     if (unfilledArea)
     360    if (unfilledArea || m_lastScrollHadUnfilledPixels)
    360361        WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), unfilledArea);
     362
     363    m_lastScrollHadUnfilledPixels = unfilledArea;
    361364}
    362365
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h

    r139822 r140475  
    8080
    8181    unsigned blankPixelCount() const;
    82     static unsigned blankPixelCountForTiles(const WebTileLayerList&, IntRect, IntPoint);
     82    static unsigned blankPixelCountForTiles(const WebTileLayerList&, const IntRect&, const IntPoint&);
    8383
    8484    // Only public for the WebTileCacheMapLayer.
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm

    r139822 r140475  
    489489}
    490490
    491 unsigned TileCache::blankPixelCountForTiles(const WebTileLayerList& tiles, IntRect visibleRect, IntPoint tileTranslation)
     491unsigned TileCache::blankPixelCountForTiles(const WebTileLayerList& tiles, const IntRect& visibleRect, const IntPoint& tileTranslation)
    492492{
    493493    Region paintedVisibleTiles;
     
    499499        visiblePart.intersect(visibleRect);
    500500
    501         if (!visiblePart.isEmpty() && [tileLayer paintCount])
     501        if (!visiblePart.isEmpty())
    502502            paintedVisibleTiles.unite(visiblePart);
    503503    }
Note: See TracChangeset for help on using the changeset viewer.