| 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/layout/Layer.h" |
| 29 #include "core/layout/compositing/GraphicsLayerUpdater.h" | 30 #include "core/layout/compositing/GraphicsLayerUpdater.h" |
| 30 #include "core/rendering/RenderLayer.h" | |
| 31 #include "platform/geometry/FloatPoint.h" | 31 #include "platform/geometry/FloatPoint.h" |
| 32 #include "platform/geometry/FloatPoint3D.h" | 32 #include "platform/geometry/FloatPoint3D.h" |
| 33 #include "platform/graphics/GraphicsLayer.h" | 33 #include "platform/graphics/GraphicsLayer.h" |
| 34 #include "platform/graphics/GraphicsLayerClient.h" | 34 #include "platform/graphics/GraphicsLayerClient.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class RenderLayerCompositor; | 38 class LayerCompositor; |
| 39 | 39 |
| 40 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt
ree of RenderLayers into a GraphicsLayer. | 40 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt
ree of Layers into a GraphicsLayer. |
| 41 struct GraphicsLayerPaintInfo { | 41 struct GraphicsLayerPaintInfo { |
| 42 RenderLayer* renderLayer; | 42 Layer* renderLayer; |
| 43 | 43 |
| 44 LayoutRect compositedBounds; | 44 LayoutRect compositedBounds; |
| 45 | 45 |
| 46 // The clip rect to apply, in the local coordinate space of the squashed lay
er, when painting it. | 46 // The clip rect to apply, in the local coordinate space of the squashed lay
er, when painting it. |
| 47 IntRect localClipRectForSquashedLayer; | 47 IntRect localClipRectForSquashedLayer; |
| 48 | 48 |
| 49 // Offset describing where this squashed RenderLayer paints into the shared
GraphicsLayer backing. | 49 // Offset describing where this squashed Layer paints into the shared Graphi
csLayer backing. |
| 50 IntSize offsetFromRenderer; | 50 IntSize offsetFromRenderer; |
| 51 bool offsetFromRendererSet; | 51 bool offsetFromRendererSet; |
| 52 | 52 |
| 53 GraphicsLayerPaintInfo() : renderLayer(0), offsetFromRendererSet(false) { } | 53 GraphicsLayerPaintInfo() : renderLayer(0), offsetFromRendererSet(false) { } |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 enum GraphicsLayerUpdateScope { | 56 enum GraphicsLayerUpdateScope { |
| 57 GraphicsLayerUpdateNone, | 57 GraphicsLayerUpdateNone, |
| 58 GraphicsLayerUpdateLocal, | 58 GraphicsLayerUpdateLocal, |
| 59 GraphicsLayerUpdateSubtree, | 59 GraphicsLayerUpdateSubtree, |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor
respond to | 62 // CompositedLayerMapping keeps track of how Layers of the render tree correspon
d to |
| 63 // GraphicsLayers of the composited layer tree. Each instance of CompositedLayer
Mapping | 63 // 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 | 64 // manages a small cluster of GraphicsLayers and the references to which Layers |
| 65 // and paint phases contribute to each GraphicsLayer. | 65 // and paint phases contribute to each GraphicsLayer. |
| 66 // | 66 // |
| 67 // Currently (Oct. 2013) there is one CompositedLayerMapping for each RenderLaye
r, | 67 // Currently (Oct. 2013) there is one CompositedLayerMapping for each Layer, |
| 68 // but this is likely to evolve soon. | 68 // but this is likely to evolve soon. |
| 69 class CompositedLayerMapping final : public GraphicsLayerClient { | 69 class CompositedLayerMapping final : public GraphicsLayerClient { |
| 70 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); WTF_MAKE_FAST_ALLOCATED; | 70 WTF_MAKE_NONCOPYABLE(CompositedLayerMapping); WTF_MAKE_FAST_ALLOCATED; |
| 71 public: | 71 public: |
| 72 explicit CompositedLayerMapping(RenderLayer&); | 72 explicit CompositedLayerMapping(Layer&); |
| 73 virtual ~CompositedLayerMapping(); | 73 virtual ~CompositedLayerMapping(); |
| 74 | 74 |
| 75 RenderLayer& owningLayer() const { return m_owningLayer; } | 75 Layer& owningLayer() const { return m_owningLayer; } |
| 76 | 76 |
| 77 bool updateGraphicsLayerConfiguration(); | 77 bool updateGraphicsLayerConfiguration(); |
| 78 void updateGraphicsLayerGeometry(const RenderLayer* compositingContainer, co
nst RenderLayer* compositingStackingContext, Vector<RenderLayer*>& layersNeeding
PaintInvalidation); | 78 void updateGraphicsLayerGeometry(const Layer* compositingContainer, const La
yer* compositingStackingContext, Vector<Layer*>& layersNeedingPaintInvalidation)
; |
| 79 | 79 |
| 80 // Update whether layer needs blending. | 80 // Update whether layer needs blending. |
| 81 void updateContentsOpaque(); | 81 void updateContentsOpaque(); |
| 82 | 82 |
| 83 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } | 83 GraphicsLayer* mainGraphicsLayer() const { return m_graphicsLayer.get(); } |
| 84 | 84 |
| 85 // Layer to clip children | 85 // Layer to clip children |
| 86 bool hasClippingLayer() const { return m_childContainmentLayer; } | 86 bool hasClippingLayer() const { return m_childContainmentLayer; } |
| 87 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} | 87 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} |
| 88 | 88 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // Notification from the renderer that its content changed. | 124 // Notification from the renderer that its content changed. |
| 125 void contentChanged(ContentChangeType); | 125 void contentChanged(ContentChangeType); |
| 126 | 126 |
| 127 LayoutRect compositedBounds() const { return m_compositedBounds; } | 127 LayoutRect compositedBounds() const { return m_compositedBounds; } |
| 128 IntRect pixelSnappedCompositedBounds() const; | 128 IntRect pixelSnappedCompositedBounds() const; |
| 129 | 129 |
| 130 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); | 130 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); |
| 131 bool hasUnpositionedOverflowControlsLayers() const; | 131 bool hasUnpositionedOverflowControlsLayers() const; |
| 132 | 132 |
| 133 // Returns true if the assignment actually changed the assigned squashing la
yer. | 133 // Returns true if the assignment actually changed the assigned squashing la
yer. |
| 134 bool updateSquashingLayerAssignment(RenderLayer* squashedLayer, const Render
Layer& owningLayer, size_t nextSquashedLayerIndex); | 134 bool updateSquashingLayerAssignment(Layer* squashedLayer, const Layer& ownin
gLayer, size_t nextSquashedLayerIndex); |
| 135 void removeRenderLayerFromSquashingGraphicsLayer(const RenderLayer*); | 135 void removeLayerFromSquashingGraphicsLayer(const Layer*); |
| 136 | 136 |
| 137 void finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex); | 137 void finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex); |
| 138 void updateRenderingContext(); | 138 void updateRenderingContext(); |
| 139 void updateShouldFlattenTransform(); | 139 void updateShouldFlattenTransform(); |
| 140 | 140 |
| 141 // GraphicsLayerClient interface | 141 // GraphicsLayerClient interface |
| 142 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi
me, int group) override; | 142 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi
me, int group) override; |
| 143 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& clip) override; | 143 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& clip) override; |
| 144 virtual bool isTrackingPaintInvalidations() const override; | 144 virtual bool isTrackingPaintInvalidations() const override; |
| 145 | 145 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 156 // Returns true if the overflow controls cannot be positioned within this | 156 // Returns true if the overflow controls cannot be positioned within this |
| 157 // CLM's internal hierarchy without incorrectly stacking under some | 157 // CLM's internal hierarchy without incorrectly stacking under some |
| 158 // scrolling content. If this returns true, these controls must be | 158 // scrolling content. If this returns true, these controls must be |
| 159 // repositioned in the graphics layer tree to ensure that they stack above | 159 // repositioned in the graphics layer tree to ensure that they stack above |
| 160 // scrolling content. | 160 // scrolling content. |
| 161 bool needsToReparentOverflowControls() const; | 161 bool needsToReparentOverflowControls() const; |
| 162 | 162 |
| 163 // Removes the overflow controls host layer from its parent and positions it | 163 // Removes the overflow controls host layer from its parent and positions it |
| 164 // so that it can be inserted as a sibling to this CLM without changing | 164 // so that it can be inserted as a sibling to this CLM without changing |
| 165 // position. | 165 // position. |
| 166 GraphicsLayer* detachLayerForOverflowControls(const RenderLayer& enclosingLa
yer); | 166 GraphicsLayer* detachLayerForOverflowControls(const Layer& enclosingLayer); |
| 167 | 167 |
| 168 void updateFilters(const RenderStyle*); | 168 void updateFilters(const RenderStyle*); |
| 169 | 169 |
| 170 void setBlendMode(WebBlendMode); | 170 void setBlendMode(WebBlendMode); |
| 171 | 171 |
| 172 bool needsGraphicsLayerUpdate() { return m_pendingUpdateScope > GraphicsLaye
rUpdateNone; } | 172 bool needsGraphicsLayerUpdate() { return m_pendingUpdateScope > GraphicsLaye
rUpdateNone; } |
| 173 void setNeedsGraphicsLayerUpdate(GraphicsLayerUpdateScope scope) { m_pending
UpdateScope = std::max(static_cast<GraphicsLayerUpdateScope>(m_pendingUpdateScop
e), scope); } | 173 void setNeedsGraphicsLayerUpdate(GraphicsLayerUpdateScope scope) { m_pending
UpdateScope = std::max(static_cast<GraphicsLayerUpdateScope>(m_pendingUpdateScop
e), scope); } |
| 174 void clearNeedsGraphicsLayerUpdate() { m_pendingUpdateScope = GraphicsLayerU
pdateNone; } | 174 void clearNeedsGraphicsLayerUpdate() { m_pendingUpdateScope = GraphicsLayerU
pdateNone; } |
| 175 | 175 |
| 176 GraphicsLayerUpdater::UpdateType updateTypeForChildren(GraphicsLayerUpdater:
:UpdateType) const; | 176 GraphicsLayerUpdater::UpdateType updateTypeForChildren(GraphicsLayerUpdater:
:UpdateType) const; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 192 const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*, u
nsigned maxSquashedLayerIndex); | 192 const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObject*, u
nsigned maxSquashedLayerIndex); |
| 193 | 193 |
| 194 void updateScrollingBlockSelection(); | 194 void updateScrollingBlockSelection(); |
| 195 | 195 |
| 196 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 196 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } |
| 197 | 197 |
| 198 private: | 198 private: |
| 199 static const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObj
ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn
dex); | 199 static const GraphicsLayerPaintInfo* containingSquashedLayer(const RenderObj
ect*, const Vector<GraphicsLayerPaintInfo>& layers, unsigned maxSquashedLayerIn
dex); |
| 200 | 200 |
| 201 // Helper methods to updateGraphicsLayerGeometry: | 201 // Helper methods to updateGraphicsLayerGeometry: |
| 202 void computeGraphicsLayerParentLocation(const RenderLayer* compositingContai
ner, const IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLoca
tion); | 202 void computeGraphicsLayerParentLocation(const Layer* compositingContainer, c
onst IntRect& ancestorCompositingBounds, IntPoint& graphicsLayerParentLocation); |
| 203 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc
estor, const IntPoint& graphicsLayerParentLocation, const RenderLayer& reference
Layer, Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offs
etFromTransformedAncestor, Vector<RenderLayer*>& layersNeedingPaintInvalidation)
; | 203 void updateSquashingLayerGeometry(const LayoutPoint& offsetFromCompositedAnc
estor, const IntPoint& graphicsLayerParentLocation, const Layer& referenceLayer,
Vector<GraphicsLayerPaintInfo>& layers, GraphicsLayer*, LayoutPoint* offsetFrom
TransformedAncestor, Vector<Layer*>& layersNeedingPaintInvalidation); |
| 204 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound
s, const IntRect& localCompositingBounds, const IntPoint& graphicsLayerParentLoc
ation); | 204 void updateMainGraphicsLayerGeometry(const IntRect& relativeCompositingBound
s, const IntRect& localCompositingBounds, const IntPoint& graphicsLayerParentLoc
ation); |
| 205 void updateAncestorClippingLayerGeometry(const RenderLayer* compositingConta
iner, const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLay
erParentLocation); | 205 void updateAncestorClippingLayerGeometry(const Layer* compositingContainer,
const IntPoint& snappedOffsetFromCompositedAncestor, IntPoint& graphicsLayerPare
ntLocation); |
| 206 void updateOverflowControlsHostLayerGeometry(const RenderLayer* compositingS
tackingContext); | 206 void updateOverflowControlsHostLayerGeometry(const Layer* compositingStackin
gContext); |
| 207 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I
ntRect& localCompositingBounds); | 207 void updateChildContainmentLayerGeometry(const IntRect& clippingBox, const I
ntRect& localCompositingBounds); |
| 208 void updateChildTransformLayerGeometry(); | 208 void updateChildTransformLayerGeometry(); |
| 209 void updateMaskLayerGeometry(); | 209 void updateMaskLayerGeometry(); |
| 210 void updateTransformGeometry(const IntPoint& snappedOffsetFromCompositedAnce
stor, const IntRect& relativeCompositingBounds); | 210 void updateTransformGeometry(const IntPoint& snappedOffsetFromCompositedAnce
stor, const IntRect& relativeCompositingBounds); |
| 211 void updateForegroundLayerGeometry(const FloatSize& relativeCompositingBound
sSize, const IntRect& clippingBox); | 211 void updateForegroundLayerGeometry(const FloatSize& relativeCompositingBound
sSize, const IntRect& clippingBox); |
| 212 void updateBackgroundLayerGeometry(const FloatSize& relativeCompositingBound
sSize); | 212 void updateBackgroundLayerGeometry(const FloatSize& relativeCompositingBound
sSize); |
| 213 void updateReflectionLayerGeometry(Vector<RenderLayer*>& layersNeedingPaintI
nvalidation); | 213 void updateReflectionLayerGeometry(Vector<Layer*>& layersNeedingPaintInvalid
ation); |
| 214 void updateScrollingLayerGeometry(const IntRect& localCompositingBounds); | 214 void updateScrollingLayerGeometry(const IntRect& localCompositingBounds); |
| 215 void updateChildClippingMaskLayerGeometry(); | 215 void updateChildClippingMaskLayerGeometry(); |
| 216 | 216 |
| 217 void createPrimaryGraphicsLayer(); | 217 void createPrimaryGraphicsLayer(); |
| 218 void destroyGraphicsLayers(); | 218 void destroyGraphicsLayers(); |
| 219 | 219 |
| 220 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); | 220 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); |
| 221 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); | 221 bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, C
ompositingReasons); |
| 222 | 222 |
| 223 RenderLayerModelObject* renderer() const { return m_owningLayer.renderer();
} | 223 LayoutLayerModelObject* renderer() const { return m_owningLayer.renderer();
} |
| 224 RenderLayerCompositor* compositor() const { return m_owningLayer.compositor(
); } | 224 LayerCompositor* compositor() const { return m_owningLayer.compositor(); } |
| 225 | 225 |
| 226 void updateInternalHierarchy(); | 226 void updateInternalHierarchy(); |
| 227 void updatePaintingPhases(); | 227 void updatePaintingPhases(); |
| 228 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); | 228 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); |
| 229 bool updateChildTransformLayer(bool needsChildTransformLayer); | 229 bool updateChildTransformLayer(bool needsChildTransformLayer); |
| 230 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer, bool needsAncestorClip)
; | 230 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer, bool needsAncestorClip)
; |
| 231 bool updateForegroundLayer(bool needsForegroundLayer); | 231 bool updateForegroundLayer(bool needsForegroundLayer); |
| 232 bool updateBackgroundLayer(bool needsBackgroundLayer); | 232 bool updateBackgroundLayer(bool needsBackgroundLayer); |
| 233 bool updateMaskLayer(bool needsMaskLayer); | 233 bool updateMaskLayer(bool needsMaskLayer); |
| 234 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); | 234 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); |
| 235 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer.scrolla
bleArea() && m_owningLayer.scrollableArea()->horizontalScrollbar(); } | 235 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer.scrolla
bleArea() && m_owningLayer.scrollableArea()->horizontalScrollbar(); } |
| 236 bool requiresVerticalScrollbarLayer() const { return m_owningLayer.scrollabl
eArea() && m_owningLayer.scrollableArea()->verticalScrollbar(); } | 236 bool requiresVerticalScrollbarLayer() const { return m_owningLayer.scrollabl
eArea() && m_owningLayer.scrollableArea()->verticalScrollbar(); } |
| 237 bool requiresScrollCornerLayer() const { return m_owningLayer.scrollableArea
() && !m_owningLayer.scrollableArea()->scrollCornerAndResizerRect().isEmpty(); } | 237 bool requiresScrollCornerLayer() const { return m_owningLayer.scrollableArea
() && !m_owningLayer.scrollableArea()->scrollCornerAndResizerRect().isEmpty(); } |
| 238 bool updateScrollingLayers(bool scrollingLayers); | 238 bool updateScrollingLayers(bool scrollingLayers); |
| 239 void updateScrollParent(RenderLayer*); | 239 void updateScrollParent(Layer*); |
| 240 void updateClipParent(); | 240 void updateClipParent(); |
| 241 bool updateSquashingLayers(bool needsSquashingLayers); | 241 bool updateSquashingLayers(bool needsSquashingLayers); |
| 242 void updateDrawsContent(); | 242 void updateDrawsContent(); |
| 243 void updateChildrenTransform(); | 243 void updateChildrenTransform(); |
| 244 void updateCompositedBounds(); | 244 void updateCompositedBounds(); |
| 245 void registerScrollingLayers(); | 245 void registerScrollingLayers(); |
| 246 | 246 |
| 247 // Also sets subpixelAccumulation on the layer. | 247 // Also sets subpixelAccumulation on the layer. |
| 248 void computeBoundsOfOwningLayer(const RenderLayer* compositedAncestor, IntRe
ct& localCompositingBounds, IntRect& compositingBoundsRelativeToCompositedAncest
or, LayoutPoint& offsetFromCompositedAncestor, IntPoint& snappedOffsetFromCompos
itedAncestor); | 248 void computeBoundsOfOwningLayer(const Layer* compositedAncestor, IntRect& lo
calCompositingBounds, IntRect& compositingBoundsRelativeToCompositedAncestor, La
youtPoint& offsetFromCompositedAncestor, IntPoint& snappedOffsetFromCompositedAn
cestor); |
| 249 | 249 |
| 250 void setBackgroundLayerPaintsFixedRootBackground(bool); | 250 void setBackgroundLayerPaintsFixedRootBackground(bool); |
| 251 | 251 |
| 252 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; | 252 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; |
| 253 | 253 |
| 254 // Result is transform origin in pixels. | 254 // Result is transform origin in pixels. |
| 255 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; | 255 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; |
| 256 | 256 |
| 257 void updateOpacity(const RenderStyle*); | 257 void updateOpacity(const RenderStyle*); |
| 258 void updateTransform(const RenderStyle*); | 258 void updateTransform(const RenderStyle*); |
| 259 void updateLayerBlendMode(const RenderStyle*); | 259 void updateLayerBlendMode(const RenderStyle*); |
| 260 void updateIsRootForIsolatedGroup(); | 260 void updateIsRootForIsolatedGroup(); |
| 261 void updateScrollBlocksOn(const RenderStyle*); | 261 void updateScrollBlocksOn(const RenderStyle*); |
| 262 // Return the opacity value that this layer should use for compositing. | 262 // Return the opacity value that this layer should use for compositing. |
| 263 float compositingOpacity(float rendererOpacity) const; | 263 float compositingOpacity(float rendererOpacity) const; |
| 264 | 264 |
| 265 bool paintsChildren() const; | 265 bool paintsChildren() const; |
| 266 | 266 |
| 267 // Returns true if this layer has content that needs to be rendered by paint
ing into the backing store. | 267 // Returns true if this layer has content that needs to be rendered by paint
ing into the backing store. |
| 268 bool containsPaintedContent() const; | 268 bool containsPaintedContent() const; |
| 269 // Returns true if the RenderLayer just contains an image that we can compos
ite directly. | 269 // Returns true if the Layer just contains an image that we can composite di
rectly. |
| 270 bool isDirectlyCompositedImage() const; | 270 bool isDirectlyCompositedImage() const; |
| 271 void updateImageContents(); | 271 void updateImageContents(); |
| 272 | 272 |
| 273 Color rendererBackgroundColor() const; | 273 Color rendererBackgroundColor() const; |
| 274 void updateBackgroundColor(); | 274 void updateBackgroundColor(); |
| 275 void updateContentsRect(); | 275 void updateContentsRect(); |
| 276 void updateContentsOffsetInCompositingLayer(const IntPoint& snappedOffsetFro
mCompositedAncestor, const IntPoint& graphicsLayerParentLocation); | 276 void updateContentsOffsetInCompositingLayer(const IntPoint& snappedOffsetFro
mCompositedAncestor, const IntPoint& graphicsLayerParentLocation); |
| 277 void updateAfterPartResize(); | 277 void updateAfterPartResize(); |
| 278 void updateCompositingReasons(); | 278 void updateCompositingReasons(); |
| 279 | 279 |
| 280 static bool hasVisibleNonCompositingDescendant(RenderLayer* parent); | 280 static bool hasVisibleNonCompositingDescendant(Layer* parent); |
| 281 | 281 |
| 282 void doPaintTask(const GraphicsLayerPaintInfo&, const PaintLayerFlags&, Grap
hicsContext*, const IntRect& clip); | 282 void doPaintTask(const GraphicsLayerPaintInfo&, const PaintLayerFlags&, Grap
hicsContext*, const IntRect& clip); |
| 283 | 283 |
| 284 // Computes the background clip rect for the given squashed layer, up to any
containing layer that is squashed into the | 284 // Computes the background clip rect for the given squashed layer, up to any
containing layer that is squashed into the |
| 285 // same squashing layer and contains this squashed layer's clipping ancestor
. | 285 // same squashing layer and contains this squashed layer's clipping ancestor
. |
| 286 // The clip rect is returned in the coordinate space of the given squashed l
ayer. | 286 // The clip rect is returned in the coordinate space of the given squashed l
ayer. |
| 287 // If there is no such containing layer, returns the infinite rect. | 287 // If there is no such containing layer, returns the infinite rect. |
| 288 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer
. They are doing very similar things. | 288 // FIXME: unify this code with the code that sets up m_ancestorClippingLayer
. They are doing very similar things. |
| 289 static IntRect localClipRectForSquashedLayer(const RenderLayer& referenceLay
er, const GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers
); | 289 static IntRect localClipRectForSquashedLayer(const Layer& referenceLayer, co
nst GraphicsLayerPaintInfo&, const Vector<GraphicsLayerPaintInfo>& layers); |
| 290 | 290 |
| 291 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant
(inclusive) of the | 291 // Return true if |m_owningLayer|'s compositing ancestor is not a descendant
(inclusive) of the |
| 292 // clipping container for |m_owningLayer|. | 292 // clipping container for |m_owningLayer|. |
| 293 bool owningLayerClippedByLayerNotAboveCompositedAncestor(); | 293 bool owningLayerClippedByLayerNotAboveCompositedAncestor(); |
| 294 | 294 |
| 295 RenderLayer& m_owningLayer; | 295 Layer& m_owningLayer; |
| 296 | 296 |
| 297 // The hierarchy of layers that is maintained by the CompositedLayerMapping
looks like this: | 297 // The hierarchy of layers that is maintained by the CompositedLayerMapping
looks like this: |
| 298 // | 298 // |
| 299 // + m_ancestorClippingLayer [OPTIONAL] | 299 // + m_ancestorClippingLayer [OPTIONAL] |
| 300 // + m_graphicsLayer | 300 // + m_graphicsLayer |
| 301 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI
ONAL] <-OR-> m_childTransformLayer | 301 // + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTI
ONAL] <-OR-> m_childTransformLayer |
| 302 // | + m_scrollingContents
Layer [Present iff m_scrollingLayer is present] | 302 // | + m_scrollingContents
Layer [Present iff m_scrollingLayer is present] |
| 303 // | + m_scrollingBlock
SelectionLayer [Present iff m_scrollingLayer is present] | 303 // | + m_scrollingBlock
SelectionLayer [Present iff m_scrollingLayer is present] |
| 304 // | | 304 // | |
| 305 // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow cont
rols may need to be repositioned in the | 305 // + m_overflowControlsClippingLayer [OPTIONAL] // *The overflow cont
rols may need to be repositioned in the |
| (...skipping 30 matching lines...) Expand all Loading... |
| 336 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is
using composited scrolling. | 336 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is
using composited scrolling. |
| 337 OwnPtr<GraphicsLayer> m_scrollingBlockSelectionLayer; // Only used if the la
yer is using composited scrolling, but has no scrolling contents apart from bloc
k selection gaps. | 337 OwnPtr<GraphicsLayer> m_scrollingBlockSelectionLayer; // Only used if the la
yer is using composited scrolling, but has no scrolling contents apart from bloc
k selection gaps. |
| 338 | 338 |
| 339 // This layer is also added to the hierarchy by the RLB, but in a different
way than | 339 // This layer is also added to the hierarchy by the RLB, but in a different
way than |
| 340 // the layers above. It's added to m_graphicsLayer as its mask layer (natura
lly) if | 340 // the layers above. It's added to m_graphicsLayer as its mask layer (natura
lly) if |
| 341 // we have a mask, and isn't part of the typical hierarchy (it has no childr
en). | 341 // we have a mask, and isn't part of the typical hierarchy (it has no childr
en). |
| 342 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. | 342 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. |
| 343 OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to c
lip child layers or accelerated contents with border radius or clip-path. | 343 OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to c
lip child layers or accelerated contents with border radius or clip-path. |
| 344 | 344 |
| 345 // There are two other (optional) layers whose painting is managed by the Co
mpositedLayerMapping, | 345 // There are two other (optional) layers whose painting is managed by the Co
mpositedLayerMapping, |
| 346 // but whose position in the hierarchy is maintained by the RenderLayerCompo
sitor. These | 346 // but whose position in the hierarchy is maintained by the LayerCompositor.
These |
| 347 // are the foreground and background layers. The foreground layer exists if
we have composited | 347 // are the foreground and background layers. The foreground layer exists if
we have composited |
| 348 // descendants with negative z-order. We need the extra layer in this case b
ecause the layer | 348 // descendants with negative z-order. We need the extra layer in this case b
ecause the layer |
| 349 // needs to draw both below (for the background, say) and above (for the nor
mal flow content, say) | 349 // needs to draw both below (for the background, say) and above (for the nor
mal flow content, say) |
| 350 // the negative z-order descendants and this is impossible with a single lay
er. The RLC handles | 350 // the negative z-order descendants and this is impossible with a single lay
er. The RLC handles |
| 351 // inserting m_foregroundLayer in the correct position in our descendant lis
t for us (right after | 351 // inserting m_foregroundLayer in the correct position in our descendant lis
t for us (right after |
| 352 // the neg z-order dsecendants). | 352 // the neg z-order dsecendants). |
| 353 // | 353 // |
| 354 // The background layer is only created if this is the root layer and our ba
ckground is entirely | 354 // The background layer is only created if this is the root layer and our ba
ckground is entirely |
| 355 // fixed. In this case we want to put the background in a separate composite
d layer so that when | 355 // fixed. In this case we want to put the background in a separate composite
d layer so that when |
| 356 // we scroll, we don't have to re-raster the background into position. This
layer is also inserted | 356 // we scroll, we don't have to re-raster the background into position. This
layer is also inserted |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 unsigned m_pendingUpdateScope : 2; | 412 unsigned m_pendingUpdateScope : 2; |
| 413 unsigned m_isMainFrameRenderViewLayer : 1; | 413 unsigned m_isMainFrameRenderViewLayer : 1; |
| 414 | 414 |
| 415 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; | 415 unsigned m_backgroundLayerPaintsFixedRootBackground : 1; |
| 416 unsigned m_scrollingContentsAreEmpty : 1; | 416 unsigned m_scrollingContentsAreEmpty : 1; |
| 417 }; | 417 }; |
| 418 | 418 |
| 419 } // namespace blink | 419 } // namespace blink |
| 420 | 420 |
| 421 #endif // CompositedLayerMapping_h | 421 #endif // CompositedLayerMapping_h |
| OLD | NEW |