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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 private: | 183 private: |
181 void createPrimaryGraphicsLayer(); | 184 void createPrimaryGraphicsLayer(); |
182 void destroyGraphicsLayers(); | 185 void destroyGraphicsLayers(); |
183 | 186 |
184 PassOwnPtr<GraphicsLayer> createGraphicsLayer(const String& name, Compositin
gReasons); | 187 PassOwnPtr<GraphicsLayer> createGraphicsLayer(const String& name, Compositin
gReasons); |
185 | 188 |
186 RenderLayerModelObject* renderer() const { return m_owningLayer->renderer();
} | 189 RenderLayerModelObject* renderer() const { return m_owningLayer->renderer();
} |
187 RenderLayerCompositor* compositor() const { return m_owningLayer->compositor
(); } | 190 RenderLayerCompositor* compositor() const { return m_owningLayer->compositor
(); } |
188 | 191 |
189 void updateInternalHierarchy(); | 192 void updateInternalHierarchy(); |
190 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); | 193 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip,
bool needsScrollClip); |
191 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer); | 194 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer); |
192 bool updateForegroundLayer(bool needsForegroundLayer); | 195 bool updateForegroundLayer(bool needsForegroundLayer); |
193 bool updateBackgroundLayer(bool needsBackgroundLayer); | 196 bool updateBackgroundLayer(bool needsBackgroundLayer); |
194 bool updateMaskLayer(bool needsMaskLayer); | 197 bool updateMaskLayer(bool needsMaskLayer); |
195 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->horizo
ntalScrollbar(); } | 198 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->horizo
ntalScrollbar(); } |
196 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->vertical
Scrollbar(); } | 199 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->vertical
Scrollbar(); } |
197 bool requiresScrollCornerLayer() const { return !m_owningLayer->scrollCorner
AndResizerRect().isEmpty(); } | 200 bool requiresScrollCornerLayer() const { return !m_owningLayer->scrollCorner
AndResizerRect().isEmpty(); } |
198 bool updateScrollingLayers(bool scrollingLayers); | 201 bool updateScrollingLayers(bool scrollingLayers); |
| 202 void updateScrollParent(); |
| 203 void updateClipParent(); |
199 void updateDrawsContent(bool isSimpleContainer); | 204 void updateDrawsContent(bool isSimpleContainer); |
200 void registerScrollingLayers(); | 205 void registerScrollingLayers(); |
201 | 206 |
202 void setBackgroundLayerPaintsFixedRootBackground(bool); | 207 void setBackgroundLayerPaintsFixedRootBackground(bool); |
203 | 208 |
204 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; | 209 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; |
205 | 210 |
206 IntSize contentOffsetInCompostingLayer() const; | 211 IntSize contentOffsetInCompostingLayer() const; |
207 // Result is transform origin in pixels. | 212 // Result is transform origin in pixels. |
208 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; | 213 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; |
(...skipping 30 matching lines...) Expand all Loading... |
239 bool shouldClipCompositedBounds() const; | 244 bool shouldClipCompositedBounds() const; |
240 | 245 |
241 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c
lip); | 246 void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& c
lip); |
242 | 247 |
243 static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); | 248 static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); |
244 static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); | 249 static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); |
245 | 250 |
246 RenderLayer* m_owningLayer; | 251 RenderLayer* m_owningLayer; |
247 | 252 |
248 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe
d by an ancestor which is not a stacking context. | 253 OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clippe
d by an ancestor which is not a stacking context. |
| 254 OwnPtr<GraphicsLayer> m_ancestorScrollClippingLayer; // Only used if we have
a scroll parent, and our clipping ancestor is not our scroll parent. |
249 OwnPtr<GraphicsLayer> m_graphicsLayer; | 255 OwnPtr<GraphicsLayer> m_graphicsLayer; |
250 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. | 256 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. |
251 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. | 257 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. |
252 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. | 258 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. |
253 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. | 259 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. |
254 | 260 |
255 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 261 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
256 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 262 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
257 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 263 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
258 | 264 |
259 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c
omposited scrolling. | 265 OwnPtr<GraphicsLayer> m_scrollingLayer; // Only used if the layer is using c
omposited scrolling. |
260 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is
using composited scrolling. | 266 OwnPtr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is
using composited scrolling. |
261 | 267 |
262 uint64_t m_scrollLayerID; | |
263 | |
264 IntRect m_compositedBounds; | 268 IntRect m_compositedBounds; |
265 | 269 |
266 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work | 270 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work |
267 bool m_boundsConstrainedByClipping; | 271 bool m_boundsConstrainedByClipping; |
268 bool m_isMainFrameRenderViewLayer; | 272 bool m_isMainFrameRenderViewLayer; |
269 bool m_requiresOwnBackingStore; | 273 bool m_requiresOwnBackingStore; |
270 bool m_canCompositeFilters; | 274 bool m_canCompositeFilters; |
271 bool m_backgroundLayerPaintsFixedRootBackground; | 275 bool m_backgroundLayerPaintsFixedRootBackground; |
272 }; | 276 }; |
273 | 277 |
274 } // namespace WebCore | 278 } // namespace WebCore |
275 | 279 |
276 #endif // RenderLayerBacking_h | 280 #endif // RenderLayerBacking_h |
OLD | NEW |