| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // RenderLayerCompositor manages the hierarchy of | 55 // RenderLayerCompositor manages the hierarchy of |
| 56 // composited RenderLayers. It determines which RenderLayers | 56 // composited RenderLayers. It determines which RenderLayers |
| 57 // become compositing, and creates and maintains a hierarchy of | 57 // become compositing, and creates and maintains a hierarchy of |
| 58 // GraphicsLayers based on the RenderLayer painting order. | 58 // GraphicsLayers based on the RenderLayer painting order. |
| 59 // | 59 // |
| 60 // There is one RenderLayerCompositor per RenderView. | 60 // There is one RenderLayerCompositor per RenderView. |
| 61 | 61 |
| 62 class RenderLayerCompositor FINAL : public GraphicsLayerClient { | 62 class RenderLayerCompositor FINAL : public GraphicsLayerClient { |
| 63 WTF_MAKE_FAST_ALLOCATED; | 63 WTF_MAKE_FAST_ALLOCATED; |
| 64 public: | 64 public: |
| 65 enum BoundsUpdateType { |
| 66 DoNotForceUpdate, |
| 67 ForceUpdate, |
| 68 }; |
| 69 |
| 65 // FIXME: This constructor should take a reference. | 70 // FIXME: This constructor should take a reference. |
| 66 explicit RenderLayerCompositor(RenderView&); | 71 explicit RenderLayerCompositor(RenderView&); |
| 67 virtual ~RenderLayerCompositor(); | 72 virtual ~RenderLayerCompositor(); |
| 68 | 73 |
| 69 // Return true if this RenderView is in "compositing mode" (i.e. has one or
more | 74 // Return true if this RenderView is in "compositing mode" (i.e. has one or
more |
| 70 // composited RenderLayers) | 75 // composited RenderLayers) |
| 71 bool inCompositingMode() const { return m_compositing; } | 76 bool inCompositingMode() const { return m_compositing; } |
| 72 // This will make a compositing layer at the root automatically, and hook up
to | 77 // This will make a compositing layer at the root automatically, and hook up
to |
| 73 // the native view/window system. | 78 // the native view/window system. |
| 74 void enableCompositingMode(bool enable = true); | 79 void enableCompositingMode(bool enable = true); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 CompositingReasons subtreeReasonsForCompositing(RenderObject*, bool hasCompo
sitedDescendants, bool has3DTransformedDescendants) const; | 270 CompositingReasons subtreeReasonsForCompositing(RenderObject*, bool hasCompo
sitedDescendants, bool has3DTransformedDescendants) const; |
| 266 | 271 |
| 267 // Make or destroy the CompositedLayerMapping for this layer; returns true i
f the compositedLayerMapping changed. | 272 // Make or destroy the CompositedLayerMapping for this layer; returns true i
f the compositedLayerMapping changed. |
| 268 bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTra
nsitionType compositedLayerUpdate); | 273 bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTra
nsitionType compositedLayerUpdate); |
| 269 bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta
teTransitionType compositedLayerUpdate); | 274 bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta
teTransitionType compositedLayerUpdate); |
| 270 | 275 |
| 271 void clearMappingForRenderLayerIncludingDescendants(RenderLayer*); | 276 void clearMappingForRenderLayerIncludingDescendants(RenderLayer*); |
| 272 | 277 |
| 273 void recursiveRepaintLayer(RenderLayer*); | 278 void recursiveRepaintLayer(RenderLayer*); |
| 274 | 279 |
| 275 void addToOverlapMap(OverlapMap&, RenderLayer*, IntRect& layerBounds); | 280 void addToOverlapMap(OverlapMap&, RenderLayer*, const IntRect& layerBounds); |
| 276 | 281 |
| 277 // Forces an update for all frames of frame tree recursively. Used only when
the mainFrame compositor is ready to | 282 // Forces an update for all frames of frame tree recursively. Used only when
the mainFrame compositor is ready to |
| 278 // finish all deferred work. | 283 // finish all deferred work. |
| 279 static void finishCompositingUpdateForFrameTree(LocalFrame*); | 284 static void finishCompositingUpdateForFrameTree(LocalFrame*); |
| 280 | 285 |
| 281 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*
, OverlapMap*, struct CompositingRecursionData&, bool& descendantHas3DTransform,
Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingB
ox); | 286 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*
, OverlapMap*, struct CompositingRecursionData&, bool& descendantHas3DTransform,
Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingB
ox); |
| 282 | 287 |
| 283 // Defines which RenderLayers will paint into which composited backings, by
allocating and destroying CompositedLayerMappings as needed. | 288 // Defines which RenderLayers will paint into which composited backings, by
allocating and destroying CompositedLayerMappings as needed. |
| 284 void assignLayersToBackings(RenderLayer*, bool& layersChanged); | 289 void assignLayersToBackings(RenderLayer*, bool& layersChanged); |
| 285 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& lay
ersChanged, RenderLayer* clippingAncestor); | 290 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& lay
ersChanged, RenderLayer* clippingAncestor); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 CompositingReasonFinder m_compositingReasonFinder; | 347 CompositingReasonFinder m_compositingReasonFinder; |
| 343 | 348 |
| 344 bool m_hasAcceleratedCompositing; | 349 bool m_hasAcceleratedCompositing; |
| 345 bool m_showRepaintCounter; | 350 bool m_showRepaintCounter; |
| 346 | 351 |
| 347 // FIXME: This should absolutely not be mutable. | 352 // FIXME: This should absolutely not be mutable. |
| 348 mutable bool m_needsToRecomputeCompositingRequirements; | 353 mutable bool m_needsToRecomputeCompositingRequirements; |
| 349 bool m_needsToUpdateLayerTreeGeometry; | 354 bool m_needsToUpdateLayerTreeGeometry; |
| 350 GraphicsLayerUpdater::UpdateType m_pendingUpdateType; | 355 GraphicsLayerUpdater::UpdateType m_pendingUpdateType; |
| 351 | 356 |
| 357 RenderLayerCompositor::BoundsUpdateType m_recomputeLayerBoundsUpdateType; |
| 358 |
| 352 bool m_compositing; | 359 bool m_compositing; |
| 353 bool m_compositingLayersNeedRebuild; | 360 bool m_compositingLayersNeedRebuild; |
| 354 bool m_forceCompositingMode; | 361 bool m_forceCompositingMode; |
| 355 bool m_needsUpdateCompositingRequirementsState; | 362 bool m_needsUpdateCompositingRequirementsState; |
| 356 | 363 |
| 357 bool m_isTrackingRepaints; // Used for testing. | 364 bool m_isTrackingRepaints; // Used for testing. |
| 358 | 365 |
| 359 RootLayerAttachment m_rootLayerAttachment; | 366 RootLayerAttachment m_rootLayerAttachment; |
| 360 | 367 |
| 361 // Enclosing container layer, which clips for iframe content | 368 // Enclosing container layer, which clips for iframe content |
| (...skipping 16 matching lines...) Expand all Loading... |
| 378 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 385 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 379 #if USE(RUBBER_BANDING) | 386 #if USE(RUBBER_BANDING) |
| 380 OwnPtr<GraphicsLayer> m_layerForOverhangShadow; | 387 OwnPtr<GraphicsLayer> m_layerForOverhangShadow; |
| 381 #endif | 388 #endif |
| 382 }; | 389 }; |
| 383 | 390 |
| 384 | 391 |
| 385 } // namespace WebCore | 392 } // namespace WebCore |
| 386 | 393 |
| 387 #endif // RenderLayerCompositor_h | 394 #endif // RenderLayerCompositor_h |
| OLD | NEW |