Changeset 136774 in webkit


Ignore:
Timestamp:
Dec 5, 2012, 4:07:02 PM (13 years ago)
Author:
Simon Fraser
Message:

Fix some repaint/paintCounter confusion, and reset it when getting layers out of the layer pool
https://bugs.webkit.org/show_bug.cgi?id=104180

Reviewed by Tim Horton.

Layers retrieved from the LayerPool by TileCache need to have their
repaint counters reset, otherwise the scroll performance logging gets
confused.

Also, the counter counts paints, not repaints (invalidations), so
rename it accordingly.

  • page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:

(WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea): Whitespace fix.

  • platform/graphics/GraphicsLayer.h:
  • platform/graphics/ca/mac/TileCache.mm:

(WebCore::TileCache::blankPixelCountForTiles):
(WebCore::TileCache::createTileLayer):
(WebCore::TileCache::drawRepaintCounter):

  • platform/graphics/ca/mac/WebTileLayer.h:
  • platform/graphics/ca/mac/WebTileLayer.mm:

(-[WebTileLayer resetPaintCount]):
(-[WebTileLayer incrementPaintCount]):
(-[WebTileLayer paintCount]):
(-[WebTileLayer logFilledFreshTile]):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r136773 r136774  
     12012-12-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix some repaint/paintCounter confusion, and reset it when getting layers out of the layer pool
     4        https://bugs.webkit.org/show_bug.cgi?id=104180
     5
     6        Reviewed by Tim Horton.
     7
     8        Layers retrieved from the LayerPool by TileCache need to have their
     9        repaint counters reset, otherwise the scroll performance logging gets
     10        confused.
     11       
     12        Also, the counter counts paints, not repaints (invalidations), so
     13        rename it accordingly.
     14
     15        * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
     16        (WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea): Whitespace fix.
     17        * platform/graphics/GraphicsLayer.h:
     18        * platform/graphics/ca/mac/TileCache.mm:
     19        (WebCore::TileCache::blankPixelCountForTiles):
     20        (WebCore::TileCache::createTileLayer):
     21        (WebCore::TileCache::drawRepaintCounter):
     22        * platform/graphics/ca/mac/WebTileLayer.h:
     23        * platform/graphics/ca/mac/WebTileLayer.mm:
     24        (-[WebTileLayer resetPaintCount]):
     25        (-[WebTileLayer incrementPaintCount]):
     26        (-[WebTileLayer paintCount]):
     27        (-[WebTileLayer logFilledFreshTile]):
     28
    1292012-12-05  Oliver Hunt  <oliver@apple.com>
    230
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm

    r134169 r136774  
    331331    WebTileLayerList tiles;
    332332
    333     while(!layerQueue.isEmpty() && tiles.isEmpty()) {
     333    while (!layerQueue.isEmpty() && tiles.isEmpty()) {
    334334        CALayer* layer = layerQueue.takeFirst();
    335335        NSArray* sublayers = [[layer sublayers] copy];
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r134628 r136774  
    373373    bool isShowingRepaintCounter() const { return m_showRepaintCounter; }
    374374
     375    // FIXME: this is really a paint count.
    375376    int repaintCount() const { return m_repaintCount; }
    376377    int incrementRepaintCount() { return ++m_repaintCount; }
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm

    r136594 r136774  
    411411        visiblePart.intersect(visibleRect);
    412412
    413         if (!visiblePart.isEmpty() && [tileLayer repaintCount])
     413        if (!visiblePart.isEmpty() && [tileLayer paintCount])
    414414            paintedVisibleTiles.unite(visiblePart);
    415415    }
     
    602602        // If we were able to restore a layer from the LayerPool, we should call setNeedsDisplay to
    603603        // ensure we avoid stale content.
     604        [layer resetPaintCount];
    604605        [layer setNeedsDisplay];
    605606    } else
     
    640641void TileCache::drawRepaintCounter(WebTileLayer *layer, CGContextRef context)
    641642{
    642     unsigned repaintCount = [layer incrementRepaintCount];
     643    unsigned paintCount = [layer incrementPaintCount];
    643644    if (!shouldShowRepaintCounters())
    644645        return;
     
    646647    // FIXME: Some of this code could be shared with WebLayer.
    647648    char text[16]; // that's a lot of repaints
    648     snprintf(text, sizeof(text), "%d", repaintCount);
     649    snprintf(text, sizeof(text), "%d", paintCount);
    649650
    650651    CGRect indicatorBox = [layer bounds];
  • trunk/Source/WebCore/platform/graphics/ca/mac/WebTileLayer.h

    r125156 r136774  
    3333@interface WebTileLayer : CALayer {
    3434    WebCore::TileCache* _tileCache;
    35     unsigned _repaintCount;
     35    unsigned _paintCount;
    3636}
    3737
    3838- (void)setTileCache:(WebCore::TileCache*)tileCache;
    39 - (unsigned)incrementRepaintCount;
    40 - (unsigned)repaintCount;
     39- (void)resetPaintCount;
     40- (unsigned)incrementPaintCount;
     41- (unsigned)paintCount;
    4142@end
    4243
  • trunk/Source/WebCore/platform/graphics/ca/mac/WebTileLayer.mm

    r130224 r136774  
    6262}
    6363
    64 - (unsigned)incrementRepaintCount
     64- (void)resetPaintCount
    6565{
    66     return ++_repaintCount;
     66    _paintCount = 0;
    6767}
    6868
    69 - (unsigned)repaintCount
     69- (unsigned)incrementPaintCount
    7070{
    71     return _repaintCount;
     71    return ++_paintCount;
     72}
     73
     74- (unsigned)paintCount
     75{
     76    return _paintCount;
    7277}
    7378
     
    7782    visiblePart.intersect(_tileCache->visibleRect());
    7883
    79     if ([self repaintCount] == 1 && !visiblePart.isEmpty())
     84    if ([self paintCount] == 1 && !visiblePart.isEmpty())
    8085        WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), _tileCache->blankPixelCount());
    8186}
Note: See TracChangeset for help on using the changeset viewer.