OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 bool allocateOrClearCompositedLayerMapping(RenderLayer*); | 225 bool allocateOrClearCompositedLayerMapping(RenderLayer*); |
226 | 226 |
227 void clearMappingForRenderLayerIncludingDescendants(RenderLayer*); | 227 void clearMappingForRenderLayerIncludingDescendants(RenderLayer*); |
228 | 228 |
229 // Repaint the given rect (which is layer's coords), and regions of child la
yers that intersect that rect. | 229 // Repaint the given rect (which is layer's coords), and regions of child la
yers that intersect that rect. |
230 void recursiveRepaintLayer(RenderLayer*, const IntRect* = 0); | 230 void recursiveRepaintLayer(RenderLayer*, const IntRect* = 0); |
231 | 231 |
232 void addToOverlapMap(OverlapMap&, RenderLayer*, IntRect& layerBounds, bool&
boundsComputed); | 232 void addToOverlapMap(OverlapMap&, RenderLayer*, IntRect& layerBounds, bool&
boundsComputed); |
233 void addToOverlapMapRecursive(OverlapMap&, RenderLayer*, RenderLayer* ancest
orLayer = 0); | 233 void addToOverlapMapRecursive(OverlapMap&, RenderLayer*, RenderLayer* ancest
orLayer = 0); |
234 | 234 |
| 235 struct SquashingState { |
| 236 SquashingState() |
| 237 : mostRecentMapping(0) |
| 238 , hasMostRecentMapping(false) |
| 239 , nextSquashedLayerIndex(0) { } |
| 240 |
| 241 void updateSquashingStateForNewMapping(CompositedLayerMappingPtr, bool h
asNewCompositedLayerMapping, IntPoint newOffsetFromAbsolute); |
| 242 |
| 243 // The most recent composited backing that the layer should squash onto
if needed. |
| 244 CompositedLayerMappingPtr mostRecentMapping; |
| 245 bool hasMostRecentMapping; |
| 246 |
| 247 // Offset in absolute coordinates of the compositedLayerMapping's owning
layer. |
| 248 IntPoint offsetFromAbsolute; |
| 249 |
| 250 // Counter that tracks what index the next RenderLayer would be if it ge
ts squashed to the current squashing layer. |
| 251 size_t nextSquashedLayerIndex; |
| 252 }; |
| 253 |
235 // Forces an update for all frames of frame tree recursively. Used only when
the mainFrame compositor is ready to | 254 // Forces an update for all frames of frame tree recursively. Used only when
the mainFrame compositor is ready to |
236 // finish all deferred work. | 255 // finish all deferred work. |
237 static void finishCompositingUpdateForFrameTree(Frame*); | 256 static void finishCompositingUpdateForFrameTree(Frame*); |
238 | 257 |
239 // Returns true if any layer's compositing changed | 258 // Returns true if any layer's compositing changed |
240 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*
, OverlapMap*, struct CompositingRecursionData&, bool& descendantHas3DTransform,
Vector<RenderLayer*>& unclippedDescendants); | 259 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*
, OverlapMap*, struct CompositingRecursionData&, bool& descendantHas3DTransform,
Vector<RenderLayer*>& unclippedDescendants); |
241 | 260 |
242 // Defines which RenderLayers will paint into which composited backings, by
allocating and destroying CompositedLayerMappings as needed. | 261 // Defines which RenderLayers will paint into which composited backings, by
allocating and destroying CompositedLayerMappings as needed. |
243 void assignLayersToBackings(RenderLayer*, bool& layersChanged); | 262 void assignLayersToBackings(RenderLayer*, bool& layersChanged); |
| 263 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& lay
ersChanged); |
244 | 264 |
245 // Recurses down the tree, parenting descendant compositing layers and colle
cting an array of child layers for the current compositing layer. | 265 // Recurses down the tree, parenting descendant compositing layers and colle
cting an array of child layers for the current compositing layer. |
246 void rebuildCompositingLayerTree(RenderLayer*, Vector<GraphicsLayer*>& child
GraphicsLayersOfEnclosingLayer, int depth); | 266 void rebuildCompositingLayerTree(RenderLayer*, Vector<GraphicsLayer*>& child
GraphicsLayersOfEnclosingLayer, int depth); |
247 | 267 |
248 // Recurses down the tree, updating layer geometry only. | 268 // Recurses down the tree, updating layer geometry only. |
249 void updateLayerTreeGeometry(RenderLayer*); | 269 void updateLayerTreeGeometry(RenderLayer*); |
250 | 270 |
251 // Hook compositing layers together | 271 // Hook compositing layers together |
252 void setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
; | 272 void setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
; |
253 void removeCompositedChildren(RenderLayer*); | 273 void removeCompositedChildren(RenderLayer*); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 367 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
348 #if USE(RUBBER_BANDING) | 368 #if USE(RUBBER_BANDING) |
349 OwnPtr<GraphicsLayer> m_layerForOverhangShadow; | 369 OwnPtr<GraphicsLayer> m_layerForOverhangShadow; |
350 #endif | 370 #endif |
351 }; | 371 }; |
352 | 372 |
353 | 373 |
354 } // namespace WebCore | 374 } // namespace WebCore |
355 | 375 |
356 #endif // RenderLayerCompositor_h | 376 #endif // RenderLayerCompositor_h |
OLD | NEW |