| 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" | |
| 31 #include "platform/geometry/FloatPoint.h" | 30 #include "platform/geometry/FloatPoint.h" |
| 32 #include "platform/geometry/FloatPoint3D.h" | 31 #include "platform/geometry/FloatPoint3D.h" |
| 33 #include "platform/graphics/GraphicsLayer.h" | 32 #include "platform/graphics/GraphicsLayer.h" |
| 34 #include "platform/graphics/GraphicsLayerClient.h" | 33 #include "platform/graphics/GraphicsLayerClient.h" |
| 35 #include "platform/transforms/TransformationMatrix.h" | 34 #include "platform/transforms/TransformationMatrix.h" |
| 36 | 35 |
| 37 namespace WebCore { | 36 namespace WebCore { |
| 38 | 37 |
| 39 class KeyframeList; | 38 class KeyframeList; |
| 40 class RenderLayerCompositor; | 39 class RenderLayerCompositor; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 CompositingChildrenOnly = 1 << 0, | 87 CompositingChildrenOnly = 1 << 0, |
| 89 NeedsFullRepaint = 1 << 1, | 88 NeedsFullRepaint = 1 << 1, |
| 90 IsUpdateRoot = 1 << 2 | 89 IsUpdateRoot = 1 << 2 |
| 91 }; | 90 }; |
| 92 typedef unsigned UpdateAfterLayoutFlags; | 91 typedef unsigned UpdateAfterLayoutFlags; |
| 93 void updateAfterLayout(UpdateAfterLayoutFlags); | 92 void updateAfterLayout(UpdateAfterLayoutFlags); |
| 94 | 93 |
| 95 // Returns true if layer configuration changed. | 94 // Returns true if layer configuration changed. |
| 96 bool updateGraphicsLayerConfiguration(); | 95 bool updateGraphicsLayerConfiguration(); |
| 97 // Update graphics layer position and bounds. | 96 // Update graphics layer position and bounds. |
| 98 GraphicsLayerUpdater::UpdateType updateGraphicsLayerGeometry(GraphicsLayerUp
dater::UpdateType); | 97 void updateGraphicsLayerGeometry(); // make private |
| 99 // Update whether layer needs blending. | 98 // Update whether layer needs blending. |
| 100 void updateContentsOpaque(); | 99 void updateContentsOpaque(); |
| 101 | 100 |
| 102 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } | 101 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } |
| 103 | 102 |
| 104 // Layer to clip children | 103 // Layer to clip children |
| 105 bool hasClippingLayer() const { return m_childContainmentLayer; } | 104 bool hasClippingLayer() const { return m_childContainmentLayer; } |
| 106 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} | 105 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} |
| 107 | 106 |
| 108 // Layer to get clipped by ancestor | 107 // Layer to get clipped by ancestor |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 188 |
| 190 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } | 189 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } |
| 191 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } | 190 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } |
| 192 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } | 191 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } |
| 193 | 192 |
| 194 void updateFilters(const RenderStyle*); | 193 void updateFilters(const RenderStyle*); |
| 195 bool canCompositeFilters() const { return m_canCompositeFilters; } | 194 bool canCompositeFilters() const { return m_canCompositeFilters; } |
| 196 | 195 |
| 197 void setBlendMode(blink::WebBlendMode); | 196 void setBlendMode(blink::WebBlendMode); |
| 198 | 197 |
| 199 void setNeedsGeometryUpdate(); | |
| 200 void clearNeedsGeometryUpdate(); | |
| 201 | |
| 202 virtual String debugName(const GraphicsLayer*) OVERRIDE; | 198 virtual String debugName(const GraphicsLayer*) OVERRIDE; |
| 203 | 199 |
| 204 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } | 200 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } |
| 205 private: | 201 private: |
| 206 void createPrimaryGraphicsLayer(); | 202 void createPrimaryGraphicsLayer(); |
| 207 void destroyGraphicsLayers(); | 203 void destroyGraphicsLayers(); |
| 208 | 204 |
| 209 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); | 205 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); |
| 210 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); | 206 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); |
| 211 | 207 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 346 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 351 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 347 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 352 | 348 |
| 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. | 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. |
| 354 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. |
| 355 Vector<GraphicsLayerPaintInfo> m_squashedLayers; | 351 Vector<GraphicsLayerPaintInfo> m_squashedLayers; |
| 356 | 352 |
| 357 LayoutRect m_compositedBounds; | 353 LayoutRect m_compositedBounds; |
| 358 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. |
| 359 | 355 |
| 360 bool m_artificiallyInflatedBounds : 1; // bounds had to be made non-zero to
make transform-origin work | 356 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work |
| 361 bool m_isMainFrameRenderViewLayer : 1; | 357 bool m_isMainFrameRenderViewLayer; |
| 362 bool m_requiresOwnBackingStoreForIntrinsicReasons : 1; | 358 bool m_requiresOwnBackingStoreForIntrinsicReasons; |
| 363 bool m_requiresOwnBackingStoreForAncestorReasons : 1; | 359 bool m_requiresOwnBackingStoreForAncestorReasons; |
| 364 bool m_canCompositeFilters : 1; | 360 bool m_canCompositeFilters; |
| 365 bool m_backgroundLayerPaintsFixedRootBackground : 1; | 361 bool m_backgroundLayerPaintsFixedRootBackground; |
| 366 bool m_needToUpdateGeometry : 1; | |
| 367 bool m_needToUpdateGeometryOfAllDecendants : 1; | |
| 368 }; | 362 }; |
| 369 | 363 |
| 370 } // namespace WebCore | 364 } // namespace WebCore |
| 371 | 365 |
| 372 #endif // CompositedLayerMapping_h | 366 #endif // CompositedLayerMapping_h |
| OLD | NEW |