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 |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef CompositedLayerMapping_h | 26 #ifndef CompositedLayerMapping_h |
27 #define CompositedLayerMapping_h | 27 #define CompositedLayerMapping_h |
28 | 28 |
29 #include "core/rendering/RenderLayer.h" | 29 #include "core/rendering/RenderLayer.h" |
| 30 #include "core/rendering/compositing/GraphicsLayerUpdater.h" |
30 #include "platform/geometry/FloatPoint.h" | 31 #include "platform/geometry/FloatPoint.h" |
31 #include "platform/geometry/FloatPoint3D.h" | 32 #include "platform/geometry/FloatPoint3D.h" |
32 #include "platform/graphics/GraphicsLayer.h" | 33 #include "platform/graphics/GraphicsLayer.h" |
33 #include "platform/graphics/GraphicsLayerClient.h" | 34 #include "platform/graphics/GraphicsLayerClient.h" |
34 #include "platform/transforms/TransformationMatrix.h" | 35 #include "platform/transforms/TransformationMatrix.h" |
35 | 36 |
36 namespace WebCore { | 37 namespace WebCore { |
37 | 38 |
38 class KeyframeList; | 39 class KeyframeList; |
39 class RenderLayerCompositor; | 40 class RenderLayerCompositor; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 CompositingChildrenOnly = 1 << 0, | 88 CompositingChildrenOnly = 1 << 0, |
88 NeedsFullRepaint = 1 << 1, | 89 NeedsFullRepaint = 1 << 1, |
89 IsUpdateRoot = 1 << 2 | 90 IsUpdateRoot = 1 << 2 |
90 }; | 91 }; |
91 typedef unsigned UpdateAfterLayoutFlags; | 92 typedef unsigned UpdateAfterLayoutFlags; |
92 void updateAfterLayout(UpdateAfterLayoutFlags); | 93 void updateAfterLayout(UpdateAfterLayoutFlags); |
93 | 94 |
94 // Returns true if layer configuration changed. | 95 // Returns true if layer configuration changed. |
95 bool updateGraphicsLayerConfiguration(); | 96 bool updateGraphicsLayerConfiguration(); |
96 // Update graphics layer position and bounds. | 97 // Update graphics layer position and bounds. |
97 void updateGraphicsLayerGeometry(); // make private | 98 GraphicsLayerUpdater::UpdateType updateGraphicsLayerGeometry(GraphicsLayerUp
dater::UpdateType); |
98 // Update whether layer needs blending. | 99 // Update whether layer needs blending. |
99 void updateContentsOpaque(); | 100 void updateContentsOpaque(); |
100 | 101 |
101 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } | 102 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } |
102 | 103 |
103 // Layer to clip children | 104 // Layer to clip children |
104 bool hasClippingLayer() const { return m_childContainmentLayer; } | 105 bool hasClippingLayer() const { return m_childContainmentLayer; } |
105 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} | 106 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} |
106 | 107 |
107 // Layer to get clipped by ancestor | 108 // Layer to get clipped by ancestor |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 189 |
189 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } | 190 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } |
190 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } | 191 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } |
191 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } | 192 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } |
192 | 193 |
193 void updateFilters(const RenderStyle*); | 194 void updateFilters(const RenderStyle*); |
194 bool canCompositeFilters() const { return m_canCompositeFilters; } | 195 bool canCompositeFilters() const { return m_canCompositeFilters; } |
195 | 196 |
196 void setBlendMode(blink::WebBlendMode); | 197 void setBlendMode(blink::WebBlendMode); |
197 | 198 |
| 199 void setNeedsGeometryUpdate(); |
| 200 void clearNeedsGeometryUpdate(); |
| 201 |
198 virtual String debugName(const GraphicsLayer*) OVERRIDE; | 202 virtual String debugName(const GraphicsLayer*) OVERRIDE; |
199 | 203 |
200 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } | 204 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } |
201 private: | 205 private: |
202 void createPrimaryGraphicsLayer(); | 206 void createPrimaryGraphicsLayer(); |
203 void destroyGraphicsLayers(); | 207 void destroyGraphicsLayers(); |
204 | 208 |
205 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); | 209 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); |
206 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); | 210 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); |
207 | 211 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 350 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
347 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 351 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
348 | 352 |
349 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. | 353 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. |
350 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers
exist, this is the backing that squashed layers paint into. | 354 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers
exist, this is the backing that squashed layers paint into. |
351 Vector<GraphicsLayerPaintInfo> m_squashedLayers; | 355 Vector<GraphicsLayerPaintInfo> m_squashedLayers; |
352 | 356 |
353 LayoutRect m_compositedBounds; | 357 LayoutRect m_compositedBounds; |
354 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of the
compositedBounds compared to absolute coordinates. | 358 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of the
compositedBounds compared to absolute coordinates. |
355 | 359 |
356 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work | 360 bool m_artificiallyInflatedBounds : 1; // bounds had to be made non-zero to
make transform-origin work |
357 bool m_isMainFrameRenderViewLayer; | 361 bool m_isMainFrameRenderViewLayer : 1; |
358 bool m_requiresOwnBackingStoreForIntrinsicReasons; | 362 bool m_requiresOwnBackingStoreForIntrinsicReasons : 1; |
359 bool m_requiresOwnBackingStoreForAncestorReasons; | 363 bool m_requiresOwnBackingStoreForAncestorReasons : 1; |
360 bool m_canCompositeFilters; | 364 bool m_canCompositeFilters : 1; |
361 bool m_backgroundLayerPaintsFixedRootBackground; | 365 bool m_backgroundLayerPaintsFixedRootBackground : 1; |
| 366 bool m_needToUpdateGeometry : 1; |
| 367 bool m_needToUpdateGeometryOfAllDecendants : 1; |
362 }; | 368 }; |
363 | 369 |
364 } // namespace WebCore | 370 } // namespace WebCore |
365 | 371 |
366 #endif // CompositedLayerMapping_h | 372 #endif // CompositedLayerMapping_h |
OLD | NEW |