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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 RenderLayer* renderLayer; | 44 RenderLayer* renderLayer; |
45 | 45 |
46 LayoutRect compositedBounds; | 46 LayoutRect compositedBounds; |
47 | 47 |
48 // At first, the m_squashingLayer's bounds/location are not known. The value
offsetFromSquashingCLM is | 48 // At first, the m_squashingLayer's bounds/location are not known. The value
offsetFromSquashingCLM is |
49 // an intermediate offset for a squashed RenderLayer, described with respect
to the CompositedLayerMapping's | 49 // an intermediate offset for a squashed RenderLayer, described with respect
to the CompositedLayerMapping's |
50 // owning layer that would eventually have the m_squashingLayer. Once the sh
ared GraphicsLayer's bounds are | 50 // owning layer that would eventually have the m_squashingLayer. Once the sh
ared GraphicsLayer's bounds are |
51 // known, then we can trivially convert this offset to m_squashingLayer's sp
ace. | 51 // known, then we can trivially convert this offset to m_squashingLayer's sp
ace. |
52 LayoutSize offsetFromSquashingCLM; | 52 LayoutSize offsetFromSquashingCLM; |
53 | 53 |
| 54 // The clip rect to apply, in the local coordinate space of the squashed lay
er, when painting it. |
| 55 IntRect localClipRectForSquashedLayer; |
| 56 |
54 // Offset describing where this squashed RenderLayer paints into the shared
GraphicsLayer backing. | 57 // Offset describing where this squashed RenderLayer paints into the shared
GraphicsLayer backing. |
55 IntSize offsetFromRenderer; | 58 IntSize offsetFromRenderer; |
56 LayoutSize subpixelAccumulation; | 59 LayoutSize subpixelAccumulation; |
57 | 60 |
58 GraphicsLayerPaintingPhase paintingPhase; | 61 GraphicsLayerPaintingPhase paintingPhase; |
59 | 62 |
60 bool isBackgroundLayer; | 63 bool isBackgroundLayer; |
61 | 64 |
62 bool isEquivalentForSquashing(const GraphicsLayerPaintInfo& other) | 65 bool isEquivalentForSquashing(const GraphicsLayerPaintInfo& other) |
63 { | 66 { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 201 |
199 virtual String debugName(const GraphicsLayer*) OVERRIDE; | 202 virtual String debugName(const GraphicsLayer*) OVERRIDE; |
200 | 203 |
201 LayoutSize contentOffsetInCompositingLayer() const; | 204 LayoutSize contentOffsetInCompositingLayer() const; |
202 | 205 |
203 LayoutPoint squashingOffsetFromTransformedAncestor() | 206 LayoutPoint squashingOffsetFromTransformedAncestor() |
204 { | 207 { |
205 return m_squashingLayerOffsetFromTransformedAncestor; | 208 return m_squashingLayerOffsetFromTransformedAncestor; |
206 } | 209 } |
207 | 210 |
| 211 // If there is a squashed layer painting into this CLM that is an ancestor o
f the given RenderObject, return it. Otherwise return 0. |
| 212 const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*) c
onst; |
| 213 |
208 private: | 214 private: |
209 void createPrimaryGraphicsLayer(); | 215 void createPrimaryGraphicsLayer(); |
210 void destroyGraphicsLayers(); | 216 void destroyGraphicsLayers(); |
211 | 217 |
212 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); | 218 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); |
213 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); | 219 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); |
214 | 220 |
215 RenderLayerModelObject* renderer() const { return m_owningLayer.renderer();
} | 221 RenderLayerModelObject* renderer() const { return m_owningLayer.renderer();
} |
216 RenderLayerCompositor* compositor() const { return m_owningLayer.compositor(
); } | 222 RenderLayerCompositor* compositor() const { return m_owningLayer.compositor(
); } |
217 | 223 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 void updateContentsRect(); | 275 void updateContentsRect(); |
270 void updateAfterWidgetResize(); | 276 void updateAfterWidgetResize(); |
271 void updateCompositingReasons(); | 277 void updateCompositingReasons(); |
272 | 278 |
273 bool hasVisibleNonCompositingDescendantLayers() const; | 279 bool hasVisibleNonCompositingDescendantLayers() const; |
274 | 280 |
275 void paintsIntoCompositedAncestorChanged(); | 281 void paintsIntoCompositedAncestorChanged(); |
276 | 282 |
277 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c
lip); | 283 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c
lip); |
278 | 284 |
| 285 // Computes the background clip rect for the given squashed layer, up to any
containing layer that is squashed into the |
| 286 // same squashing layer and contains this squashed layer's clipping ancestor
. |
| 287 // The clip rect is returned in the coordinate space of the given squashed l
ayer. |
| 288 // If there is no such containing layer, returns the infinite rect. |
| 289 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer
. They are doing very similar things. |
| 290 IntRect localClipRectForSquashedLayer(const GraphicsLayerPaintInfo&) const; |
| 291 |
279 RenderLayer& m_owningLayer; | 292 RenderLayer& m_owningLayer; |
280 | 293 |
281 // The hierarchy of layers that is maintained by the CompositedLayerMapping
looks like this: | 294 // The hierarchy of layers that is maintained by the CompositedLayerMapping
looks like this: |
282 // | 295 // |
283 // + m_ancestorClippingLayer [OPTIONAL] | 296 // + m_ancestorClippingLayer [OPTIONAL] |
284 // + m_graphicsLayer | 297 // + m_graphicsLayer |
285 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI
ONAL] <-OR-> m_childTransformLayer | 298 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI
ONAL] <-OR-> m_childTransformLayer |
286 // + m_scrollingContents
Layer [Present iff m_scrollingLayer is present] | 299 // + m_scrollingContents
Layer [Present iff m_scrollingLayer is present] |
287 // | 300 // |
288 // We need an ancestor clipping layer if our clipping ancestor is not our an
cestor in the | 301 // We need an ancestor clipping layer if our clipping ancestor is not our an
cestor in the |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 bool m_requiresOwnBackingStoreForAncestorReasons : 1; | 386 bool m_requiresOwnBackingStoreForAncestorReasons : 1; |
374 bool m_canCompositeFilters : 1; | 387 bool m_canCompositeFilters : 1; |
375 bool m_backgroundLayerPaintsFixedRootBackground : 1; | 388 bool m_backgroundLayerPaintsFixedRootBackground : 1; |
376 bool m_needToUpdateGraphicsLayer : 1; | 389 bool m_needToUpdateGraphicsLayer : 1; |
377 bool m_needToUpdateGraphicsLayerOfAllDecendants : 1; | 390 bool m_needToUpdateGraphicsLayerOfAllDecendants : 1; |
378 }; | 391 }; |
379 | 392 |
380 } // namespace WebCore | 393 } // namespace WebCore |
381 | 394 |
382 #endif // CompositedLayerMapping_h | 395 #endif // CompositedLayerMapping_h |
OLD | NEW |