Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: Source/core/rendering/compositing/RenderLayerCompositor.h

Issue 208313004: Cache the absolute bounding box rect on RenderLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add fixme Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // RenderLayerCompositor manages the hierarchy of 55 // RenderLayerCompositor manages the hierarchy of
56 // composited RenderLayers. It determines which RenderLayers 56 // composited RenderLayers. It determines which RenderLayers
57 // become compositing, and creates and maintains a hierarchy of 57 // become compositing, and creates and maintains a hierarchy of
58 // GraphicsLayers based on the RenderLayer painting order. 58 // GraphicsLayers based on the RenderLayer painting order.
59 // 59 //
60 // There is one RenderLayerCompositor per RenderView. 60 // There is one RenderLayerCompositor per RenderView.
61 61
62 class RenderLayerCompositor FINAL : public GraphicsLayerClient { 62 class RenderLayerCompositor FINAL : public GraphicsLayerClient {
63 WTF_MAKE_FAST_ALLOCATED; 63 WTF_MAKE_FAST_ALLOCATED;
64 public: 64 public:
65 enum BoundsUpdateType {
66 DoNotForceUpdate,
67 ForceUpdate,
68 };
69
65 // FIXME: This constructor should take a reference. 70 // FIXME: This constructor should take a reference.
66 explicit RenderLayerCompositor(RenderView&); 71 explicit RenderLayerCompositor(RenderView&);
67 virtual ~RenderLayerCompositor(); 72 virtual ~RenderLayerCompositor();
68 73
69 // Return true if this RenderView is in "compositing mode" (i.e. has one or more 74 // Return true if this RenderView is in "compositing mode" (i.e. has one or more
70 // composited RenderLayers) 75 // composited RenderLayers)
71 bool inCompositingMode() const { return m_compositing; } 76 bool inCompositingMode() const { return m_compositing; }
72 // This will make a compositing layer at the root automatically, and hook up to 77 // This will make a compositing layer at the root automatically, and hook up to
73 // the native view/window system. 78 // the native view/window system.
74 void enableCompositingMode(bool enable = true); 79 void enableCompositingMode(bool enable = true);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 CompositingReasons subtreeReasonsForCompositing(RenderObject*, bool hasCompo sitedDescendants, bool has3DTransformedDescendants) const; 264 CompositingReasons subtreeReasonsForCompositing(RenderObject*, bool hasCompo sitedDescendants, bool has3DTransformedDescendants) const;
260 265
261 // Make or destroy the CompositedLayerMapping for this layer; returns true i f the compositedLayerMapping changed. 266 // Make or destroy the CompositedLayerMapping for this layer; returns true i f the compositedLayerMapping changed.
262 bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTra nsitionType compositedLayerUpdate); 267 bool allocateOrClearCompositedLayerMapping(RenderLayer*, CompositingStateTra nsitionType compositedLayerUpdate);
263 bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta teTransitionType compositedLayerUpdate); 268 bool updateSquashingAssignment(RenderLayer*, SquashingState&, CompositingSta teTransitionType compositedLayerUpdate);
264 269
265 void clearMappingForRenderLayerIncludingDescendants(RenderLayer*); 270 void clearMappingForRenderLayerIncludingDescendants(RenderLayer*);
266 271
267 void recursiveRepaintLayer(RenderLayer*); 272 void recursiveRepaintLayer(RenderLayer*);
268 273
269 void addToOverlapMap(OverlapMap&, RenderLayer*, IntRect& layerBounds); 274 void addToOverlapMap(OverlapMap&, RenderLayer*, const IntRect& layerBounds);
270 275
271 // Forces an update for all frames of frame tree recursively. Used only when the mainFrame compositor is ready to 276 // Forces an update for all frames of frame tree recursively. Used only when the mainFrame compositor is ready to
272 // finish all deferred work. 277 // finish all deferred work.
273 static void finishCompositingUpdateForFrameTree(LocalFrame*); 278 static void finishCompositingUpdateForFrameTree(LocalFrame*);
274 279
275 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer* , OverlapMap*, struct CompositingRecursionData&, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingB ox); 280 void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer* , OverlapMap*, struct CompositingRecursionData&, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants, IntRect& absoluteDecendantBoundingB ox);
276 281
277 // Defines which RenderLayers will paint into which composited backings, by allocating and destroying CompositedLayerMappings as needed. 282 // Defines which RenderLayers will paint into which composited backings, by allocating and destroying CompositedLayerMappings as needed.
278 void assignLayersToBackings(RenderLayer*, bool& layersChanged); 283 void assignLayersToBackings(RenderLayer*, bool& layersChanged);
279 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& lay ersChanged, RenderLayer* clippingAncestor); 284 void assignLayersToBackingsInternal(RenderLayer*, SquashingState&, bool& lay ersChanged, RenderLayer* clippingAncestor);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 CompositingReasonFinder m_compositingReasonFinder; 341 CompositingReasonFinder m_compositingReasonFinder;
337 342
338 bool m_hasAcceleratedCompositing; 343 bool m_hasAcceleratedCompositing;
339 bool m_showRepaintCounter; 344 bool m_showRepaintCounter;
340 345
341 // FIXME: This should absolutely not be mutable. 346 // FIXME: This should absolutely not be mutable.
342 mutable bool m_needsToRecomputeCompositingRequirements; 347 mutable bool m_needsToRecomputeCompositingRequirements;
343 bool m_needsToUpdateLayerTreeGeometry; 348 bool m_needsToUpdateLayerTreeGeometry;
344 GraphicsLayerUpdater::UpdateType m_pendingUpdateType; 349 GraphicsLayerUpdater::UpdateType m_pendingUpdateType;
345 350
351 RenderLayerCompositor::BoundsUpdateType m_recomputeLayerBoundsUpdateType;
352
353 bool m_canUseCachedLayerBoundingBoxes;
346 bool m_compositing; 354 bool m_compositing;
347 bool m_compositingLayersNeedRebuild; 355 bool m_compositingLayersNeedRebuild;
348 bool m_forceCompositingMode; 356 bool m_forceCompositingMode;
349 bool m_needsUpdateCompositingRequirementsState; 357 bool m_needsUpdateCompositingRequirementsState;
350 358
351 bool m_isTrackingRepaints; // Used for testing. 359 bool m_isTrackingRepaints; // Used for testing.
352 360
353 RootLayerAttachment m_rootLayerAttachment; 361 RootLayerAttachment m_rootLayerAttachment;
354 362
355 // Enclosing container layer, which clips for iframe content 363 // Enclosing container layer, which clips for iframe content
(...skipping 16 matching lines...) Expand all
372 OwnPtr<GraphicsLayer> m_layerForScrollCorner; 380 OwnPtr<GraphicsLayer> m_layerForScrollCorner;
373 #if USE(RUBBER_BANDING) 381 #if USE(RUBBER_BANDING)
374 OwnPtr<GraphicsLayer> m_layerForOverhangShadow; 382 OwnPtr<GraphicsLayer> m_layerForOverhangShadow;
375 #endif 383 #endif
376 }; 384 };
377 385
378 386
379 } // namespace WebCore 387 } // namespace WebCore
380 388
381 #endif // RenderLayerCompositor_h 389 #endif // RenderLayerCompositor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698