| OLD | NEW |
| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 bool hasVisibleBoxDecorations() const; | 199 bool hasVisibleBoxDecorations() const; |
| 200 // Returns true if this layer has visible content (ignoring any child layers
). | 200 // Returns true if this layer has visible content (ignoring any child layers
). |
| 201 bool isVisuallyNonEmpty() const; | 201 bool isVisuallyNonEmpty() const; |
| 202 // True if this layer container renderers that paint. | 202 // True if this layer container renderers that paint. |
| 203 bool hasNonEmptyChildRenderers() const; | 203 bool hasNonEmptyChildRenderers() const; |
| 204 | 204 |
| 205 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but
we hit the same bugs as visible content above. | 205 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but
we hit the same bugs as visible content above. |
| 206 // Part of the issue is with subtree relayout: we don't check if our ancesto
rs have some descendant flags dirty, missing some updates. | 206 // Part of the issue is with subtree relayout: we don't check if our ancesto
rs have some descendant flags dirty, missing some updates. |
| 207 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD
escendant; } | 207 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD
escendant; } |
| 208 | 208 |
| 209 // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty) here. S
ee above. | |
| 210 bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositio
nedDescendant; } | |
| 211 | |
| 212 void setHasOutOfFlowPositionedDescendant(bool hasDescendant) { m_hasOutOfFlo
wPositionedDescendant = hasDescendant; } | |
| 213 void setHasOutOfFlowPositionedDescendantDirty(bool dirty) { m_hasOutOfFlowPo
sitionedDescendantDirty = dirty; } | |
| 214 | |
| 215 void updateIsUnclippedDescendant(); | |
| 216 bool isUnclippedDescendant() const { return m_isUnclippedDescendant; } | |
| 217 | |
| 218 // Will ensure that hasNonCompositiedChild are up to date. | 209 // Will ensure that hasNonCompositiedChild are up to date. |
| 219 void updateScrollingStateAfterCompositingChange(); | 210 void updateScrollingStateAfterCompositingChange(); |
| 220 bool hasVisibleNonLayerContent() const { return m_hasVisibleNonLayerContent;
} | 211 bool hasVisibleNonLayerContent() const { return m_hasVisibleNonLayerContent;
} |
| 221 bool hasNonCompositedChild() const { ASSERT(isAllowedToQueryCompositingState
()); return m_hasNonCompositedChild; } | 212 bool hasNonCompositedChild() const { ASSERT(isAllowedToQueryCompositingState
()); return m_hasNonCompositedChild; } |
| 222 | 213 |
| 223 bool usedTransparency() const { return m_usedTransparency; } | 214 bool usedTransparency() const { return m_usedTransparency; } |
| 224 | 215 |
| 225 // Gets the nearest enclosing positioned ancestor layer (also includes | 216 // Gets the nearest enclosing positioned ancestor layer (also includes |
| 226 // the <html> layer and the root layer). | 217 // the <html> layer and the root layer). |
| 227 RenderLayer* enclosingPositionedAncestor() const; | 218 RenderLayer* enclosingPositionedAncestor() const; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 | 445 |
| 455 CompositingReasons styleDeterminedCompositingReasons() const { return m_styl
eDeterminedCompositingReasons; } | 446 CompositingReasons styleDeterminedCompositingReasons() const { return m_styl
eDeterminedCompositingReasons; } |
| 456 void setStyleDeterminedCompositingReasons(CompositingReasons reasons) { ASSE
RT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedReasons)); m_st
yleDeterminedCompositingReasons = reasons; } | 447 void setStyleDeterminedCompositingReasons(CompositingReasons reasons) { ASSE
RT(reasons == (reasons & CompositingReasonComboAllStyleDeterminedReasons)); m_st
yleDeterminedCompositingReasons = reasons; } |
| 457 | 448 |
| 458 class AncestorDependentProperties { | 449 class AncestorDependentProperties { |
| 459 public: | 450 public: |
| 460 AncestorDependentProperties() | 451 AncestorDependentProperties() |
| 461 : opacityAncestor(0) | 452 : opacityAncestor(0) |
| 462 , transformAncestor(0) | 453 , transformAncestor(0) |
| 463 , filterAncestor(0) | 454 , filterAncestor(0) |
| 455 , isUnclippedDescendant(false) |
| 464 { } | 456 { } |
| 465 | 457 |
| 466 IntRect clippedAbsoluteBoundingBox; | 458 IntRect clippedAbsoluteBoundingBox; |
| 467 const RenderLayer* opacityAncestor; | 459 const RenderLayer* opacityAncestor; |
| 468 const RenderLayer* transformAncestor; | 460 const RenderLayer* transformAncestor; |
| 469 const RenderLayer* filterAncestor; | 461 const RenderLayer* filterAncestor; |
| 462 unsigned isUnclippedDescendant : 1; |
| 470 }; | 463 }; |
| 471 | 464 |
| 472 void setNeedsToUpdateAncestorDependentProperties(); | 465 void setNeedsToUpdateAncestorDependentProperties(); |
| 473 bool childNeedsToUpdateAncestorDependantProperties() const { return m_childN
eedsToUpdateAncestorDependantProperties; } | 466 bool childNeedsToUpdateAncestorDependantProperties() const { return m_childN
eedsToUpdateAncestorDependantProperties; } |
| 474 bool needsToUpdateAncestorDependentProperties() const { return m_needsToUpda
teAncestorDependentProperties; } | 467 bool needsToUpdateAncestorDependentProperties() const { return m_needsToUpda
teAncestorDependentProperties; } |
| 475 | 468 |
| 476 void updateAncestorDependentProperties(const AncestorDependentProperties&); | 469 void updateAncestorDependentProperties(const AncestorDependentProperties&); |
| 477 void clearChildNeedsToUpdateAncestorDependantProperties(); | 470 void clearChildNeedsToUpdateAncestorDependantProperties(); |
| 478 | 471 |
| 479 const AncestorDependentProperties& ancestorDependentProperties() const { ASS
ERT(!m_needsToUpdateAncestorDependentProperties); return m_ancestorDependentProp
erties; } | 472 const AncestorDependentProperties& ancestorDependentProperties() const { ASS
ERT(!m_needsToUpdateAncestorDependentProperties); return m_ancestorDependentProp
erties; } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 503 LayoutPoint computeOffsetFromTransformedAncestor() const; | 496 LayoutPoint computeOffsetFromTransformedAncestor() const; |
| 504 | 497 |
| 505 void didUpdateNeedsCompositedScrolling(); | 498 void didUpdateNeedsCompositedScrolling(); |
| 506 | 499 |
| 507 private: | 500 private: |
| 508 // Bounding box in the coordinates of this layer. | 501 // Bounding box in the coordinates of this layer. |
| 509 LayoutRect logicalBoundingBox() const; | 502 LayoutRect logicalBoundingBox() const; |
| 510 | 503 |
| 511 bool hasOverflowControls() const; | 504 bool hasOverflowControls() const; |
| 512 | 505 |
| 513 void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDes
cendant = isUnclippedDescendant; } | |
| 514 | |
| 515 void setAncestorChainHasSelfPaintingLayerDescendant(); | 506 void setAncestorChainHasSelfPaintingLayerDescendant(); |
| 516 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 507 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| 517 | 508 |
| 518 void setAncestorChainHasOutOfFlowPositionedDescendant(); | |
| 519 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); | |
| 520 | |
| 521 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
PaintLayerFlags, BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 509 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&,
PaintLayerFlags, BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
| 522 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); | 510 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); |
| 523 | 511 |
| 524 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); | |
| 525 | |
| 526 // Returns true if the position changed. | 512 // Returns true if the position changed. |
| 527 bool updateLayerPosition(); | 513 bool updateLayerPosition(); |
| 528 | 514 |
| 529 enum UpdateLayerPositionsAfterScrollFlag { | 515 enum UpdateLayerPositionsAfterScrollFlag { |
| 530 NoFlag = 0, | 516 NoFlag = 0, |
| 531 IsOverflowScroll = 1 << 0, | 517 IsOverflowScroll = 1 << 0, |
| 532 HasSeenViewportConstrainedAncestor = 1 << 1, | 518 HasSeenViewportConstrainedAncestor = 1 << 1, |
| 533 HasSeenAncestorWithOverflowClip = 1 << 2, | 519 HasSeenAncestorWithOverflowClip = 1 << 2, |
| 534 HasChangedAncestor = 1 << 3 | 520 HasChangedAncestor = 1 << 3 |
| 535 }; | 521 }; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting | 616 // Self-painting layer is an optimization where we avoid the heavy RenderLay
er painting |
| 631 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. | 617 // machinery for a RenderLayer allocated only to handle the overflow clip ca
se. |
| 632 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. | 618 // FIXME(crbug.com/332791): Self-painting layer should be merged into the ov
erflow-only concept. |
| 633 unsigned m_isSelfPaintingLayer : 1; | 619 unsigned m_isSelfPaintingLayer : 1; |
| 634 | 620 |
| 635 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to | 621 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to |
| 636 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). | 622 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). |
| 637 unsigned m_hasSelfPaintingLayerDescendant : 1; | 623 unsigned m_hasSelfPaintingLayerDescendant : 1; |
| 638 unsigned m_hasSelfPaintingLayerDescendantDirty : 1; | 624 unsigned m_hasSelfPaintingLayerDescendantDirty : 1; |
| 639 | 625 |
| 640 unsigned m_hasOutOfFlowPositionedDescendant : 1; | |
| 641 unsigned m_hasOutOfFlowPositionedDescendantDirty : 1; | |
| 642 | |
| 643 unsigned m_isUnclippedDescendant : 1; | |
| 644 | |
| 645 const unsigned m_isRootLayer : 1; | 626 const unsigned m_isRootLayer : 1; |
| 646 | 627 |
| 647 unsigned m_usedTransparency : 1; // Tracks whether we need to close a transp
arent layer, i.e., whether | 628 unsigned m_usedTransparency : 1; // Tracks whether we need to close a transp
arent layer, i.e., whether |
| 648 // we ended up painting this layer or any desce
ndants (and therefore need to | 629 // we ended up painting this layer or any desce
ndants (and therefore need to |
| 649 // blend). | 630 // blend). |
| 650 | 631 |
| 651 unsigned m_visibleContentStatusDirty : 1; | 632 unsigned m_visibleContentStatusDirty : 1; |
| 652 unsigned m_hasVisibleContent : 1; | 633 unsigned m_hasVisibleContent : 1; |
| 653 unsigned m_visibleDescendantStatusDirty : 1; | 634 unsigned m_visibleDescendantStatusDirty : 1; |
| 654 unsigned m_hasVisibleDescendant : 1; | 635 unsigned m_hasVisibleDescendant : 1; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 | 727 |
| 747 } // namespace WebCore | 728 } // namespace WebCore |
| 748 | 729 |
| 749 #ifndef NDEBUG | 730 #ifndef NDEBUG |
| 750 // Outside the WebCore namespace for ease of invocation from gdb. | 731 // Outside the WebCore namespace for ease of invocation from gdb. |
| 751 void showLayerTree(const WebCore::RenderLayer*); | 732 void showLayerTree(const WebCore::RenderLayer*); |
| 752 void showLayerTree(const WebCore::RenderObject*); | 733 void showLayerTree(const WebCore::RenderObject*); |
| 753 #endif | 734 #endif |
| 754 | 735 |
| 755 #endif // RenderLayer_h | 736 #endif // RenderLayer_h |
| OLD | NEW |