| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 188 |
| 188 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } | 189 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } |
| 189 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } | 190 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } |
| 190 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } | 191 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } |
| 191 | 192 |
| 192 void updateFilters(const RenderStyle*); | 193 void updateFilters(const RenderStyle*); |
| 193 bool canCompositeFilters() const { return m_canCompositeFilters; } | 194 bool canCompositeFilters() const { return m_canCompositeFilters; } |
| 194 | 195 |
| 195 void setBlendMode(blink::WebBlendMode); | 196 void setBlendMode(blink::WebBlendMode); |
| 196 | 197 |
| 198 void setNeedsGeometryUpdate(); |
| 199 void willUpdateGeometryOfAllDecendants(); |
| 200 |
| 197 virtual String debugName(const GraphicsLayer*) OVERRIDE; | 201 virtual String debugName(const GraphicsLayer*) OVERRIDE; |
| 198 | 202 |
| 199 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } | 203 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } |
| 200 private: | 204 private: |
| 201 void createPrimaryGraphicsLayer(); | 205 void createPrimaryGraphicsLayer(); |
| 202 void destroyGraphicsLayers(); | 206 void destroyGraphicsLayers(); |
| 203 | 207 |
| 204 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); | 208 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); |
| 205 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); | 209 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); |
| 206 | 210 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 346 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 343 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 347 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 344 | 348 |
| 345 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. | 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. |
| 346 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers
exist, this is the backing that squashed layers paint into. | 350 OwnPtr<GraphicsLayer> m_squashingLayer; // Only used if any squashed layers
exist, this is the backing that squashed layers paint into. |
| 347 Vector<GraphicsLayerPaintInfo> m_squashedLayers; | 351 Vector<GraphicsLayerPaintInfo> m_squashedLayers; |
| 348 | 352 |
| 349 LayoutRect m_compositedBounds; | 353 LayoutRect m_compositedBounds; |
| 350 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of the
compositedBounds compared to absolute coordinates. | 354 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of the
compositedBounds compared to absolute coordinates. |
| 351 | 355 |
| 352 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work | 356 unsigned m_artificiallyInflatedBounds : 1; // bounds had to be made non-zero
to make transform-origin work |
| 353 bool m_isMainFrameRenderViewLayer; | 357 unsigned m_isMainFrameRenderViewLayer : 1; |
| 354 bool m_requiresOwnBackingStoreForIntrinsicReasons; | 358 unsigned m_requiresOwnBackingStoreForIntrinsicReasons : 1; |
| 355 bool m_requiresOwnBackingStoreForAncestorReasons; | 359 unsigned m_requiresOwnBackingStoreForAncestorReasons : 1; |
| 356 bool m_canCompositeFilters; | 360 unsigned m_canCompositeFilters : 1; |
| 357 bool m_backgroundLayerPaintsFixedRootBackground; | 361 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; |
| 362 unsigned m_needToUpdateGeometry : 1; |
| 363 unsigned m_needToUpdateGeometryOfAllDecendants : 1; |
| 358 }; | 364 }; |
| 359 | 365 |
| 360 } // namespace WebCore | 366 } // namespace WebCore |
| 361 | 367 |
| 362 #endif // CompositedLayerMapping_h | 368 #endif // CompositedLayerMapping_h |
| OLD | NEW |