Changeset 148707 in webkit


Ignore:
Timestamp:
Apr 18, 2013 3:29:31 PM (11 years ago)
Author:
Simon Fraser
Message:

Remove GraphicsLayerCA::constrainedSize() now that we can manage large layer memory use ourselves in TileController
https://bugs.webkit.org/show_bug.cgi?id=114834

Reviewed by Tim Horton.

GraphicsLayerCA::constrainedSize() was added to handle poor CATiledLayer behavior when layer sizes
got extremely large. Now that we no longer use CATiledLayer, remove this code. We can later add
tile memory bounding to TileController if that becomes necessary.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::updateGeometry):

  • platform/graphics/ca/GraphicsLayerCA.h:

(GraphicsLayerCA):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148701 r148707  
     12013-04-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Remove GraphicsLayerCA::constrainedSize() now that we can manage large layer memory use ourselves in TileController
     4        https://bugs.webkit.org/show_bug.cgi?id=114834
     5
     6        Reviewed by Tim Horton.
     7
     8        GraphicsLayerCA::constrainedSize() was added to handle poor CATiledLayer behavior when layer sizes
     9        got extremely large. Now that we no longer use CATiledLayer, remove this code. We can later add
     10        tile memory bounding to TileController if that becomes necessary.
     11
     12        * platform/graphics/ca/GraphicsLayerCA.cpp:
     13        (WebCore::GraphicsLayerCA::updateGeometry):
     14        * platform/graphics/ca/GraphicsLayerCA.h:
     15        (GraphicsLayerCA):
     16
    1172013-04-18  Alberto Garcia  <agarcia@igalia.com>
    218
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r148651 r148707  
    13061306    computePixelAlignment(pageScaleFactor, positionRelativeToBase, scaledPosition, scaledSize, scaledAnchorPoint, pixelAlignmentOffset);
    13071307
    1308     FloatSize usedSize = m_usingTiledBacking ? constrainedSize() : scaledSize;
    1309     FloatRect adjustedBounds(m_boundsOrigin - pixelAlignmentOffset, usedSize);
     1308    FloatRect adjustedBounds(m_boundsOrigin - pixelAlignmentOffset, scaledSize);
    13101309
    13111310    // Update position.
    13121311    // Position is offset on the layer by the layer anchor point.
    1313     FloatPoint adjustedPosition(scaledPosition.x() + scaledAnchorPoint.x() * usedSize.width(), scaledPosition.y() + scaledAnchorPoint.y() * usedSize.height());
     1312    FloatPoint adjustedPosition(scaledPosition.x() + scaledAnchorPoint.x() * scaledSize.width(), scaledPosition.y() + scaledAnchorPoint.y() * scaledSize.height());
    13141313
    13151314    if (m_structuralLayer) {
     
    13411340        // If we have a structural layer, we just use 0.5, 0.5 for the anchor point of the main layer.
    13421341        scaledAnchorPoint = FloatPoint(0.5f, 0.5f);
    1343         adjustedPosition = FloatPoint(scaledAnchorPoint.x() * usedSize.width() - pixelAlignmentOffset.width(), scaledAnchorPoint.y() * usedSize.height() - pixelAlignmentOffset.height());
     1342        adjustedPosition = FloatPoint(scaledAnchorPoint.x() * scaledSize.width() - pixelAlignmentOffset.width(), scaledAnchorPoint.y() * scaledSize.height() - pixelAlignmentOffset.height());
    13441343    }
    13451344   
     
    26502649}
    26512650
    2652 FloatSize GraphicsLayerCA::constrainedSize() const
    2653 {
    2654     FloatSize constrainedSize = m_size;
    2655 #if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
    2656     float tileColumns = ceilf(m_size.width() / kTiledLayerTileSize);
    2657     float tileRows = ceilf(m_size.height() / kTiledLayerTileSize);
    2658     double numTiles = tileColumns * tileRows;
    2659    
    2660     const unsigned cMaxTileCount = 512;
    2661     while (numTiles > cMaxTileCount) {
    2662         // Constrain the wider dimension.
    2663         if (constrainedSize.width() >= constrainedSize.height()) {
    2664             tileColumns = max(floorf(cMaxTileCount / tileRows), 1.0f);
    2665             constrainedSize.setWidth(tileColumns * kTiledLayerTileSize);
    2666         } else {
    2667             tileRows = max(floorf(cMaxTileCount / tileColumns), 1.0f);
    2668             constrainedSize.setHeight(tileRows * kTiledLayerTileSize);
    2669         }
    2670         numTiles = tileColumns * tileRows;
    2671     }
    2672 #endif
    2673     return constrainedSize;
    2674 }
    2675 
    26762651bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const
    26772652{
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r148651 r148707  
    228228
    229229    FloatPoint computePositionRelativeToBase(float& pageScale) const;
    230 
    231     FloatSize constrainedSize() const;
    232230
    233231    bool requiresTiledLayer(float pageScaleFactor) const;
Note: See TracChangeset for help on using the changeset viewer.