Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 GraphicsLayerUpdateSubtree, | 61 GraphicsLayerUpdateSubtree, |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // CompositedLayerMapping keeps track of how Layers of the layout tree correspon d to | 64 // CompositedLayerMapping keeps track of how Layers of the layout tree correspon d to |
| 65 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer Mapping | 65 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer Mapping |
| 66 // manages a small cluster of GraphicsLayers and the references to which Layers | 66 // manages a small cluster of GraphicsLayers and the references to which Layers |
| 67 // and paint phases contribute to each GraphicsLayer. | 67 // and paint phases contribute to each GraphicsLayer. |
| 68 // | 68 // |
| 69 // Currently (Oct. 2013) there is one CompositedLayerMapping for each Layer, | 69 // Currently (Oct. 2013) there is one CompositedLayerMapping for each Layer, |
| 70 // but this is likely to evolve soon. | 70 // but this is likely to evolve soon. |
| 71 class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { | 71 class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient, pub lic DisplayItemClient { |
|
pdr.
2015/12/05 21:39:19
If the plan is to move invalidation bits and rects
Xianzhu
2015/12/07 17:14:00
Yes. Done.
Perhaps we can also have a CacheableDi
| |
| 72 | 72 |
| 73 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); USING_FAST_MALLOC(CompositedLa yerMapping); | 73 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); USING_FAST_MALLOC(CompositedLa yerMapping); |
| 74 public: | 74 public: |
| 75 explicit CompositedLayerMapping(PaintLayer&); | 75 explicit CompositedLayerMapping(PaintLayer&); |
| 76 ~CompositedLayerMapping() override; | 76 ~CompositedLayerMapping() override; |
| 77 | 77 |
| 78 PaintLayer& owningLayer() const { return m_owningLayer; } | 78 PaintLayer& owningLayer() const { return m_owningLayer; } |
| 79 | 79 |
| 80 bool updateGraphicsLayerConfiguration(); | 80 bool updateGraphicsLayerConfiguration(); |
| 81 void updateGraphicsLayerGeometry(const PaintLayer* compositingContainer, con st PaintLayer* compositingStackingContext, Vector<PaintLayer*>& layersNeedingPai ntInvalidation); | 81 void updateGraphicsLayerGeometry(const PaintLayer* compositingContainer, con st PaintLayer* compositingStackingContext, Vector<PaintLayer*>& layersNeedingPai ntInvalidation); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); } | 120 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); } |
| 121 | 121 |
| 122 void setSquashingContentsNeedDisplay(); | 122 void setSquashingContentsNeedDisplay(); |
| 123 void setContentsNeedDisplay(); | 123 void setContentsNeedDisplay(); |
| 124 // LayoutRect is in the coordinate space of the layer's layout object. | 124 // LayoutRect is in the coordinate space of the layer's layout object. |
| 125 void setContentsNeedDisplayInRect(const LayoutRect&, PaintInvalidationReason ); | 125 void setContentsNeedDisplayInRect(const LayoutRect&, PaintInvalidationReason ); |
| 126 | 126 |
| 127 // If |visualRect| is not nullptr, it contains all pixels that might be pain ted by the display item client, | 127 // If |visualRect| is not nullptr, it contains all pixels that might be pain ted by the display item client, |
| 128 // in coordinate space of the layer's layout object. | 128 // in coordinate space of the layer's layout object. |
| 129 // |visualRect| can be nullptr if we know it's unchanged and PaintController has cached the previous value. | 129 // |visualRect| can be nullptr if we know it's unchanged and PaintController has cached the previous value. |
| 130 void invalidateDisplayItemClient(const DisplayItemClientWrapper&, PaintInval idationReason, const LayoutRect* visualRect); | 130 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation Reason, const LayoutRect* visualRect); |
| 131 void invalidateDisplayItemClientOnScrollingContentsLayer(const DisplayItemCl ientWrapper&, PaintInvalidationReason, const LayoutRect* visualRect); | 131 void invalidateDisplayItemClientOnScrollingContentsLayer(const DisplayItemCl ient&, PaintInvalidationReason, const LayoutRect* visualRect); |
| 132 | 132 |
| 133 // Notification from the layoutObject that its content changed. | 133 // Notification from the layoutObject that its content changed. |
| 134 void contentChanged(ContentChangeType); | 134 void contentChanged(ContentChangeType); |
| 135 | 135 |
| 136 LayoutRect compositedBounds() const { return m_compositedBounds; } | 136 LayoutRect compositedBounds() const { return m_compositedBounds; } |
| 137 IntRect pixelSnappedCompositedBounds() const; | 137 IntRect pixelSnappedCompositedBounds() const; |
| 138 | 138 |
| 139 void positionOverflowControlsLayers(); | 139 void positionOverflowControlsLayers(); |
| 140 | 140 |
| 141 // Returns true if the assignment actually changed the assigned squashing la yer. | 141 // Returns true if the assignment actually changed the assigned squashing la yer. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 LayoutPoint squashingOffsetFromTransformedAncestor() | 205 LayoutPoint squashingOffsetFromTransformedAncestor() |
| 206 { | 206 { |
| 207 return m_squashingLayerOffsetFromTransformedAncestor; | 207 return m_squashingLayerOffsetFromTransformedAncestor; |
| 208 } | 208 } |
| 209 | 209 |
| 210 // If there is a squashed layer painting into this CLM that is an ancestor o f the given LayoutObject, return it. Otherwise return nullptr. | 210 // If there is a squashed layer painting into this CLM that is an ancestor o f the given LayoutObject, return it. Otherwise return nullptr. |
| 211 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u nsigned maxSquashedLayerIndex); | 211 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u nsigned maxSquashedLayerIndex); |
| 212 | 212 |
| 213 void updateScrollingBlockSelection(); | 213 void updateScrollingBlockSelection(); |
| 214 | 214 |
| 215 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } | 215 String debugName() const override { return "CompositedLayerMapping for " + o wningLayer().debugName(); } |
| 216 String debugName() const { return "CompositedLayerMapping for " + owningLaye r().debugName(); } | |
| 217 | 216 |
| 218 private: | 217 private: |
| 219 IntRect recomputeInterestRect(const GraphicsLayer*) const; | 218 IntRect recomputeInterestRect(const GraphicsLayer*) const; |
| 220 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere stRect, const IntRect& newInterestRect, const IntSize& layerSize); | 219 static bool interestRectChangedEnoughToRepaint(const IntRect& previousIntere stRect, const IntRect& newInterestRect, const IntSize& layerSize); |
| 221 | 220 |
| 222 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex); | 221 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex); |
| 223 | 222 |
| 224 // Helper methods to updateGraphicsLayerGeometry: | 223 // Helper methods to updateGraphicsLayerGeometry: |
| 225 void computeGraphicsLayerParentLocation(const PaintLayer* compositingContain er, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLocat ion); | 224 void computeGraphicsLayerParentLocation(const PaintLayer* compositingContain er, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLocat ion); |
| 226 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const PaintLayer& referenceL ayer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offse tFromTransformedAncestor, Vector<PaintLayer*>& layersNeedingPaintInvalidation); | 225 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const PaintLayer& referenceL ayer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offse tFromTransformedAncestor, Vector<PaintLayer*>& layersNeedingPaintInvalidation); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 | 442 |
| 444 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; | 443 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; |
| 445 unsigned m_scrollingContentsAreEmpty : 1; | 444 unsigned m_scrollingContentsAreEmpty : 1; |
| 446 | 445 |
| 447 friend class CompositedLayerMappingTest; | 446 friend class CompositedLayerMappingTest; |
| 448 }; | 447 }; |
| 449 | 448 |
| 450 } // namespace blink | 449 } // namespace blink |
| 451 | 450 |
| 452 #endif // CompositedLayerMapping_h | 451 #endif // CompositedLayerMapping_h |
| OLD | NEW |