Title: [186154] trunk/Source/WebCore
Revision
186154
Author
[email protected]
Date
2015-06-30 18:01:13 -0700 (Tue, 30 Jun 2015)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (186153 => 186154)


--- trunk/Source/WebCore/ChangeLog	2015-07-01 00:46:55 UTC (rev 186153)
+++ trunk/Source/WebCore/ChangeLog	2015-07-01 01:01:13 UTC (rev 186154)
@@ -1,3 +1,29 @@
+2015-06-30  Simon Fraser  <[email protected]>
+
+        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):
+
 2015-06-30  Dean Jackson  <[email protected]>
 
         CABackdropFilter should set windowServerAware to false

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (186153 => 186154)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2015-07-01 00:46:55 UTC (rev 186153)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2015-07-01 01:01:13 UTC (rev 186154)
@@ -494,9 +494,9 @@
     float pageScaleFactor() const { return m_client.pageScaleFactor(); }
     float deviceScaleFactor() const { return m_client.deviceScaleFactor(); }
     
-    // Whether this layer (and descendants) can detach backing store when outside the coverage area.
-    virtual void setAllowsBackingStoreDetachment(bool) { }
-    virtual bool allowsBackingStoreDetachment() const { return true; }
+    // Whether this layer is viewport constrained, implying that it's moved around externally from GraphicsLayer (e.g. by the scrolling tree).
+    virtual void setIsViewportConstrained(bool) { }
+    virtual bool isViewportConstrained() const { return false; }
 
     virtual void deviceOrPageScaleFactorChanged() { }
     WEBCORE_EXPORT void noteDeviceOrPageScaleFactorChangedIncludingDescendants();

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (186153 => 186154)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-07-01 00:46:55 UTC (rev 186153)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2015-07-01 01:01:13 UTC (rev 186154)
@@ -357,7 +357,7 @@
     : GraphicsLayer(layerType, client)
     , m_needsFullRepaint(false)
     , m_usingBackdropLayerType(false)
-    , m_allowsBackingStoreDetachment(true)
+    , m_isViewportConstrained(false)
     , m_intersectsCoverageRect(false)
 {
 }
@@ -1272,7 +1272,7 @@
     return true;
 }
 
-void GraphicsLayerCA::setVisibleAndCoverageRects(const VisibleAndCoverageRects& rects, bool allowBackingStoreDetachment)
+void GraphicsLayerCA::setVisibleAndCoverageRects(const VisibleAndCoverageRects& rects, bool isViewportConstrained)
 {
     bool visibleRectChanged = rects.visibleRect != m_visibleRect;
     bool coverageRectChanged = rects.coverageRect != m_coverageRect;
@@ -1280,7 +1280,7 @@
         return;
 
     // FIXME: we need to take reflections into account when determining whether this layer intersects the coverage rect.
-    bool intersectsCoverageRect = !allowBackingStoreDetachment || rects.coverageRect.intersects(FloatRect(m_boundsOrigin, size()));
+    bool intersectsCoverageRect = isViewportConstrained || rects.coverageRect.intersects(FloatRect(m_boundsOrigin, size()));
     if (intersectsCoverageRect != m_intersectsCoverageRect) {
         m_uncommittedChanges |= CoverageRectChanged;
         m_intersectsCoverageRect = intersectsCoverageRect;
@@ -1329,7 +1329,7 @@
             localState.setLastPlanarSecondaryQuad(&secondaryQuad);
         }
     }
-    setVisibleAndCoverageRects(rects, m_allowsBackingStoreDetachment && commitState.ancestorsAllowBackingStoreDetachment);
+    setVisibleAndCoverageRects(rects, m_isViewportConstrained || commitState.ancestorIsViewportConstrained);
 
 #ifdef VISIBLE_TILE_WASH
     // Use having a transform as a key to making the tile wash layer. If every layer gets a wash,
@@ -1373,7 +1373,7 @@
         affectedByTransformAnimation = true;
     }
     
-    childCommitState.ancestorsAllowBackingStoreDetachment &= m_allowsBackingStoreDetachment;
+    childCommitState.ancestorIsViewportConstrained |= m_isViewportConstrained;
 
     if (GraphicsLayerCA* maskLayer = downcast<GraphicsLayerCA>(m_maskLayer))
         maskLayer->commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition);
@@ -3673,12 +3673,12 @@
     }
 }
 
-void GraphicsLayerCA::setAllowsBackingStoreDetachment(bool allowDetachment)
+void GraphicsLayerCA::setIsViewportConstrained(bool isViewportConstrained)
 {
-    if (allowDetachment == m_allowsBackingStoreDetachment)
+    if (isViewportConstrained == m_isViewportConstrained)
         return;
 
-    m_allowsBackingStoreDetachment = allowDetachment;
+    m_isViewportConstrained = isViewportConstrained;
     noteLayerPropertyChanged(CoverageRectChanged);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (186153 => 186154)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2015-07-01 00:46:55 UTC (rev 186153)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2015-07-01 01:01:13 UTC (rev 186154)
@@ -151,7 +151,7 @@
     struct CommitState {
         int treeDepth { 0 };
         bool ancestorHasTransformAnimation { false };
-        bool ancestorsAllowBackingStoreDetachment { true };
+        bool ancestorIsViewportConstrained { false };
     };
     void recursiveCommitChanges(const CommitState&, const TransformState&, float pageScaleFactor = 1, const FloatPoint& positionRelativeToBase = FloatPoint(), bool affectedByPageScale = false);
 
@@ -195,8 +195,8 @@
 
     virtual bool isCommittingChanges() const override { return m_isCommittingChanges; }
 
-    WEBCORE_EXPORT virtual void setAllowsBackingStoreDetachment(bool) override;
-    virtual bool allowsBackingStoreDetachment() const override { return m_allowsBackingStoreDetachment; }
+    WEBCORE_EXPORT virtual void setIsViewportConstrained(bool) override;
+    virtual bool isViewportConstrained() const override { return m_isViewportConstrained; }
 
     WEBCORE_EXPORT virtual double backingStoreMemoryEstimate() const override;
 
@@ -294,7 +294,7 @@
     const FloatRect& visibleRect() const { return m_visibleRect; }
     const FloatRect& coverageRect() const { return m_coverageRect; }
 
-    void setVisibleAndCoverageRects(const VisibleAndCoverageRects&, bool allowBackingStoreDetachment);
+    void setVisibleAndCoverageRects(const VisibleAndCoverageRects&, bool isViewportConstrained);
     
     static FloatRect adjustTiledLayerVisibleRect(TiledBacking*, const FloatRect& oldVisibleRect, const FloatRect& newVisibleRect, const FloatSize& oldSize, const FloatSize& newSize);
 
@@ -513,7 +513,7 @@
     ContentsLayerPurpose m_contentsLayerPurpose { NoContentsLayer };
     bool m_needsFullRepaint : 1;
     bool m_usingBackdropLayerType : 1;
-    bool m_allowsBackingStoreDetachment : 1;
+    bool m_isViewportConstrained : 1;
     bool m_intersectsCoverageRect : 1;
 
     Color m_contentsSolidColor;

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (186153 => 186154)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2015-07-01 00:46:55 UTC (rev 186153)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2015-07-01 01:01:13 UTC (rev 186154)
@@ -1608,7 +1608,7 @@
 
 void RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole(bool viewportCoordinated)
 {
-    m_graphicsLayer->setAllowsBackingStoreDetachment(!viewportCoordinated);
+    m_graphicsLayer->setIsViewportConstrained(viewportCoordinated);
 }
 
 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to