| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Update whether layer needs blending. | 87 // Update whether layer needs blending. |
| 88 void updateContentsOpaque(); | 88 void updateContentsOpaque(); |
| 89 | 89 |
| 90 GraphicsLayer* graphicsLayer() const { return m_graphicsLayer.get(); } | 90 GraphicsLayer* graphicsLayer() const { return m_graphicsLayer.get(); } |
| 91 | 91 |
| 92 // Layer to clip children | 92 // Layer to clip children |
| 93 bool hasClippingLayer() const { return m_childContainmentLayer; } | 93 bool hasClippingLayer() const { return m_childContainmentLayer; } |
| 94 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} | 94 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} |
| 95 | 95 |
| 96 // Layer to get clipped by ancestor | 96 // Layer to get clipped by ancestor |
| 97 bool hasAncestorClippingLayer() const { return m_ancestorClippingLayer != 0;
} | 97 bool hasAncestorClippingLayer() const { return m_ancestorClippingLayer; } |
| 98 GraphicsLayer* ancestorClippingLayer() const { return m_ancestorClippingLaye
r.get(); } | 98 GraphicsLayer* ancestorClippingLayer() const { return m_ancestorClippingLaye
r.get(); } |
| 99 | 99 |
| 100 bool hasAncestorScrollClippingLayer() const { return m_ancestorScrollClippin
gLayer; } |
| 101 GraphicsLayer* ancestorScrollClippingLayer() const { return m_ancestorScroll
ClippingLayer.get(); } |
| 102 |
| 100 bool hasContentsLayer() const { return m_foregroundLayer != 0; } | 103 bool hasContentsLayer() const { return m_foregroundLayer != 0; } |
| 101 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } | 104 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } |
| 102 | 105 |
| 103 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } | 106 GraphicsLayer* backgroundLayer() const { return m_backgroundLayer.get(); } |
| 104 bool backgroundLayerPaintsFixedRootBackground() const { return m_backgroundL
ayerPaintsFixedRootBackground; } | 107 bool backgroundLayerPaintsFixedRootBackground() const { return m_backgroundL
ayerPaintsFixedRootBackground; } |
| 105 | 108 |
| 106 bool hasScrollingLayer() const { return m_scrollingLayer; } | 109 bool hasScrollingLayer() const { return m_scrollingLayer; } |
| 107 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } | 110 GraphicsLayer* scrollingLayer() const { return m_scrollingLayer.get(); } |
| 108 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa
yer.get(); } | 111 GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLa
yer.get(); } |
| 109 | 112 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 private: | 185 private: |
| 183 void createPrimaryGraphicsLayer(); | 186 void createPrimaryGraphicsLayer(); |
| 184 void destroyGraphicsLayers(); | 187 void destroyGraphicsLayers(); |
| 185 | 188 |
| 186 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); | 189 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); |
| 187 | 190 |
| 188 RenderLayerModelObject* renderer() const { return m_owningLayer->renderer();
} | 191 RenderLayerModelObject* renderer() const { return m_owningLayer->renderer();
} |
| 189 RenderLayerCompositor* compositor() const { return m_owningLayer->compositor
(); } | 192 RenderLayerCompositor* compositor() const { return m_owningLayer->compositor
(); } |
| 190 | 193 |
| 191 void updateInternalHierarchy(); | 194 void updateInternalHierarchy(); |
| 192 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); | 195 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip,
bool needsScrollClip); |
| 193 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer); | 196 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer); |
| 194 bool updateForegroundLayer(bool needsForegroundLayer); | 197 bool updateForegroundLayer(bool needsForegroundLayer); |
| 195 bool updateBackgroundLayer(bool needsBackgroundLayer); | 198 bool updateBackgroundLayer(bool needsBackgroundLayer); |
| 196 bool updateMaskLayer(bool needsMaskLayer); | 199 bool updateMaskLayer(bool needsMaskLayer); |
| 197 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->horizo
ntalScrollbar(); } | 200 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->horizo
ntalScrollbar(); } |
| 198 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->vertical
Scrollbar(); } | 201 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->vertical
Scrollbar(); } |
| 199 bool requiresScrollCornerLayer() const { return !m_owningLayer->scrollCorner
AndResizerRect().isEmpty(); } | 202 bool requiresScrollCornerLayer() const { return !m_owningLayer->scrollCorner
AndResizerRect().isEmpty(); } |
| 200 bool updateScrollingLayers(bool scrollingLayers); | 203 bool updateScrollingLayers(bool scrollingLayers); |
| 204 void updateScrollParent(); |
| 205 void updateClipParent(); |
| 201 void updateDrawsContent(bool isSimpleContainer); | 206 void updateDrawsContent(bool isSimpleContainer); |
| 202 void registerScrollingLayers(); | 207 void registerScrollingLayers(); |
| 203 | 208 |
| 204 void setBackgroundLayerPaintsFixedRootBackground(bool); | 209 void setBackgroundLayerPaintsFixedRootBackground(bool); |
| 205 | 210 |
| 206 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; | 211 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; |
| 207 | 212 |
| 208 IntSize contentOffsetInCompostingLayer() const; | 213 IntSize contentOffsetInCompostingLayer() const; |
| 209 // Result is transform origin in pixels. | 214 // Result is transform origin in pixels. |
| 210 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; | 215 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 241 bool shouldClipCompositedBounds() const; | 246 bool shouldClipCompositedBounds() const; |
| 242 | 247 |
| 243 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c
lip); | 248 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c
lip); |
| 244 | 249 |
| 245 static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); | 250 static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); |
| 246 static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); | 251 static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); |
| 247 | 252 |
| 248 RenderLayer* m_owningLayer; | 253 RenderLayer* m_owningLayer; |
| 249 | 254 |
| 250 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe
d by an ancestor which is not a stacking context. | 255 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe
d by an ancestor which is not a stacking context. |
| 256 OwnPtr<GraphicsLayer> m_ancestorScrollClippingLayer; // Only used if we have
a scroll parent, and our clipping ancestor is not our scroll parent. |
| 251 OwnPtr<GraphicsLayer> m_graphicsLayer; | 257 OwnPtr<GraphicsLayer> m_graphicsLayer; |
| 252 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. | 258 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. |
| 253 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. | 259 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. |
| 254 OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipp
ing on a stacking context with compositing children, or if the layer has a tile
cache. | 260 OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipp
ing on a stacking context with compositing children, or if the layer has a tile
cache. |
| 255 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. | 261 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. |
| 256 | 262 |
| 257 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 263 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
| 258 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 264 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 259 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 265 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 260 | 266 |
| 261 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c
omposited scrolling. | 267 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c
omposited scrolling. |
| 262 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is
using composited scrolling. | 268 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is
using composited scrolling. |
| 263 | 269 |
| 264 uint64_t m_scrollLayerID; | |
| 265 | |
| 266 IntRect m_compositedBounds; | 270 IntRect m_compositedBounds; |
| 267 | 271 |
| 268 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work | 272 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work |
| 269 bool m_boundsConstrainedByClipping; | 273 bool m_boundsConstrainedByClipping; |
| 270 bool m_isMainFrameRenderViewLayer; | 274 bool m_isMainFrameRenderViewLayer; |
| 271 bool m_requiresOwnBackingStore; | 275 bool m_requiresOwnBackingStore; |
| 272 bool m_canCompositeFilters; | 276 bool m_canCompositeFilters; |
| 273 bool m_backgroundLayerPaintsFixedRootBackground; | 277 bool m_backgroundLayerPaintsFixedRootBackground; |
| 274 }; | 278 }; |
| 275 | 279 |
| 276 } // namespace WebCore | 280 } // namespace WebCore |
| 277 | 281 |
| 278 #endif // RenderLayerBacking_h | 282 #endif // RenderLayerBacking_h |
| OLD | NEW |