| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 void setTracksRepaints(bool); | 183 void setTracksRepaints(bool); |
| 184 | 184 |
| 185 void setNeedsToRecomputeCompositingRequirements() { m_needsToRecomputeCompos
itingRequirements = true; } | 185 void setNeedsToRecomputeCompositingRequirements() { m_needsToRecomputeCompos
itingRequirements = true; } |
| 186 | 186 |
| 187 virtual String debugName(const GraphicsLayer*) OVERRIDE; | 187 virtual String debugName(const GraphicsLayer*) OVERRIDE; |
| 188 | 188 |
| 189 void updateStyleDeterminedCompositingReasons(RenderLayer*); | 189 void updateStyleDeterminedCompositingReasons(RenderLayer*); |
| 190 | 190 |
| 191 void scheduleAnimationIfNeeded(); | 191 void scheduleAnimationIfNeeded(); |
| 192 | 192 |
| 193 // Whether the layer could ever be composited. |
| 194 bool canBeComposited(const RenderLayer*) const; |
| 195 |
| 193 private: | 196 private: |
| 194 class OverlapMap; | 197 class OverlapMap; |
| 195 | 198 |
| 196 enum CompositingStateTransitionType { | 199 enum CompositingStateTransitionType { |
| 197 NoCompositingStateChange, | 200 NoCompositingStateChange, |
| 198 AllocateOwnCompositedLayerMapping, | 201 AllocateOwnCompositedLayerMapping, |
| 199 RemoveOwnCompositedLayerMapping, | 202 RemoveOwnCompositedLayerMapping, |
| 200 PutInSquashingLayer, | 203 PutInSquashingLayer, |
| 201 RemoveFromSquashingLayer | 204 RemoveFromSquashingLayer |
| 202 }; | 205 }; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 231 bool updateLayerIfViewportConstrained(RenderLayer*); | 234 bool updateLayerIfViewportConstrained(RenderLayer*); |
| 232 | 235 |
| 233 // GraphicsLayerClient implementation | 236 // GraphicsLayerClient implementation |
| 234 virtual void notifyAnimationStarted(const GraphicsLayer*, double) OVERRIDE {
} | 237 virtual void notifyAnimationStarted(const GraphicsLayer*, double) OVERRIDE {
} |
| 235 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect&) OVERRIDE; | 238 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect&) OVERRIDE; |
| 236 | 239 |
| 237 virtual bool isTrackingRepaints() const OVERRIDE; | 240 virtual bool isTrackingRepaints() const OVERRIDE; |
| 238 | 241 |
| 239 // Whether the given RL needs to paint into its own separate backing (and he
nce would need its own CompositedLayerMapping). | 242 // Whether the given RL needs to paint into its own separate backing (and he
nce would need its own CompositedLayerMapping). |
| 240 bool needsOwnBacking(const RenderLayer*) const; | 243 bool needsOwnBacking(const RenderLayer*) const; |
| 241 // Whether the layer could ever be composited. | |
| 242 bool canBeComposited(const RenderLayer*) const; | |
| 243 | 244 |
| 244 void updateDirectCompositingReasons(RenderLayer*); | 245 void updateDirectCompositingReasons(RenderLayer*); |
| 245 | 246 |
| 246 void updateIfNeeded(); | 247 void updateIfNeeded(); |
| 247 | 248 |
| 248 // Returns indirect reasons that a layer should be composited because of som
ething in its subtree. | |
| 249 CompositingReasons subtreeReasonsForCompositing(RenderObject*, bool hasCompo
sitedDescendants, bool has3DTransformedDescendants) const; | |
| 250 | |
| 251 // Make or destroy the CompositedLayerMapping for this layer; returns true i
f the compositedLayerMapping changed. | 249 // Make or destroy the CompositedLayerMapping for this layer; returns true i
f the compositedLayerMapping changed. |
| 252 bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTra
nsitionType compositedLayerUpdate); | 250 bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTra
nsitionType compositedLayerUpdate); |
| 253 bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta
teTransitionType compositedLayerUpdate); | 251 bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta
teTransitionType compositedLayerUpdate); |
| 254 | 252 |
| 255 void recursiveRepaintLayer(RenderLayer*); | 253 void recursiveRepaintLayer(RenderLayer*); |
| 256 | 254 |
| 257 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*
, OverlapMap&, struct CompositingRecursionData&, bool& descendantHas3DTransform,
Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingB
ox); | 255 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*
, OverlapMap&, struct CompositingRecursionData&, bool& descendantHas3DTransform,
Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingB
ox); |
| 258 | 256 |
| 259 // Defines which RenderLayers will paint into which composited backings, by
allocating and destroying CompositedLayerMappings as needed. | 257 // Defines which RenderLayers will paint into which composited backings, by
allocating and destroying CompositedLayerMappings as needed. |
| 260 void assignLayersToBackings(RenderLayer*, bool& layersChanged); | 258 void assignLayersToBackings(RenderLayer*, bool& layersChanged); |
| 261 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& lay
ersChanged); | 259 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& lay
ersChanged); |
| 262 | 260 |
| 263 // Hook compositing layers together | 261 // Hook compositing layers together |
| 264 void setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
; | 262 void setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
; |
| 265 void removeCompositedChildren(RenderLayer*); | 263 void removeCompositedChildren(RenderLayer*); |
| 266 | 264 |
| 267 bool isRunningAcceleratedTransformAnimation(RenderObject*) const; | |
| 268 | |
| 269 bool hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const; | 265 bool hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const; |
| 270 | 266 |
| 271 void ensureRootLayer(); | 267 void ensureRootLayer(); |
| 272 void destroyRootLayer(); | 268 void destroyRootLayer(); |
| 273 | 269 |
| 274 void attachRootLayer(RootLayerAttachment); | 270 void attachRootLayer(RootLayerAttachment); |
| 275 void detachRootLayer(); | 271 void detachRootLayer(); |
| 276 | 272 |
| 277 bool isMainFrame() const; | 273 bool isMainFrame() const; |
| 278 | 274 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 334 |
| 339 // Layers for overflow controls | 335 // Layers for overflow controls |
| 340 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; | 336 OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar; |
| 341 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; | 337 OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar; |
| 342 OwnPtr<GraphicsLayer> m_layerForScrollCorner; | 338 OwnPtr<GraphicsLayer> m_layerForScrollCorner; |
| 343 #if USE(RUBBER_BANDING) | 339 #if USE(RUBBER_BANDING) |
| 344 OwnPtr<GraphicsLayer> m_layerForOverhangShadow; | 340 OwnPtr<GraphicsLayer> m_layerForOverhangShadow; |
| 345 #endif | 341 #endif |
| 346 }; | 342 }; |
| 347 | 343 |
| 348 | |
| 349 } // namespace WebCore | 344 } // namespace WebCore |
| 350 | 345 |
| 351 #endif // RenderLayerCompositor_h | 346 #endif // RenderLayerCompositor_h |
| OLD | NEW |