| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Copy the accelerated compositing related flags from Settings | 80 // Copy the accelerated compositing related flags from Settings |
| 81 void cacheAcceleratedCompositingFlags(); | 81 void cacheAcceleratedCompositingFlags(); |
| 82 | 82 |
| 83 // Called when the layer hierarchy needs to be updated (compositing layers h
ave been | 83 // Called when the layer hierarchy needs to be updated (compositing layers h
ave been |
| 84 // created, destroyed or re-parented). | 84 // created, destroyed or re-parented). |
| 85 void setCompositingLayersNeedRebuild(bool needRebuild = true); | 85 void setCompositingLayersNeedRebuild(bool needRebuild = true); |
| 86 bool compositingLayersNeedRebuild() const { return m_compositingLayersNeedRe
build; } | 86 bool compositingLayersNeedRebuild() const { return m_compositingLayersNeedRe
build; } |
| 87 | 87 |
| 88 // Called when something outside WebKit affects the visible rect (e.g. deleg
ated scrolling). Might schedule a layer flush. | 88 // Called when something outside WebKit affects the visible rect (e.g. deleg
ated scrolling). Might schedule a layer flush. |
| 89 void didChangeVisibleRect(); | 89 void didChangeVisibleRect(); |
| 90 | 90 |
| 91 // Updating properties required for determining if compositing is necessary. |
| 92 void updateCompositingRequirementsState(); |
| 93 void setNeedsUpdateCompositingRequirementsState() { m_needsUpdateCompositing
RequirementsState = true; } |
| 94 |
| 91 // Rebuild the tree of compositing layers | 95 // Rebuild the tree of compositing layers |
| 92 void updateCompositingLayers(CompositingUpdateType, RenderLayer* updateRoot
= 0); | 96 void updateCompositingLayers(CompositingUpdateType, RenderLayer* updateRoot
= 0); |
| 93 | 97 |
| 94 // Update the compositing state of the given layer. Returns true if that sta
te changed. | 98 // Update the compositing state of the given layer. Returns true if that sta
te changed. |
| 95 enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChan
geWillRepaintLater }; | 99 enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChan
geWillRepaintLater }; |
| 96 bool updateLayerCompositingState(RenderLayer*, CompositingChangeRepaint = Co
mpositingChangeRepaintNow); | 100 bool updateLayerCompositingState(RenderLayer*, CompositingChangeRepaint = Co
mpositingChangeRepaintNow); |
| 97 | 101 |
| 98 // Update the geometry for compositing children of compositingAncestor. | 102 // Update the geometry for compositing children of compositingAncestor. |
| 99 void updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, R
enderLayer*, bool compositedChildrenOnly); | 103 void updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, R
enderLayer*, bool compositedChildrenOnly); |
| 100 | 104 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 #if ENABLE(RUBBER_BANDING) | 187 #if ENABLE(RUBBER_BANDING) |
| 184 GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangArea
s.get(); } | 188 GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangArea
s.get(); } |
| 185 | 189 |
| 186 GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer); | 190 GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer); |
| 187 GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer); | 191 GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer); |
| 188 #endif | 192 #endif |
| 189 | 193 |
| 190 void updateViewportConstraintStatus(RenderLayer*); | 194 void updateViewportConstraintStatus(RenderLayer*); |
| 191 void removeViewportConstrainedLayer(RenderLayer*); | 195 void removeViewportConstrainedLayer(RenderLayer*); |
| 192 | 196 |
| 197 void addOutOfFlowPositionedLayer(RenderLayer*); |
| 198 void removeOutOfFlowPositionedLayer(RenderLayer*); |
| 199 |
| 193 void resetTrackedRepaintRects(); | 200 void resetTrackedRepaintRects(); |
| 194 void setTracksRepaints(bool); | 201 void setTracksRepaints(bool); |
| 195 | 202 |
| 196 void reportMemoryUsage(MemoryObjectInfo*) const; | 203 void reportMemoryUsage(MemoryObjectInfo*) const; |
| 197 void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAf
terLayout = true; } | 204 void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAf
terLayout = true; } |
| 198 | 205 |
| 199 bool viewHasTransparentBackground(Color* backgroundColor = 0) const; | 206 bool viewHasTransparentBackground(Color* backgroundColor = 0) const; |
| 200 | 207 |
| 201 // Returns all reasons (direct, indirectly due to subtree, and indirectly du
e to overlap) that a layer should be composited. | 208 // Returns all reasons (direct, indirectly due to subtree, and indirectly du
e to overlap) that a layer should be composited. |
| 202 CompositingReasons reasonsForCompositing(const RenderLayer*) const; | 209 CompositingReasons reasonsForCompositing(const RenderLayer*) const; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 bool m_showRepaintCounter; | 320 bool m_showRepaintCounter; |
| 314 | 321 |
| 315 // When true, we have to wait until layout has happened before we can decide
whether to enter compositing mode, | 322 // When true, we have to wait until layout has happened before we can decide
whether to enter compositing mode, |
| 316 // because only then do we know the final size of plugins and iframes. | 323 // because only then do we know the final size of plugins and iframes. |
| 317 mutable bool m_reevaluateCompositingAfterLayout; | 324 mutable bool m_reevaluateCompositingAfterLayout; |
| 318 | 325 |
| 319 bool m_compositing; | 326 bool m_compositing; |
| 320 bool m_compositingLayersNeedRebuild; | 327 bool m_compositingLayersNeedRebuild; |
| 321 bool m_forceCompositingMode; | 328 bool m_forceCompositingMode; |
| 322 bool m_inPostLayoutUpdate; // true when it's OK to trust layout information
(e.g. layer sizes and positions) | 329 bool m_inPostLayoutUpdate; // true when it's OK to trust layout information
(e.g. layer sizes and positions) |
| 330 bool m_needsUpdateCompositingRequirementsState; |
| 323 | 331 |
| 324 bool m_isTrackingRepaints; // Used for testing. | 332 bool m_isTrackingRepaints; // Used for testing. |
| 325 | 333 |
| 326 RootLayerAttachment m_rootLayerAttachment; | 334 RootLayerAttachment m_rootLayerAttachment; |
| 327 | 335 |
| 328 // Enclosing clipping layer for iframe content | 336 // Enclosing clipping layer for iframe content |
| 329 OwnPtr<GraphicsLayer> m_clipLayer; | 337 OwnPtr<GraphicsLayer> m_clipLayer; |
| 330 OwnPtr<GraphicsLayer> m_scrollLayer; | 338 OwnPtr<GraphicsLayer> m_scrollLayer; |
| 331 | 339 |
| 332 HashSet<RenderLayer*> m_viewportConstrainedLayers; | 340 HashSet<RenderLayer*> m_viewportConstrainedLayers; |
| 333 HashSet<RenderLayer*> m_viewportConstrainedLayersNeedingUpdate; | 341 HashSet<RenderLayer*> m_viewportConstrainedLayersNeedingUpdate; |
| 334 | 342 |
| 343 // This is used in updateCompositingRequirementsState to avoid full tree |
| 344 // walks while determining if layers have unclipped descendants. |
| 345 HashSet<RenderLayer*> m_outOfFlowPositionedLayers; |
| 346 |
| 335 // Enclosing layer for overflow controls and the clipping layer | 347 // Enclosing layer for overflow controls and the clipping layer |
| 336 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer; | 348 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer; |
| 337 | 349 |
| 338 // Layers for overflow controls | 350 // Layers for overflow controls |
| 339 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 351 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
| 340 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 352 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 341 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 353 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 342 #if ENABLE(RUBBER_BANDING) | 354 #if ENABLE(RUBBER_BANDING) |
| 343 OwnPtr<GraphicsLayer> m_layerForOverhangAreas; | 355 OwnPtr<GraphicsLayer> m_layerForOverhangAreas; |
| 344 OwnPtr<GraphicsLayer> m_contentShadowLayer; | 356 OwnPtr<GraphicsLayer> m_contentShadowLayer; |
| 345 OwnPtr<GraphicsLayer> m_layerForTopOverhangArea; | 357 OwnPtr<GraphicsLayer> m_layerForTopOverhangArea; |
| 346 OwnPtr<GraphicsLayer> m_layerForBottomOverhangArea; | 358 OwnPtr<GraphicsLayer> m_layerForBottomOverhangArea; |
| 347 #endif | 359 #endif |
| 348 | 360 |
| 349 #if !LOG_DISABLED | 361 #if !LOG_DISABLED |
| 350 int m_rootLayerUpdateCount; | 362 int m_rootLayerUpdateCount; |
| 351 int m_obligateCompositedLayerCount; // count of layer that have to be compos
ited. | 363 int m_obligateCompositedLayerCount; // count of layer that have to be compos
ited. |
| 352 int m_secondaryCompositedLayerCount; // count of layers that have to be comp
osited because of stacking or overlap. | 364 int m_secondaryCompositedLayerCount; // count of layers that have to be comp
osited because of stacking or overlap. |
| 353 double m_obligatoryBackingStoreBytes; | 365 double m_obligatoryBackingStoreBytes; |
| 354 double m_secondaryBackingStoreBytes; | 366 double m_secondaryBackingStoreBytes; |
| 355 #endif | 367 #endif |
| 356 }; | 368 }; |
| 357 | 369 |
| 358 | 370 |
| 359 } // namespace WebCore | 371 } // namespace WebCore |
| 360 | 372 |
| 361 #endif // RenderLayerCompositor_h | 373 #endif // RenderLayerCompositor_h |
| OLD | NEW |