| 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 19 matching lines...) Expand all Loading... |
| 30 #include "FloatPoint3D.h" | 30 #include "FloatPoint3D.h" |
| 31 #include "GraphicsLayer.h" | 31 #include "GraphicsLayer.h" |
| 32 #include "GraphicsLayerClient.h" | 32 #include "GraphicsLayerClient.h" |
| 33 #include "RenderLayer.h" | 33 #include "RenderLayer.h" |
| 34 #include "TransformationMatrix.h" | 34 #include "TransformationMatrix.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 class KeyframeList; | 38 class KeyframeList; |
| 39 class RenderLayerCompositor; | 39 class RenderLayerCompositor; |
| 40 class TiledBacking; | |
| 41 | 40 |
| 42 enum CompositingLayerType { | 41 enum CompositingLayerType { |
| 43 NormalCompositingLayer, // non-tiled layer with backing store | 42 NormalCompositingLayer, // non-tiled layer with backing store |
| 44 MediaCompositingLayer, // layer that contains an image, video, webGL or plug
in | 43 MediaCompositingLayer, // layer that contains an image, video, webGL or plug
in |
| 45 ContainerCompositingLayer // layer with no backing store | 44 ContainerCompositingLayer // layer with no backing store |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 // RenderLayerBacking controls the compositing behavior for a single RenderLayer
. | 47 // RenderLayerBacking controls the compositing behavior for a single RenderLayer
. |
| 49 // It holds the various GraphicsLayers, and makes decisions about intra-layer re
ndering | 48 // It holds the various GraphicsLayers, and makes decisions about intra-layer re
ndering |
| 50 // optimizations. | 49 // optimizations. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 70 // Returns true if layer configuration changed. | 69 // Returns true if layer configuration changed. |
| 71 bool updateGraphicsLayerConfiguration(); | 70 bool updateGraphicsLayerConfiguration(); |
| 72 // Update graphics layer position and bounds. | 71 // Update graphics layer position and bounds. |
| 73 void updateGraphicsLayerGeometry(); // make private | 72 void updateGraphicsLayerGeometry(); // make private |
| 74 // Update contents and clipping structure. | 73 // Update contents and clipping structure. |
| 75 void updateDrawsContent(); | 74 void updateDrawsContent(); |
| 76 | 75 |
| 77 GraphicsLayer* graphicsLayer() const { return m_graphicsLayer.get(); } | 76 GraphicsLayer* graphicsLayer() const { return m_graphicsLayer.get(); } |
| 78 | 77 |
| 79 // Layer to clip children | 78 // Layer to clip children |
| 80 bool hasClippingLayer() const { return (m_childContainmentLayer && !m_usingT
iledCacheLayer); } | 79 bool hasClippingLayer() const { return m_childContainmentLayer; } |
| 81 GraphicsLayer* clippingLayer() const { return !m_usingTiledCacheLayer ? m_ch
ildContainmentLayer.get() : 0; } | 80 GraphicsLayer* clippingLayer() const { return m_childContainmentLayer.get();
} |
| 82 | 81 |
| 83 // Layer to get clipped by ancestor | 82 // Layer to get clipped by ancestor |
| 84 bool hasAncestorClippingLayer() const { return m_ancestorClippingLayer != 0;
} | 83 bool hasAncestorClippingLayer() const { return m_ancestorClippingLayer != 0;
} |
| 85 GraphicsLayer* ancestorClippingLayer() const { return m_ancestorClippingLaye
r.get(); } | 84 GraphicsLayer* ancestorClippingLayer() const { return m_ancestorClippingLaye
r.get(); } |
| 86 | 85 |
| 87 GraphicsLayer* contentsContainmentLayer() const { return m_contentsContainme
ntLayer.get(); } | 86 GraphicsLayer* contentsContainmentLayer() const { return m_contentsContainme
ntLayer.get(); } |
| 88 | 87 |
| 89 bool hasContentsLayer() const { return m_foregroundLayer != 0; } | 88 bool hasContentsLayer() const { return m_foregroundLayer != 0; } |
| 90 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } | 89 GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); } |
| 91 | 90 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 void updateImageContents(); | 238 void updateImageContents(); |
| 240 | 239 |
| 241 Color rendererBackgroundColor() const; | 240 Color rendererBackgroundColor() const; |
| 242 void updateBackgroundColor(bool isSimpleContainer); | 241 void updateBackgroundColor(bool isSimpleContainer); |
| 243 void updateContentsRect(bool isSimpleContainer); | 242 void updateContentsRect(bool isSimpleContainer); |
| 244 | 243 |
| 245 bool hasVisibleNonCompositingDescendantLayers() const; | 244 bool hasVisibleNonCompositingDescendantLayers() const; |
| 246 | 245 |
| 247 bool shouldClipCompositedBounds() const; | 246 bool shouldClipCompositedBounds() const; |
| 248 | 247 |
| 249 bool hasTiledBackingFlatteningLayer() const { return (m_childContainmentLaye
r && m_usingTiledCacheLayer); } | |
| 250 GraphicsLayer* tileCacheFlatteningLayer() const { return m_usingTiledCacheLa
yer ? m_childContainmentLayer.get() : 0; } | |
| 251 | |
| 252 void paintIntoLayer(const GraphicsLayer*, GraphicsContext*, const IntRect& p
aintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase); | 248 void paintIntoLayer(const GraphicsLayer*, GraphicsContext*, const IntRect& p
aintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase); |
| 253 | 249 |
| 254 static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); | 250 static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID); |
| 255 static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); | 251 static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID); |
| 256 | 252 |
| 257 RenderLayer* m_owningLayer; | 253 RenderLayer* m_owningLayer; |
| 258 | 254 |
| 259 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. |
| 260 OwnPtr<GraphicsLayer> m_contentsContainmentLayer; // Only used if we have a
background layer; takes the transform. | 256 OwnPtr<GraphicsLayer> m_contentsContainmentLayer; // Only used if we have a
background layer; takes the transform. |
| 261 OwnPtr<GraphicsLayer> m_graphicsLayer; | 257 OwnPtr<GraphicsLayer> m_graphicsLayer; |
| 262 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. |
| 263 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. |
| 264 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. |
| 265 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. | 261 OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask. |
| 266 | 262 |
| 267 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 263 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
| 268 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 264 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 269 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 265 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 270 | 266 |
| 271 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. |
| 272 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. |
| 273 | 269 |
| 274 uint64_t m_scrollLayerID; | 270 uint64_t m_scrollLayerID; |
| 275 | 271 |
| 276 IntRect m_compositedBounds; | 272 IntRect m_compositedBounds; |
| 277 | 273 |
| 278 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work | 274 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work |
| 279 bool m_boundsConstrainedByClipping; | 275 bool m_boundsConstrainedByClipping; |
| 280 bool m_isMainFrameRenderViewLayer; | 276 bool m_isMainFrameRenderViewLayer; |
| 281 bool m_usingTiledCacheLayer; | |
| 282 bool m_requiresOwnBackingStore; | 277 bool m_requiresOwnBackingStore; |
| 283 #if ENABLE(CSS_FILTERS) | 278 #if ENABLE(CSS_FILTERS) |
| 284 bool m_canCompositeFilters; | 279 bool m_canCompositeFilters; |
| 285 #endif | 280 #endif |
| 286 bool m_backgroundLayerPaintsFixedRootBackground; | 281 bool m_backgroundLayerPaintsFixedRootBackground; |
| 287 }; | 282 }; |
| 288 | 283 |
| 289 } // namespace WebCore | 284 } // namespace WebCore |
| 290 | 285 |
| 291 #endif // RenderLayerBacking_h | 286 #endif // RenderLayerBacking_h |
| OLD | NEW |