Changeset 106385 in webkit


Ignore:
Timestamp:
Jan 31, 2012 1:31:17 PM (12 years ago)
Author:
andersca@apple.com
Message:

Inform the tile cache whenever the visible rect changes
https://bugs.webkit.org/show_bug.cgi?id=77470

Reviewed by Andreas Kling.

  • platform/graphics/GraphicsLayer.h:

(WebCore::GraphicsLayer::visibleRectChanged):
Add empty function.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::visibleRectChanged):
Call through to the PlatformCALayer.

  • platform/graphics/ca/mac/PlatformCALayerMac.mm:

(PlatformCALayer::visibleRectChanged):
Call through to the underlying WebTileCacheLayer.

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

(WebCore::TileCache::visibleRectChanged):
Add empty stub.

(WebCore::TileCache::visibleRect):
Add new (currently unused) helper function that returns the visible rect of the
tile cache layer.

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

(-[WebTileCacheLayer visibleRectChanged]):
Call through to the TielCache object.

  • platform/graphics/ca/win/PlatformCALayerWin.cpp:

(PlatformCALayer::visibleRectChanged):
Add stub.

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::frameViewDidScroll):
Call GraphicsLayer::visibleRectChanged.

Location:
trunk/Source/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106384 r106385  
     12012-01-31  Anders Carlsson  <andersca@apple.com>
     2
     3        Inform the tile cache whenever the visible rect changes
     4        https://bugs.webkit.org/show_bug.cgi?id=77470
     5
     6        Reviewed by Andreas Kling.
     7
     8        * platform/graphics/GraphicsLayer.h:
     9        (WebCore::GraphicsLayer::visibleRectChanged):
     10        Add empty function.
     11
     12        * platform/graphics/ca/GraphicsLayerCA.cpp:
     13        (WebCore::GraphicsLayerCA::visibleRectChanged):
     14        Call through to the PlatformCALayer.
     15
     16        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
     17        (PlatformCALayer::visibleRectChanged):
     18        Call through to the underlying WebTileCacheLayer.
     19
     20        * platform/graphics/ca/mac/TileCache.mm:
     21        (WebCore::TileCache::visibleRectChanged):
     22        Add empty stub.
     23
     24        (WebCore::TileCache::visibleRect):
     25        Add new (currently unused) helper function that returns the visible rect of the
     26        tile cache layer.
     27
     28        * platform/graphics/ca/mac/WebTileCacheLayer.h:
     29        * platform/graphics/ca/mac/WebTileCacheLayer.mm:
     30        (-[WebTileCacheLayer visibleRectChanged]):
     31        Call through to the TielCache object.
     32
     33        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
     34        (PlatformCALayer::visibleRectChanged):
     35        Add stub.
     36
     37        * rendering/RenderLayerCompositor.cpp:
     38        (WebCore::RenderLayerCompositor::frameViewDidScroll):
     39        Call GraphicsLayer::visibleRectChanged.
     40
    1412012-01-31  Antti Koivisto  <antti@apple.com>
    242
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r106190 r106385  
    409409    bool usingTiledLayer() const { return m_usingTiledLayer; }
    410410
     411    // Called whenever the visible rect of the given GraphicsLayer changed.
     412    virtual void visibleRectChanged() { }
     413
    411414#if PLATFORM(QT) || PLATFORM(GTK)
    412415    // This allows several alternative GraphicsLayer implementations in the same port,
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r106190 r106385  
    844844}
    845845
     846void GraphicsLayerCA::visibleRectChanged()
     847{
     848    m_layer->visibleRectChanged();
     849}
     850
    846851void GraphicsLayerCA::recursiveCommitChanges(const TransformState& state, float pageScaleFactor, const FloatPoint& positionRelativeToBase, bool affectedByPageScale)
    847852{
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r106190 r106385  
    134134    virtual void syncCompositingState(const FloatRect&);
    135135    virtual void syncCompositingStateForThisLayerOnly();
     136
     137    virtual void visibleRectChanged() OVERRIDE;
    136138
    137139    bool allowTiledLayer() const { return m_allowTiledLayer; }
  • trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h

    r103148 r106385  
    204204    void setContentsScale(float);
    205205
     206    void visibleRectChanged();
     207
    206208#if PLATFORM(WIN)
    207209    HashMap<String, RefPtr<PlatformCAAnimation> >& animations() { return m_animations; }
  • trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm

    r105576 r106385  
    957957}
    958958
     959void PlatformCALayer::visibleRectChanged()
     960{
     961    if (m_layerType != LayerTypeTileCacheLayer)
     962        return;
     963
     964    WebTileCacheLayer *tileCacheLayer = static_cast<WebTileCacheLayer *>(m_layer.get());
     965    [tileCacheLayer visibleRectChanged];
     966}
     967
    959968#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    960969void PlatformCALayer::synchronouslyDisplayTilesInRect(const FloatRect& rect)
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.h

    r106311 r106385  
    3838namespace WebCore {
    3939
     40class FloatRect;
    4041class IntPoint;
    4142class IntRect;
     
    5758
    5859    CALayer *tileContainerLayer() const { return m_tileContainerLayer.get(); }
     60    void visibleRectChanged();
    5961
    6062    float tileDebugBorderWidth() const { return m_tileDebugBorderWidth; }
     
    6668private:
    6769    TileCache(WebTileCacheLayer*, const IntSize& tileSize);
     70
     71    FloatRect visibleRect() const;
    6872
    6973    IntRect bounds() const;
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileCache.mm

    r106311 r106385  
    166166}
    167167
     168void TileCache::visibleRectChanged()
     169{
     170    // FIXME: Implement.
     171}
     172
    168173void TileCache::setTileDebugBorderWidth(float borderWidth)
    169174{
     
    184189    for (WebTileLayer* tileLayer in [m_tileContainerLayer.get() sublayers])
    185190        [tileLayer setBorderColor:m_tileDebugBorderColor.get()];
     191}
     192
     193FloatRect TileCache::visibleRect() const
     194{
     195    CGRect rect = [m_tileCacheLayer bounds];
     196
     197    CALayer *layer = m_tileCacheLayer;
     198    CALayer *superlayer = [layer superlayer];
     199
     200    while (superlayer) {
     201        CGRect rectInSuperlayerCoordinates = [superlayer convertRect:rect fromLayer:layer];
     202
     203        if ([superlayer masksToBounds])
     204            rect = CGRectIntersection([superlayer bounds], rectInSuperlayerCoordinates);
     205        else
     206            rect = rectInSuperlayerCoordinates;
     207
     208        layer = superlayer;
     209        superlayer = [layer superlayer];
     210    }
     211
     212    return [m_tileCacheLayer convertRect:rect fromLayer:layer];
    186213}
    187214
  • trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.h

    r106304 r106385  
    3636
    3737- (CALayer *)tileContainerLayer;
     38- (void)visibleRectChanged;
    3839
    3940@end
  • trunk/Source/WebCore/platform/graphics/ca/mac/WebTileCacheLayer.mm

    r106304 r106385  
    7878}
    7979
     80- (void)visibleRectChanged
     81{
     82    _tileCache->visibleRectChanged();
     83}
     84
    8085- (CGColorRef)borderColor
    8186{
  • trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp

    r95901 r106385  
    621621}
    622622
     623void PlatformCALayer::visibleRectChanged()
     624{
     625}
     626
    623627#ifndef NDEBUG
    624628static void printIndent(int indent)
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r106319 r106385  
    985985    LayoutPoint scrollPosition = frameView->scrollPosition();
    986986
     987    if (RenderLayerBacking* backing = rootRenderLayer()->backing())
     988        backing->graphicsLayer()->visibleRectChanged();
     989
    987990    if (m_scrollLayer)
    988991        m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
Note: See TracChangeset for help on using the changeset viewer.