| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 ContainerCompositingLayer // layer with no backing store | 45 ContainerCompositingLayer // layer with no backing store |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 | 48 |
| 49 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt
ree of RenderLayers into a GraphicsLayer. | 49 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt
ree of RenderLayers into a GraphicsLayer. |
| 50 struct GraphicsLayerPaintInfo { | 50 struct GraphicsLayerPaintInfo { |
| 51 RenderLayer* renderLayer; | 51 RenderLayer* renderLayer; |
| 52 | 52 |
| 53 IntRect compositedBounds; | 53 IntRect compositedBounds; |
| 54 | 54 |
| 55 // A temporary offset used for squashing layers, when the origin of the |
| 56 // squashing layer is not yet known. |
| 57 IntSize offsetFromBackingRoot; |
| 58 |
| 55 IntSize offsetFromRenderer; | 59 IntSize offsetFromRenderer; |
| 56 | 60 |
| 57 GraphicsLayerPaintingPhase paintingPhase; | 61 GraphicsLayerPaintingPhase paintingPhase; |
| 58 | 62 |
| 59 bool isBackgroundLayer; | 63 bool isBackgroundLayer; |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor
respond to | 66 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor
respond to |
| 63 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer
Mapping | 67 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer
Mapping |
| 64 // manages a small cluster of GraphicsLayers and the references to which RenderL
ayers | 68 // manages a small cluster of GraphicsLayers and the references to which RenderL
ayers |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 bool hasScrollingLayer() const { return m_scrollingLayer; } | 112 bool hasScrollingLayer() const { return m_scrollingLayer; } |
| 109 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } | 113 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } |
| 110 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa
yer.get(); } | 114 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa
yer.get(); } |
| 111 | 115 |
| 112 bool hasMaskLayer() const { return m_maskLayer; } | 116 bool hasMaskLayer() const { return m_maskLayer; } |
| 113 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; } | 117 bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; } |
| 114 | 118 |
| 115 GraphicsLayer* parentForSublayers() const; | 119 GraphicsLayer* parentForSublayers() const; |
| 116 GraphicsLayer* childForSuperlayers() const; | 120 GraphicsLayer* childForSuperlayers() const; |
| 117 | 121 |
| 122 GraphicsLayer* squashingLayer() const { return m_squashingLayer.get(); } |
| 123 |
| 118 // Returns true for a composited layer that has no backing store of its own,
so | 124 // Returns true for a composited layer that has no backing store of its own,
so |
| 119 // paints into some ancestor layer. | 125 // paints into some ancestor layer. |
| 120 bool paintsIntoCompositedAncestor() const { return !(m_requiresOwnBackingSto
reForAncestorReasons || m_requiresOwnBackingStoreForIntrinsicReasons); } | 126 bool paintsIntoCompositedAncestor() const { return !(m_requiresOwnBackingSto
reForAncestorReasons || m_requiresOwnBackingStoreForIntrinsicReasons); } |
| 121 | 127 |
| 122 // Updates whether a backing store is needed based on the layer's compositin
g ancestor's | 128 // Updates whether a backing store is needed based on the layer's compositin
g ancestor's |
| 123 // properties; returns true if the need for a backing store for ancestor rea
sons changed. | 129 // properties; returns true if the need for a backing store for ancestor rea
sons changed. |
| 124 bool updateRequiresOwnBackingStoreForAncestorReasons(const RenderLayer* comp
ositingAncestor); | 130 bool updateRequiresOwnBackingStoreForAncestorReasons(const RenderLayer* comp
ositingAncestor); |
| 125 | 131 |
| 126 // Updates whether a backing store is needed for intrinsic reasons (that is,
based on the | 132 // Updates whether a backing store is needed for intrinsic reasons (that is,
based on the |
| 127 // layer's own properties or compositing reasons); returns true if the intri
nsic need for | 133 // layer's own properties or compositing reasons); returns true if the intri
nsic need for |
| (...skipping 17 matching lines...) Expand all Loading... |
| 145 void animationFinished(const String& name); | 151 void animationFinished(const String& name); |
| 146 | 152 |
| 147 IntRect compositedBounds() const; | 153 IntRect compositedBounds() const; |
| 148 void setCompositedBounds(const IntRect&); | 154 void setCompositedBounds(const IntRect&); |
| 149 void updateCompositedBounds(); | 155 void updateCompositedBounds(); |
| 150 | 156 |
| 151 void updateAfterWidgetResize(); | 157 void updateAfterWidgetResize(); |
| 152 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); | 158 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); |
| 153 bool hasUnpositionedOverflowControlsLayers() const; | 159 bool hasUnpositionedOverflowControlsLayers() const; |
| 154 | 160 |
| 161 void clearSquashingGraphicsLayer(); |
| 162 void addRenderLayerToSquashingGraphicsLayer(RenderLayer*, IntSize offsetFrom
TargetBacking); |
| 163 void beginAccumulatingSquashingLayers(); |
| 164 void finishAccumulatingSquashingLayers(); |
| 165 |
| 155 // GraphicsLayerClient interface | 166 // GraphicsLayerClient interface |
| 156 virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime)
OVERRIDE; | 167 virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime)
OVERRIDE; |
| 157 | 168 |
| 158 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& clip) OVERRIDE; | 169 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& clip) OVERRIDE; |
| 159 | 170 |
| 160 virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE; | 171 virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE; |
| 161 virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&
) const OVERRIDE; | 172 virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&
) const OVERRIDE; |
| 162 | 173 |
| 163 virtual bool isTrackingRepaints() const OVERRIDE; | 174 virtual bool isTrackingRepaints() const OVERRIDE; |
| 164 | 175 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 bool updateForegroundLayer(bool needsForegroundLayer); | 214 bool updateForegroundLayer(bool needsForegroundLayer); |
| 204 bool updateBackgroundLayer(bool needsBackgroundLayer); | 215 bool updateBackgroundLayer(bool needsBackgroundLayer); |
| 205 bool updateMaskLayer(bool needsMaskLayer); | 216 bool updateMaskLayer(bool needsMaskLayer); |
| 206 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); | 217 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); |
| 207 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->scroll
ableArea() && m_owningLayer->scrollableArea()->horizontalScrollbar(); } | 218 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->scroll
ableArea() && m_owningLayer->scrollableArea()->horizontalScrollbar(); } |
| 208 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->scrollab
leArea() && m_owningLayer->scrollableArea()->verticalScrollbar(); } | 219 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->scrollab
leArea() && m_owningLayer->scrollableArea()->verticalScrollbar(); } |
| 209 bool requiresScrollCornerLayer() const { return m_owningLayer->scrollableAre
a() && !m_owningLayer->scrollableArea()->scrollCornerAndResizerRect().isEmpty();
} | 220 bool requiresScrollCornerLayer() const { return m_owningLayer->scrollableAre
a() && !m_owningLayer->scrollableArea()->scrollCornerAndResizerRect().isEmpty();
} |
| 210 bool updateScrollingLayers(bool scrollingLayers); | 221 bool updateScrollingLayers(bool scrollingLayers); |
| 211 void updateScrollParent(RenderLayer*); | 222 void updateScrollParent(RenderLayer*); |
| 212 void updateClipParent(RenderLayer*); | 223 void updateClipParent(RenderLayer*); |
| 224 bool updateSquashingLayers(bool needsSquashingLayers); |
| 213 void updateDrawsContent(bool isSimpleContainer); | 225 void updateDrawsContent(bool isSimpleContainer); |
| 214 void registerScrollingLayers(); | 226 void registerScrollingLayers(); |
| 215 | 227 |
| 216 void setBackgroundLayerPaintsFixedRootBackground(bool); | 228 void setBackgroundLayerPaintsFixedRootBackground(bool); |
| 217 | 229 |
| 218 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; | 230 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; |
| 219 | 231 |
| 220 IntSize contentOffsetInCompostingLayer() const; | 232 IntSize contentOffsetInCompostingLayer() const; |
| 221 // Result is transform origin in pixels. | 233 // Result is transform origin in pixels. |
| 222 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; | 234 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 // the background layer (or repainting). | 333 // the background layer (or repainting). |
| 322 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. | 334 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. |
| 323 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. | 335 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. |
| 324 | 336 |
| 325 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 337 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
| 326 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 338 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 327 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 339 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 328 | 340 |
| 329 OwnPtr<WebAnimationProvider> m_animationProvider; | 341 OwnPtr<WebAnimationProvider> m_animationProvider; |
| 330 | 342 |
| 343 OwnPtr<GraphicsLayer> m_squashingContainmentLayer; // Only used if any squas
hed layers exist, to contain the squashed layers as siblings to the rest of the
GraphicsLayer tree chunk. |
| 344 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers
exist, this is the backing that squashed layers paint into. |
| 345 Vector<GraphicsLayerPaintInfo> m_squashedLayers; |
| 346 |
| 347 size_t m_nextSquashedLayerIndex; // Only used to track changes when RenderLa
yers are being added to the squashing layer. |
| 348 |
| 331 IntRect m_compositedBounds; | 349 IntRect m_compositedBounds; |
| 332 | 350 |
| 333 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work | 351 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work |
| 334 bool m_boundsConstrainedByClipping; | 352 bool m_boundsConstrainedByClipping; |
| 335 bool m_isMainFrameRenderViewLayer; | 353 bool m_isMainFrameRenderViewLayer; |
| 336 bool m_requiresOwnBackingStoreForIntrinsicReasons; | 354 bool m_requiresOwnBackingStoreForIntrinsicReasons; |
| 337 bool m_requiresOwnBackingStoreForAncestorReasons; | 355 bool m_requiresOwnBackingStoreForAncestorReasons; |
| 338 bool m_canCompositeFilters; | 356 bool m_canCompositeFilters; |
| 339 bool m_backgroundLayerPaintsFixedRootBackground; | 357 bool m_backgroundLayerPaintsFixedRootBackground; |
| 340 }; | 358 }; |
| 341 | 359 |
| 342 } // namespace WebCore | 360 } // namespace WebCore |
| 343 | 361 |
| 344 #endif // CompositedLayerMapping_h | 362 #endif // CompositedLayerMapping_h |
| OLD | NEW |