| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 NormalCompositingLayer, // non-tiled layer with backing store | 43 NormalCompositingLayer, // non-tiled layer with backing store |
| 44 MediaCompositingLayer, // layer that contains an image, video, webGL or plug
in | 44 MediaCompositingLayer, // layer that contains an image, video, webGL or plug
in |
| 45 ContainerCompositingLayer // layer with no backing store | 45 ContainerCompositingLayer // layer with no backing store |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 | 48 |
| 49 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt
ree of RenderLayers into a GraphicsLayer. | 49 // A GraphicsLayerPaintInfo contains all the info needed to paint a partial subt
ree of RenderLayers into a GraphicsLayer. |
| 50 struct GraphicsLayerPaintInfo { | 50 struct GraphicsLayerPaintInfo { |
| 51 RenderLayer* renderLayer; | 51 RenderLayer* renderLayer; |
| 52 | 52 |
| 53 IntRect compositedBounds; | 53 LayoutRect compositedBounds; |
| 54 | 54 |
| 55 IntSize offsetFromRenderer; | 55 IntSize offsetFromRenderer; |
| 56 | 56 |
| 57 GraphicsLayerPaintingPhase paintingPhase; | 57 GraphicsLayerPaintingPhase paintingPhase; |
| 58 | 58 |
| 59 bool isBackgroundLayer; | 59 bool isBackgroundLayer; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor
respond to | 62 // CompositedLayerMapping keeps track of how RenderLayers of the render tree cor
respond 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 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 // Interface to start, finish, suspend and resume animations and transitions | 138 // Interface to start, finish, suspend and resume animations and transitions |
| 139 bool startTransition(double, CSSPropertyID, const RenderStyle* fromStyle, co
nst RenderStyle* toStyle); | 139 bool startTransition(double, CSSPropertyID, const RenderStyle* fromStyle, co
nst RenderStyle* toStyle); |
| 140 void transitionPaused(double timeOffset, CSSPropertyID); | 140 void transitionPaused(double timeOffset, CSSPropertyID); |
| 141 void transitionFinished(CSSPropertyID); | 141 void transitionFinished(CSSPropertyID); |
| 142 | 142 |
| 143 bool startAnimation(double timeOffset, const CSSAnimationData*, const Keyfra
meList& keyframes); | 143 bool startAnimation(double timeOffset, const CSSAnimationData*, const Keyfra
meList& keyframes); |
| 144 void animationPaused(double timeOffset, const String& name); | 144 void animationPaused(double timeOffset, const String& name); |
| 145 void animationFinished(const String& name); | 145 void animationFinished(const String& name); |
| 146 | 146 |
| 147 IntRect compositedBounds() const; | 147 LayoutRect compositedBounds() const; |
| 148 void setCompositedBounds(const IntRect&); | 148 void setCompositedBounds(const LayoutRect&); |
| 149 void updateCompositedBounds(); | 149 void updateCompositedBounds(); |
| 150 | 150 |
| 151 void updateAfterWidgetResize(); | 151 void updateAfterWidgetResize(); |
| 152 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); | 152 void positionOverflowControlsLayers(const IntSize& offsetFromRoot); |
| 153 bool hasUnpositionedOverflowControlsLayers() const; | 153 bool hasUnpositionedOverflowControlsLayers() const; |
| 154 | 154 |
| 155 // GraphicsLayerClient interface | 155 // GraphicsLayerClient interface |
| 156 virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime)
OVERRIDE; | 156 virtual void notifyAnimationStarted(const GraphicsLayer*, double startTime)
OVERRIDE; |
| 157 | 157 |
| 158 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& clip) OVERRIDE; | 158 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& clip) OVERRIDE; |
| 159 | 159 |
| 160 virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE; | 160 virtual void didCommitChangesForLayer(const GraphicsLayer*) const OVERRIDE; |
| 161 virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&
) const OVERRIDE; | 161 virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&
) const OVERRIDE; |
| 162 | 162 |
| 163 virtual bool isTrackingRepaints() const OVERRIDE; | 163 virtual bool isTrackingRepaints() const OVERRIDE; |
| 164 | 164 |
| 165 PassOwnPtr<Vector<FloatRect> > collectTrackedRepaintRects() const; | 165 PassOwnPtr<Vector<FloatRect> > collectTrackedRepaintRects() const; |
| 166 | 166 |
| 167 #ifndef NDEBUG | 167 #ifndef NDEBUG |
| 168 virtual void verifyNotPainting(); | 168 virtual void verifyNotPainting(); |
| 169 #endif | 169 #endif |
| 170 | 170 |
| 171 IntRect contentsBox() const; | 171 LayoutRect contentsBox() const; |
| 172 IntRect backgroundBox() const; | 172 IntRect backgroundBox() const; |
| 173 | 173 |
| 174 // For informative purposes only. | 174 // For informative purposes only. |
| 175 CompositingLayerType compositingLayerType() const; | 175 CompositingLayerType compositingLayerType() const; |
| 176 | 176 |
| 177 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } | 177 GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizo
ntalScrollbar.get(); } |
| 178 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } | 178 GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVertical
Scrollbar.get(); } |
| 179 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } | 179 GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.
get(); } |
| 180 | 180 |
| 181 void updateFilters(const RenderStyle*); | 181 void updateFilters(const RenderStyle*); |
| 182 bool canCompositeFilters() const { return m_canCompositeFilters; } | 182 bool canCompositeFilters() const { return m_canCompositeFilters; } |
| 183 | 183 |
| 184 // Return an estimate of the backing store area (in pixels) allocated by thi
s object's GraphicsLayers. | 184 // Return an estimate of the backing store area (in pixels) allocated by thi
s object's GraphicsLayers. |
| 185 double backingStoreMemoryEstimate() const; | 185 double backingStoreMemoryEstimate() const; |
| 186 | 186 |
| 187 void setBlendMode(BlendMode); | 187 void setBlendMode(BlendMode); |
| 188 | 188 |
| 189 virtual String debugName(const GraphicsLayer*) OVERRIDE; | 189 virtual String debugName(const GraphicsLayer*) OVERRIDE; |
| 190 | 190 |
| 191 LayoutSize subpixelAccumulation() const { return m_subpixelAccumulation; } |
| 191 private: | 192 private: |
| 192 void createPrimaryGraphicsLayer(); | 193 void createPrimaryGraphicsLayer(); |
| 193 void destroyGraphicsLayers(); | 194 void destroyGraphicsLayers(); |
| 194 | 195 |
| 195 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); | 196 PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons); |
| 196 | 197 |
| 197 RenderLayerModelObject* renderer() const { return m_owningLayer->renderer();
} | 198 RenderLayerModelObject* renderer() const { return m_owningLayer->renderer();
} |
| 198 RenderLayerCompositor* compositor() const { return m_owningLayer->compositor
(); } | 199 RenderLayerCompositor* compositor() const { return m_owningLayer->compositor
(); } |
| 199 | 200 |
| 200 void updateInternalHierarchy(); | 201 void updateInternalHierarchy(); |
| 201 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); | 202 bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip); |
| 202 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer); | 203 bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool n
eedsVerticalScrollbarLayer, bool needsScrollCornerLayer); |
| 203 bool updateForegroundLayer(bool needsForegroundLayer); | 204 bool updateForegroundLayer(bool needsForegroundLayer); |
| 204 bool updateBackgroundLayer(bool needsBackgroundLayer); | 205 bool updateBackgroundLayer(bool needsBackgroundLayer); |
| 205 bool updateMaskLayer(bool needsMaskLayer); | 206 bool updateMaskLayer(bool needsMaskLayer); |
| 206 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); | 207 bool updateClippingMaskLayers(bool needsChildClippingMaskLayer); |
| 207 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->scroll
ableArea() && m_owningLayer->scrollableArea()->horizontalScrollbar(); } | 208 bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->scroll
ableArea() && m_owningLayer->scrollableArea()->horizontalScrollbar(); } |
| 208 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->scrollab
leArea() && m_owningLayer->scrollableArea()->verticalScrollbar(); } | 209 bool requiresVerticalScrollbarLayer() const { return m_owningLayer->scrollab
leArea() && m_owningLayer->scrollableArea()->verticalScrollbar(); } |
| 209 bool requiresScrollCornerLayer() const { return m_owningLayer->scrollableAre
a() && !m_owningLayer->scrollableArea()->scrollCornerAndResizerRect().isEmpty();
} | 210 bool requiresScrollCornerLayer() const { return m_owningLayer->scrollableAre
a() && !m_owningLayer->scrollableArea()->scrollCornerAndResizerRect().isEmpty();
} |
| 210 bool updateScrollingLayers(bool scrollingLayers); | 211 bool updateScrollingLayers(bool scrollingLayers); |
| 211 void updateScrollParent(RenderLayer*); | 212 void updateScrollParent(RenderLayer*); |
| 212 void updateClipParent(RenderLayer*); | 213 void updateClipParent(RenderLayer*); |
| 213 void updateDrawsContent(bool isSimpleContainer); | 214 void updateDrawsContent(bool isSimpleContainer); |
| 214 void registerScrollingLayers(); | 215 void registerScrollingLayers(); |
| 215 | 216 |
| 217 void adjustBoundsForSubPixelAccumulation(const RenderLayer* compositedAncest
or, IntRect& localCompositingBounds, IntRect& relativeCompositingBounds, IntPoin
t& delta); |
| 218 |
| 216 void setBackgroundLayerPaintsFixedRootBackground(bool); | 219 void setBackgroundLayerPaintsFixedRootBackground(bool); |
| 217 | 220 |
| 218 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; | 221 GraphicsLayerPaintingPhase paintingPhaseForPrimaryLayer() const; |
| 219 | 222 |
| 220 IntSize contentOffsetInCompostingLayer() const; | 223 LayoutSize contentOffsetInCompostingLayer() const; |
| 221 // Result is transform origin in pixels. | 224 // Result is transform origin in pixels. |
| 222 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; | 225 FloatPoint3D computeTransformOrigin(const IntRect& borderBox) const; |
| 223 // Result is perspective origin in pixels. | 226 // Result is perspective origin in pixels. |
| 224 FloatPoint computePerspectiveOrigin(const IntRect& borderBox) const; | 227 FloatPoint computePerspectiveOrigin(const IntRect& borderBox) const; |
| 225 | 228 |
| 226 void updateOpacity(const RenderStyle*); | 229 void updateOpacity(const RenderStyle*); |
| 227 void updateTransform(const RenderStyle*); | 230 void updateTransform(const RenderStyle*); |
| 228 void updateLayerBlendMode(const RenderStyle*); | 231 void updateLayerBlendMode(const RenderStyle*); |
| 229 // Return the opacity value that this layer should use for compositing. | 232 // Return the opacity value that this layer should use for compositing. |
| 230 float compositingOpacity(float rendererOpacity) const; | 233 float compositingOpacity(float rendererOpacity) const; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 // the background layer (or repainting). | 324 // the background layer (or repainting). |
| 322 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. | 325 OwnPtr<GraphicsLayer> m_foregroundLayer; // Only used in cases where we need
to draw the foreground separately. |
| 323 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. | 326 OwnPtr<GraphicsLayer> m_backgroundLayer; // Only used in cases where we need
to draw the background separately. |
| 324 | 327 |
| 325 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 328 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
| 326 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 329 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 327 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 330 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 328 | 331 |
| 329 OwnPtr<WebAnimationProvider> m_animationProvider; | 332 OwnPtr<WebAnimationProvider> m_animationProvider; |
| 330 | 333 |
| 331 IntRect m_compositedBounds; | 334 LayoutRect m_compositedBounds; |
| 335 LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of the
compositedBounds compared to absolute coordinates. |
| 332 | 336 |
| 333 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work | 337 bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make
transform-origin work |
| 334 bool m_boundsConstrainedByClipping; | 338 bool m_boundsConstrainedByClipping; |
| 335 bool m_isMainFrameRenderViewLayer; | 339 bool m_isMainFrameRenderViewLayer; |
| 336 bool m_requiresOwnBackingStoreForIntrinsicReasons; | 340 bool m_requiresOwnBackingStoreForIntrinsicReasons; |
| 337 bool m_requiresOwnBackingStoreForAncestorReasons; | 341 bool m_requiresOwnBackingStoreForAncestorReasons; |
| 338 bool m_canCompositeFilters; | 342 bool m_canCompositeFilters; |
| 339 bool m_backgroundLayerPaintsFixedRootBackground; | 343 bool m_backgroundLayerPaintsFixedRootBackground; |
| 340 }; | 344 }; |
| 341 | 345 |
| 342 } // namespace WebCore | 346 } // namespace WebCore |
| 343 | 347 |
| 344 #endif // CompositedLayerMapping_h | 348 #endif // CompositedLayerMapping_h |
| OLD | NEW |