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 CompositedLayerMapping final : public GraphicsLayerClient { | 71 class PLATFORM_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { |
chrishtr
2015/10/09 19:10:29
This is needed to expose the class for testing acr
| |
72 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); WTF_MAKE_FAST_ALLOCATED(Compos itedPaintLayerMapping); | 72 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); WTF_MAKE_FAST_ALLOCATED(Compos itedPaintLayerMapping); |
73 public: | 73 public: |
74 explicit CompositedLayerMapping(PaintLayer&); | 74 explicit CompositedLayerMapping(PaintLayer&); |
75 ~CompositedLayerMapping() override; | 75 ~CompositedLayerMapping() override; |
76 | 76 |
77 PaintLayer& owningLayer() const { return m_owningLayer; } | 77 PaintLayer& owningLayer() const { return m_owningLayer; } |
78 | 78 |
79 bool updateGraphicsLayerConfiguration(); | 79 bool updateGraphicsLayerConfiguration(); |
80 void updateGraphicsLayerGeometry(const PaintLayer* compositingContainer, con st PaintLayer* compositingStackingContext, Vector<PaintLayer*>& layersNeedingPai ntInvalidation); | 80 void updateGraphicsLayerGeometry(const PaintLayer* compositingContainer, con st PaintLayer* compositingStackingContext, Vector<PaintLayer*>& layersNeedingPai ntInvalidation); |
81 | 81 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 bool verifyLayerInSquashingVector(const PaintLayer*); | 140 bool verifyLayerInSquashingVector(const PaintLayer*); |
141 #endif | 141 #endif |
142 | 142 |
143 void finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex); | 143 void finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex); |
144 void updateRenderingContext(); | 144 void updateRenderingContext(); |
145 void updateShouldFlattenTransform(); | 145 void updateShouldFlattenTransform(); |
146 | 146 |
147 // GraphicsLayerClient interface | 147 // GraphicsLayerClient interface |
148 void notifyAnimationStarted(const GraphicsLayer*, double monotonicTime, int group) override; | 148 void notifyAnimationStarted(const GraphicsLayer*, double monotonicTime, int group) override; |
149 void notifyTextPainted() override; | 149 void notifyTextPainted() override; |
150 | |
150 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain tingPhase, const IntRect& clip) const override; | 151 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain tingPhase, const IntRect& clip) const override; |
152 void paintContentsIfNeeded(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase) const override; | |
151 bool isTrackingPaintInvalidations() const override; | 153 bool isTrackingPaintInvalidations() const override; |
152 | 154 |
153 #if ENABLE(ASSERT) | 155 #if ENABLE(ASSERT) |
154 void verifyNotPainting() override; | 156 void verifyNotPainting() override; |
155 #endif | 157 #endif |
156 | 158 |
157 LayoutRect contentsBox() const; | 159 LayoutRect contentsBox() const; |
158 | 160 |
159 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo ntalScrollbar.get(); } | 161 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo ntalScrollbar.get(); } |
160 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical Scrollbar.get(); } | 162 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical Scrollbar.get(); } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 | 200 |
199 // If there is a squashed layer painting into this CLM that is an ancestor o f the given LayoutObject, return it. Otherwise return nullptr. | 201 // If there is a squashed layer painting into this CLM that is an ancestor o f the given LayoutObject, return it. Otherwise return nullptr. |
200 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u nsigned maxSquashedLayerIndex); | 202 const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObject*, u nsigned maxSquashedLayerIndex); |
201 | 203 |
202 void updateScrollingBlockSelection(); | 204 void updateScrollingBlockSelection(); |
203 | 205 |
204 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } | 206 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } |
205 String debugName() const { return "CompositedLayerMapping for " + owningLaye r().debugName(); } | 207 String debugName() const { return "CompositedLayerMapping for " + owningLaye r().debugName(); } |
206 | 208 |
207 private: | 209 private: |
210 static IntRect computeInterestRect(const GraphicsLayer*, LayoutObject* ownin gLayoutObject); | |
211 | |
208 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex); | 212 static const GraphicsLayerPaintInfo* containingSquashedLayer(const LayoutObj ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn dex); |
209 | 213 |
210 // Helper methods to updateGraphicsLayerGeometry: | 214 // Helper methods to updateGraphicsLayerGeometry: |
211 void computeGraphicsLayerParentLocation(const PaintLayer* compositingContain er, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLocat ion); | 215 void computeGraphicsLayerParentLocation(const PaintLayer* compositingContain er, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLocat ion); |
212 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const PaintLayer& referenceL ayer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offse tFromTransformedAncestor, Vector<PaintLayer*>& layersNeedingPaintInvalidation); | 216 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc estor, const IntPoint& graphicsLayerParentLocation, const PaintLayer& referenceL ayer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offse tFromTransformedAncestor, Vector<PaintLayer*>& layersNeedingPaintInvalidation); |
213 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound s, const IntRect& localCompositingBounds, const IntPoint& graphicsLayerParentLoc ation); | 217 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound s, const IntRect& localCompositingBounds, const IntPoint& graphicsLayerParentLoc ation); |
214 void updateAncestorClippingLayerGeometry(const PaintLayer* compositingContai ner, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLaye rParentLocation); | 218 void updateAncestorClippingLayerGeometry(const PaintLayer* compositingContai ner, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLaye rParentLocation); |
215 void updateOverflowControlsHostLayerGeometry(const PaintLayer* compositingSt ackingContext, const PaintLayer* compositingContainer); | 219 void updateOverflowControlsHostLayerGeometry(const PaintLayer* compositingSt ackingContext, const PaintLayer* compositingContainer); |
216 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I ntRect& localCompositingBounds); | 220 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I ntRect& localCompositingBounds); |
217 void updateChildTransformLayerGeometry(); | 221 void updateChildTransformLayerGeometry(); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
421 LayoutRect m_compositedBounds; | 425 LayoutRect m_compositedBounds; |
422 | 426 |
423 LayoutSize m_contentOffsetInCompositingLayer; | 427 LayoutSize m_contentOffsetInCompositingLayer; |
424 unsigned m_contentOffsetInCompositingLayerDirty : 1; | 428 unsigned m_contentOffsetInCompositingLayerDirty : 1; |
425 | 429 |
426 unsigned m_pendingUpdateScope : 2; | 430 unsigned m_pendingUpdateScope : 2; |
427 unsigned m_isMainFrameLayoutViewLayer : 1; | 431 unsigned m_isMainFrameLayoutViewLayer : 1; |
428 | 432 |
429 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; | 433 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; |
430 unsigned m_scrollingContentsAreEmpty : 1; | 434 unsigned m_scrollingContentsAreEmpty : 1; |
435 | |
436 friend class CompositedLayerMappingTest; | |
431 }; | 437 }; |
432 | 438 |
433 } // namespace blink | 439 } // namespace blink |
434 | 440 |
435 #endif // CompositedLayerMapping_h | 441 #endif // CompositedLayerMapping_h |
OLD | NEW |