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

Side by Side Diff: Source/core/rendering/RenderLayer.h

Issue 88863002: Land layer squashing behind a flag (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed reviewer feedback Created 7 years 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) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 CompositedLayerMappingPtr compositedLayerMapping() const { return m_composit edLayerMapping.get(); } 348 CompositedLayerMappingPtr compositedLayerMapping() const { return m_composit edLayerMapping.get(); }
349 CompositedLayerMappingPtr ensureCompositedLayerMapping(); 349 CompositedLayerMappingPtr ensureCompositedLayerMapping();
350 350
351 // NOTE: If you are using hasCompositedLayerMapping to determine the state o f compositing for this layer, 351 // NOTE: If you are using hasCompositedLayerMapping to determine the state o f compositing for this layer,
352 // (and not just to do bookkeeping related to the mapping like, say, allocat ing or deallocating a mapping), 352 // (and not just to do bookkeeping related to the mapping like, say, allocat ing or deallocating a mapping),
353 // then you may have incorrect logic. Use compositingState() instead. 353 // then you may have incorrect logic. Use compositingState() instead.
354 bool hasCompositedLayerMapping() const { return m_compositedLayerMapping.get (); } 354 bool hasCompositedLayerMapping() const { return m_compositedLayerMapping.get (); }
355 void clearCompositedLayerMapping(bool layerBeingDestroyed = false); 355 void clearCompositedLayerMapping(bool layerBeingDestroyed = false);
356 356
357 CompositedLayerMapping* groupedMapping() const { return m_groupedMapping; }
358 void setGroupedMapping(CompositedLayerMapping* groupedMapping) { m_groupedMa pping = groupedMapping; }
359
357 bool hasCompositedMask() const; 360 bool hasCompositedMask() const;
358 bool hasCompositedClippingMask() const; 361 bool hasCompositedClippingMask() const;
359 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); } 362 bool needsCompositedScrolling() const { return m_scrollableArea && m_scrolla bleArea->needsCompositedScrolling(); }
360 363
361 RenderLayer* scrollParent() const; 364 RenderLayer* scrollParent() const;
362 RenderLayer* clipParent() const; 365 RenderLayer* clipParent() const;
363 366
364 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const; 367 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
365 bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, c onst RenderStyle* newStyle) const; 368 bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, c onst RenderStyle* newStyle) const;
366 bool needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, co nst RenderStyle* newStyle, bool didPaintWithFilters) const; 369 bool needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, co nst RenderStyle* newStyle, bool didPaintWithFilters) const;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 // RenderObject::canContainFixedPositionedObject() should probably be us ed 439 // RenderObject::canContainFixedPositionedObject() should probably be us ed
437 // instead. 440 // instead.
438 RenderLayerModelObject* layerRenderer = renderer(); 441 RenderLayerModelObject* layerRenderer = renderer();
439 return isRootLayer() || layerRenderer->isPositioned() || hasTransform(); 442 return isRootLayer() || layerRenderer->isPositioned() || hasTransform();
440 } 443 }
441 444
442 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags) ; 445 void paintLayer(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags) ;
443 446
444 PassOwnPtr<Vector<FloatRect> > collectTrackedRepaintRects() const; 447 PassOwnPtr<Vector<FloatRect> > collectTrackedRepaintRects() const;
445 448
449 void setOffsetFromSquashingLayerOrigin(IntSize offset) { m_compositingProper ties.offsetFromSquashingLayerOrigin = offset; }
450 IntSize offsetFromSquashingLayerOrigin() const { return m_compositingPropert ies.offsetFromSquashingLayerOrigin; }
451
446 private: 452 private:
447 bool hasOverflowControls() const; 453 bool hasOverflowControls() const;
448 454
449 void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDes cendant = isUnclippedDescendant; } 455 void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDes cendant = isUnclippedDescendant; }
450 456
451 void setAncestorChainHasSelfPaintingLayerDescendant(); 457 void setAncestorChainHasSelfPaintingLayerDescendant();
452 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 458 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
453 459
454 void setAncestorChainHasOutOfFlowPositionedDescendant(); 460 void setAncestorChainHasOutOfFlowPositionedDescendant();
455 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); 461 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 603
598 bool hasCompositingDescendant() const { return m_compositingProperties.hasCo mpositingDescendant; } 604 bool hasCompositingDescendant() const { return m_compositingProperties.hasCo mpositingDescendant; }
599 void setHasCompositingDescendant(bool b) { m_compositingProperties.hasCompo sitingDescendant = b; } 605 void setHasCompositingDescendant(bool b) { m_compositingProperties.hasCompo sitingDescendant = b; }
600 606
601 bool hasNonCompositedChild() const { return m_compositingProperties.hasNonCo mpositedChild; } 607 bool hasNonCompositedChild() const { return m_compositingProperties.hasNonCo mpositedChild; }
602 void setHasNonCompositedChild(bool b) { m_compositingProperties.hasNonCompo sitedChild = b; } 608 void setHasNonCompositedChild(bool b) { m_compositingProperties.hasNonCompo sitedChild = b; }
603 609
604 void setCompositingReasons(CompositingReasons reasons) { m_compositingProper ties.compositingReasons = reasons; } 610 void setCompositingReasons(CompositingReasons reasons) { m_compositingProper ties.compositingReasons = reasons; }
605 CompositingReasons compositingReasons() const { return m_compositingProperti es.compositingReasons; } 611 CompositingReasons compositingReasons() const { return m_compositingProperti es.compositingReasons; }
606 612
613 // Absolute bounds are cached here only for compositing computations. This i s NOT GUARATNEED
614 // to be up-to-date for every layer; do not use this unless you know what yo u are doing.
615 void setAbsoluteBounds(IntRect absoluteBounds) { m_compositingProperties.abs oluteBounds = absoluteBounds; }
616 IntRect absoluteBounds() const { return m_compositingProperties.absoluteBoun ds; }
617
607 friend class CompositedLayerMapping; 618 friend class CompositedLayerMapping;
608 friend class RenderLayerCompositor; 619 friend class RenderLayerCompositor;
609 friend class RenderLayerModelObject; 620 friend class RenderLayerModelObject;
610 621
611 protected: 622 protected:
612 unsigned m_isSelfPaintingLayer : 1; 623 unsigned m_isSelfPaintingLayer : 1;
613 624
614 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to 625 // If have no self-painting descendants, we don't have to walk our children during painting. This can lead to
615 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells). 626 // significant savings, especially if the tree has lots of non-self-painting layers grouped together (e.g. table cells).
616 unsigned m_hasSelfPaintingLayerDescendant : 1; 627 unsigned m_hasSelfPaintingLayerDescendant : 1;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 713
703 // Applies to the real render layer tree (i.e., the tree determined by t he layer's parent and children and 714 // Applies to the real render layer tree (i.e., the tree determined by t he layer's parent and children and
704 // as opposed to the tree formed by the z-order and normal flow lists). 715 // as opposed to the tree formed by the z-order and normal flow lists).
705 bool hasNonCompositedChild : 1; 716 bool hasNonCompositedChild : 1;
706 717
707 // The reason, if any exists, that a fixed-position layer is chosen not to be composited. 718 // The reason, if any exists, that a fixed-position layer is chosen not to be composited.
708 unsigned viewportConstrainedNotCompositedReason : 2; 719 unsigned viewportConstrainedNotCompositedReason : 2;
709 720
710 // Once computed, indicates all that a layer needs to become composited using the CompositingReasons enum bitfield. 721 // Once computed, indicates all that a layer needs to become composited using the CompositingReasons enum bitfield.
711 CompositingReasons compositingReasons; 722 CompositingReasons compositingReasons;
723
724 // Bounds of the layer in absolute coordinates. It is cached here only s o that we can
725 // compute correct offsets for where layers should paint into their comp osited backings.
726 IntRect absoluteBounds;
727
728 // Used for invalidating this layer's contents on the squashing Graphics Layer.
729 IntSize offsetFromSquashingLayerOrigin;
712 }; 730 };
713 731
714 CompositingProperties m_compositingProperties; 732 CompositingProperties m_compositingProperties;
715 733
716 private: 734 private:
717 enum CompositedScrollingHistogramBuckets { 735 enum CompositedScrollingHistogramBuckets {
718 IsScrollableAreaBucket = 0, 736 IsScrollableAreaBucket = 0,
719 NeedsToBeStackingContainerBucket = 1, 737 NeedsToBeStackingContainerBucket = 1,
720 WillUseCompositedScrollingBucket = 2, 738 WillUseCompositedScrollingBucket = 2,
721 CompositedScrollingHistogramMax = 3 739 CompositedScrollingHistogramMax = 3
722 }; 740 };
723 741
724 IntRect m_blockSelectionGapsBounds; 742 IntRect m_blockSelectionGapsBounds;
725 743
726 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping; 744 OwnPtr<CompositedLayerMapping> m_compositedLayerMapping;
727 OwnPtr<RenderLayerScrollableArea> m_scrollableArea; 745 OwnPtr<RenderLayerScrollableArea> m_scrollableArea;
728 746
747 CompositedLayerMapping* m_groupedMapping;
748
729 RenderLayerRepainter m_repainter; 749 RenderLayerRepainter m_repainter;
730 RenderLayerClipper m_clipper; // FIXME: Lazily allocate? 750 RenderLayerClipper m_clipper; // FIXME: Lazily allocate?
731 OwnPtr<RenderLayerStackingNode> m_stackingNode; 751 OwnPtr<RenderLayerStackingNode> m_stackingNode;
732 OwnPtr<RenderLayerReflectionInfo> m_reflectionInfo; 752 OwnPtr<RenderLayerReflectionInfo> m_reflectionInfo;
733 }; 753 };
734 754
735 } // namespace WebCore 755 } // namespace WebCore
736 756
737 #ifndef NDEBUG 757 #ifndef NDEBUG
738 // Outside the WebCore namespace for ease of invocation from gdb. 758 // Outside the WebCore namespace for ease of invocation from gdb.
739 void showLayerTree(const WebCore::RenderLayer*); 759 void showLayerTree(const WebCore::RenderLayer*);
740 void showLayerTree(const WebCore::RenderObject*); 760 void showLayerTree(const WebCore::RenderObject*);
741 #endif 761 #endif
742 762
743 #endif // RenderLayer_h 763 #endif // RenderLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698