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