Changeset 186154 in webkit


Ignore:
Timestamp:
Jun 30, 2015, 6:01:13 PM (10 years ago)
Author:
Simon Fraser
Message:

Rename GraphicsLayer's allowsBackingStoreDetachment to isViewportConstrained
https://bugs.webkit.org/show_bug.cgi?id=146483

Reviewed by Tim Horton.

What GraphicsLayer really needs to know is whether some other thread/process
is moving its platform layers around behind its back, and this is is better
expressed as "isViewportConstrained" rather than "allowsBackingStoreDetachment".

The sense of the flag is flipped, and boolean logic adjusted accordingly.

  • platform/graphics/GraphicsLayer.h:

(WebCore::GraphicsLayer::setIsViewportConstrained):
(WebCore::GraphicsLayer::isViewportConstrained):
(WebCore::GraphicsLayer::setAllowsBackingStoreDetachment): Deleted.
(WebCore::GraphicsLayer::allowsBackingStoreDetachment): Deleted.

  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):

  • platform/graphics/ca/GraphicsLayerCA.h:
  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r186139 r186154  
     12015-06-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Rename GraphicsLayer's allowsBackingStoreDetachment to isViewportConstrained
     4        https://bugs.webkit.org/show_bug.cgi?id=146483
     5
     6        Reviewed by Tim Horton.
     7
     8        What GraphicsLayer really needs to know is whether some other thread/process
     9        is moving its platform layers around behind its back, and this is is better
     10        expressed as "isViewportConstrained" rather than "allowsBackingStoreDetachment".
     11       
     12        The sense of the flag is flipped, and boolean logic adjusted accordingly.
     13
     14        * platform/graphics/GraphicsLayer.h:
     15        (WebCore::GraphicsLayer::setIsViewportConstrained):
     16        (WebCore::GraphicsLayer::isViewportConstrained):
     17        (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment): Deleted.
     18        (WebCore::GraphicsLayer::allowsBackingStoreDetachment): Deleted.
     19        * platform/graphics/ca/GraphicsLayerCA.cpp:
     20        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
     21        (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
     22        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
     23        * platform/graphics/ca/GraphicsLayerCA.h:
     24        * rendering/RenderLayerBacking.cpp:
     25        (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
     26
    1272015-06-30  Dean Jackson  <dino@apple.com>
    228
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r185124 r186154  
    495495    float deviceScaleFactor() const { return m_client.deviceScaleFactor(); }
    496496   
    497     // Whether this layer (and descendants) can detach backing store when outside the coverage area.
    498     virtual void setAllowsBackingStoreDetachment(bool) { }
    499     virtual bool allowsBackingStoreDetachment() const { return true; }
     497    // Whether this layer is viewport constrained, implying that it's moved around externally from GraphicsLayer (e.g. by the scrolling tree).
     498    virtual void setIsViewportConstrained(bool) { }
     499    virtual bool isViewportConstrained() const { return false; }
    500500
    501501    virtual void deviceOrPageScaleFactorChanged() { }
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r186003 r186154  
    358358    , m_needsFullRepaint(false)
    359359    , m_usingBackdropLayerType(false)
    360     , m_allowsBackingStoreDetachment(true)
     360    , m_isViewportConstrained(false)
    361361    , m_intersectsCoverageRect(false)
    362362{
     
    12731273}
    12741274
    1275 void GraphicsLayerCA::setVisibleAndCoverageRects(const VisibleAndCoverageRects& rects, bool allowBackingStoreDetachment)
     1275void GraphicsLayerCA::setVisibleAndCoverageRects(const VisibleAndCoverageRects& rects, bool isViewportConstrained)
    12761276{
    12771277    bool visibleRectChanged = rects.visibleRect != m_visibleRect;
     
    12811281
    12821282    // FIXME: we need to take reflections into account when determining whether this layer intersects the coverage rect.
    1283     bool intersectsCoverageRect = !allowBackingStoreDetachment || rects.coverageRect.intersects(FloatRect(m_boundsOrigin, size()));
     1283    bool intersectsCoverageRect = isViewportConstrained || rects.coverageRect.intersects(FloatRect(m_boundsOrigin, size()));
    12841284    if (intersectsCoverageRect != m_intersectsCoverageRect) {
    12851285        m_uncommittedChanges |= CoverageRectChanged;
     
    13301330        }
    13311331    }
    1332     setVisibleAndCoverageRects(rects, m_allowsBackingStoreDetachment && commitState.ancestorsAllowBackingStoreDetachment);
     1332    setVisibleAndCoverageRects(rects, m_isViewportConstrained || commitState.ancestorIsViewportConstrained);
    13331333
    13341334#ifdef VISIBLE_TILE_WASH
     
    13741374    }
    13751375   
    1376     childCommitState.ancestorsAllowBackingStoreDetachment &= m_allowsBackingStoreDetachment;
     1376    childCommitState.ancestorIsViewportConstrained |= m_isViewportConstrained;
    13771377
    13781378    if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer))
     
    36743674}
    36753675
    3676 void GraphicsLayerCA::setAllowsBackingStoreDetachment(bool allowDetachment)
    3677 {
    3678     if (allowDetachment == m_allowsBackingStoreDetachment)
    3679         return;
    3680 
    3681     m_allowsBackingStoreDetachment = allowDetachment;
     3676void GraphicsLayerCA::setIsViewportConstrained(bool isViewportConstrained)
     3677{
     3678    if (isViewportConstrained == m_isViewportConstrained)
     3679        return;
     3680
     3681    m_isViewportConstrained = isViewportConstrained;
    36823682    noteLayerPropertyChanged(CoverageRectChanged);
    36833683}
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r185124 r186154  
    152152        int treeDepth { 0 };
    153153        bool ancestorHasTransformAnimation { false };
    154         bool ancestorsAllowBackingStoreDetachment { true };
     154        bool ancestorIsViewportConstrained { false };
    155155    };
    156156    void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
     
    196196    virtual bool isCommittingChanges() const override { return m_isCommittingChanges; }
    197197
    198     WEBCORE_EXPORT virtual void setAllowsBackingStoreDetachment(bool) override;
    199     virtual bool allowsBackingStoreDetachment() const override { return m_allowsBackingStoreDetachment; }
     198    WEBCORE_EXPORT virtual void setIsViewportConstrained(bool) override;
     199    virtual bool isViewportConstrained() const override { return m_isViewportConstrained; }
    200200
    201201    WEBCORE_EXPORT virtual double backingStoreMemoryEstimate() const override;
     
    295295    const FloatRect& coverageRect() const { return m_coverageRect; }
    296296
    297     void setVisibleAndCoverageRects(const VisibleAndCoverageRects&, bool allowBackingStoreDetachment);
     297    void setVisibleAndCoverageRects(const VisibleAndCoverageRects&, bool isViewportConstrained);
    298298   
    299299    static FloatRect adjustTiledLayerVisibleRect(TiledBacking*, const FloatRect& oldVisibleRect, const FloatRect& newVisibleRect, const FloatSize& oldSize, const FloatSize& newSize);
     
    514514    bool m_needsFullRepaint : 1;
    515515    bool m_usingBackdropLayerType : 1;
    516     bool m_allowsBackingStoreDetachment : 1;
     516    bool m_isViewportConstrained : 1;
    517517    bool m_intersectsCoverageRect : 1;
    518518
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r185851 r186154  
    16091609void RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole(bool viewportCoordinated)
    16101610{
    1611     m_graphicsLayer->setAllowsBackingStoreDetachment(!viewportCoordinated);
     1611    m_graphicsLayer->setIsViewportConstrained(viewportCoordinated);
    16121612}
    16131613
Note: See TracChangeset for help on using the changeset viewer.