| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // Copy the accelerated compositing related flags from Settings | 109 // Copy the accelerated compositing related flags from Settings |
| 110 void cacheAcceleratedCompositingFlags(); | 110 void cacheAcceleratedCompositingFlags(); |
| 111 | 111 |
| 112 // Called when the layer hierarchy needs to be updated (compositing layers h
ave been | 112 // Called when the layer hierarchy needs to be updated (compositing layers h
ave been |
| 113 // created, destroyed or re-parented). | 113 // created, destroyed or re-parented). |
| 114 void setCompositingLayersNeedRebuild(bool needRebuild = true); | 114 void setCompositingLayersNeedRebuild(bool needRebuild = true); |
| 115 bool compositingLayersNeedRebuild() const { return m_compositingLayersNeedRe
build; } | 115 bool compositingLayersNeedRebuild() const { return m_compositingLayersNeedRe
build; } |
| 116 | 116 |
| 117 // Called when something outside WebKit affects the visible rect (e.g. deleg
ated scrolling). Might schedule a layer flush. | 117 // Called when something outside WebKit affects the visible rect (e.g. deleg
ated scrolling). Might schedule a layer flush. |
| 118 void didChangeVisibleRect(); | 118 void didChangeVisibleRect(); |
| 119 | 119 |
| 120 // Updating properties required for determining if compositing is necessary. |
| 121 void updateCompositingRequirementsState(); |
| 122 void setNeedsUpdateCompositingRequirementsState() { m_needsUpdateCompositing
RequirementsState = true; } |
| 123 |
| 120 // Rebuild the tree of compositing layers | 124 // Rebuild the tree of compositing layers |
| 121 void updateCompositingLayers(CompositingUpdateType, RenderLayer* updateRoot
= 0); | 125 void updateCompositingLayers(CompositingUpdateType, RenderLayer* updateRoot
= 0); |
| 122 | 126 |
| 123 // Update the compositing state of the given layer. Returns true if that sta
te changed. | 127 // Update the compositing state of the given layer. Returns true if that sta
te changed. |
| 124 enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChan
geWillRepaintLater }; | 128 enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChan
geWillRepaintLater }; |
| 125 bool updateLayerCompositingState(RenderLayer*, CompositingChangeRepaint = Co
mpositingChangeRepaintNow); | 129 bool updateLayerCompositingState(RenderLayer*, CompositingChangeRepaint = Co
mpositingChangeRepaintNow); |
| 126 | 130 |
| 127 // Update the geometry for compositing children of compositingAncestor. | 131 // Update the geometry for compositing children of compositingAncestor. |
| 128 void updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, R
enderLayer*, bool compositedChildrenOnly); | 132 void updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, R
enderLayer*, bool compositedChildrenOnly); |
| 129 | 133 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 #if ENABLE(RUBBER_BANDING) | 222 #if ENABLE(RUBBER_BANDING) |
| 219 GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangArea
s.get(); } | 223 GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangArea
s.get(); } |
| 220 | 224 |
| 221 GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer); | 225 GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer); |
| 222 GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer); | 226 GraphicsLayer* updateLayerForBottomOverhangArea(bool wantsLayer); |
| 223 #endif | 227 #endif |
| 224 | 228 |
| 225 void updateViewportConstraintStatus(RenderLayer*); | 229 void updateViewportConstraintStatus(RenderLayer*); |
| 226 void removeViewportConstrainedLayer(RenderLayer*); | 230 void removeViewportConstrainedLayer(RenderLayer*); |
| 227 | 231 |
| 232 void addOutOfFlowPositionedLayer(RenderLayer*); |
| 233 void removeOutOfFlowPositionedLayer(RenderLayer*); |
| 234 |
| 228 void resetTrackedRepaintRects(); | 235 void resetTrackedRepaintRects(); |
| 229 void setTracksRepaints(bool); | 236 void setTracksRepaints(bool); |
| 230 | 237 |
| 231 void reportMemoryUsage(MemoryObjectInfo*) const; | 238 void reportMemoryUsage(MemoryObjectInfo*) const; |
| 232 void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAf
terLayout = true; } | 239 void setShouldReevaluateCompositingAfterLayout() { m_reevaluateCompositingAf
terLayout = true; } |
| 233 | 240 |
| 234 bool viewHasTransparentBackground(Color* backgroundColor = 0) const; | 241 bool viewHasTransparentBackground(Color* backgroundColor = 0) const; |
| 235 | 242 |
| 236 CompositingReasons reasonsForCompositing(const RenderLayer*) const; | 243 CompositingReasons reasonsForCompositing(const RenderLayer*) const; |
| 237 | 244 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 bool m_showRepaintCounter; | 350 bool m_showRepaintCounter; |
| 344 | 351 |
| 345 // When true, we have to wait until layout has happened before we can decide
whether to enter compositing mode, | 352 // When true, we have to wait until layout has happened before we can decide
whether to enter compositing mode, |
| 346 // because only then do we know the final size of plugins and iframes. | 353 // because only then do we know the final size of plugins and iframes. |
| 347 mutable bool m_reevaluateCompositingAfterLayout; | 354 mutable bool m_reevaluateCompositingAfterLayout; |
| 348 | 355 |
| 349 bool m_compositing; | 356 bool m_compositing; |
| 350 bool m_compositingLayersNeedRebuild; | 357 bool m_compositingLayersNeedRebuild; |
| 351 bool m_forceCompositingMode; | 358 bool m_forceCompositingMode; |
| 352 bool m_inPostLayoutUpdate; // true when it's OK to trust layout information
(e.g. layer sizes and positions) | 359 bool m_inPostLayoutUpdate; // true when it's OK to trust layout information
(e.g. layer sizes and positions) |
| 360 bool m_needsUpdateCompositingRequirementsState; |
| 353 | 361 |
| 354 bool m_isTrackingRepaints; // Used for testing. | 362 bool m_isTrackingRepaints; // Used for testing. |
| 355 | 363 |
| 356 RootLayerAttachment m_rootLayerAttachment; | 364 RootLayerAttachment m_rootLayerAttachment; |
| 357 | 365 |
| 358 // Enclosing clipping layer for iframe content | 366 // Enclosing clipping layer for iframe content |
| 359 OwnPtr<GraphicsLayer> m_clipLayer; | 367 OwnPtr<GraphicsLayer> m_clipLayer; |
| 360 OwnPtr<GraphicsLayer> m_scrollLayer; | 368 OwnPtr<GraphicsLayer> m_scrollLayer; |
| 361 | 369 |
| 362 HashSet<RenderLayer*> m_viewportConstrainedLayers; | 370 HashSet<RenderLayer*> m_viewportConstrainedLayers; |
| 363 HashSet<RenderLayer*> m_viewportConstrainedLayersNeedingUpdate; | 371 HashSet<RenderLayer*> m_viewportConstrainedLayersNeedingUpdate; |
| 364 | 372 |
| 373 // This is used in updateCompositingRequirementsState to avoid full tree |
| 374 // walks while determining if layers have unclipped descendants. |
| 375 HashSet<RenderLayer*> m_outOfFlowPositionedLayers; |
| 376 |
| 365 // Enclosing layer for overflow controls and the clipping layer | 377 // Enclosing layer for overflow controls and the clipping layer |
| 366 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer; | 378 OwnPtr<GraphicsLayer> m_overflowControlsHostLayer; |
| 367 | 379 |
| 368 // Layers for overflow controls | 380 // Layers for overflow controls |
| 369 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 381 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
| 370 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 382 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 371 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 383 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 372 #if ENABLE(RUBBER_BANDING) | 384 #if ENABLE(RUBBER_BANDING) |
| 373 OwnPtr<GraphicsLayer> m_layerForOverhangAreas; | 385 OwnPtr<GraphicsLayer> m_layerForOverhangAreas; |
| 374 OwnPtr<GraphicsLayer> m_contentShadowLayer; | 386 OwnPtr<GraphicsLayer> m_contentShadowLayer; |
| 375 OwnPtr<GraphicsLayer> m_layerForTopOverhangArea; | 387 OwnPtr<GraphicsLayer> m_layerForTopOverhangArea; |
| 376 OwnPtr<GraphicsLayer> m_layerForBottomOverhangArea; | 388 OwnPtr<GraphicsLayer> m_layerForBottomOverhangArea; |
| 377 #endif | 389 #endif |
| 378 | 390 |
| 379 #if !LOG_DISABLED | 391 #if !LOG_DISABLED |
| 380 int m_rootLayerUpdateCount; | 392 int m_rootLayerUpdateCount; |
| 381 int m_obligateCompositedLayerCount; // count of layer that have to be compos
ited. | 393 int m_obligateCompositedLayerCount; // count of layer that have to be compos
ited. |
| 382 int m_secondaryCompositedLayerCount; // count of layers that have to be comp
osited because of stacking or overlap. | 394 int m_secondaryCompositedLayerCount; // count of layers that have to be comp
osited because of stacking or overlap. |
| 383 double m_obligatoryBackingStoreBytes; | 395 double m_obligatoryBackingStoreBytes; |
| 384 double m_secondaryBackingStoreBytes; | 396 double m_secondaryBackingStoreBytes; |
| 385 #endif | 397 #endif |
| 386 }; | 398 }; |
| 387 | 399 |
| 388 | 400 |
| 389 } // namespace WebCore | 401 } // namespace WebCore |
| 390 | 402 |
| 391 #endif // RenderLayerCompositor_h | 403 #endif // RenderLayerCompositor_h |
| OLD | NEW |