Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 587 mapRectToPaintBackingCoordinates(paintInvalidationContainer->layoutObject(), rect); | 587 mapRectToPaintBackingCoordinates(paintInvalidationContainer->layoutObject(), rect); |
| 588 return rect; | 588 return rect; |
| 589 } | 589 } |
| 590 | 590 |
| 591 void DeprecatedPaintLayer::dirtyVisibleContentStatus() | 591 void DeprecatedPaintLayer::dirtyVisibleContentStatus() |
| 592 { | 592 { |
| 593 compositor()->setNeedsUpdateDescendantDependentFlags(); | 593 compositor()->setNeedsUpdateDescendantDependentFlags(); |
| 594 m_visibleContentStatusDirty = true; | 594 m_visibleContentStatusDirty = true; |
| 595 if (parent()) | 595 if (parent()) |
| 596 parent()->dirtyAncestorChainVisibleDescendantStatus(); | 596 parent()->dirtyAncestorChainVisibleDescendantStatus(); |
| 597 if (!isSelfPaintingLayer()) | |
| 598 parent()->dirtyVisibleContentStatus(); | |
|
chrishtr
2015/06/25 17:26:50
compositing/contents-opaque/visibility-hidden.html
| |
| 597 } | 599 } |
| 598 | 600 |
| 599 void DeprecatedPaintLayer::potentiallyDirtyVisibleContentStatus(EVisibility visi bility) | 601 void DeprecatedPaintLayer::potentiallyDirtyVisibleContentStatus(EVisibility visi bility) |
| 600 { | 602 { |
| 601 if (m_visibleContentStatusDirty) | 603 if (m_visibleContentStatusDirty) |
| 602 return; | 604 return; |
| 603 if (hasVisibleContent() == (visibility == VISIBLE)) | 605 if (hasVisibleContent() == (visibility == VISIBLE)) |
| 604 return; | 606 return; |
| 605 dirtyVisibleContentStatus(); | 607 dirtyVisibleContentStatus(); |
| 606 } | 608 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 657 | 659 |
| 658 if (m_visibleContentStatusDirty) { | 660 if (m_visibleContentStatusDirty) { |
| 659 bool previouslyHasVisibleContent = m_hasVisibleContent; | 661 bool previouslyHasVisibleContent = m_hasVisibleContent; |
| 660 if (layoutObject()->style()->visibility() == VISIBLE) { | 662 if (layoutObject()->style()->visibility() == VISIBLE) { |
| 661 m_hasVisibleContent = true; | 663 m_hasVisibleContent = true; |
| 662 } else { | 664 } else { |
| 663 // layer may be hidden but still have some visible content, check fo r this | 665 // layer may be hidden but still have some visible content, check fo r this |
| 664 m_hasVisibleContent = false; | 666 m_hasVisibleContent = false; |
| 665 LayoutObject* r = layoutObject()->slowFirstChild(); | 667 LayoutObject* r = layoutObject()->slowFirstChild(); |
| 666 while (r) { | 668 while (r) { |
| 667 if (r->style()->visibility() == VISIBLE && !r->hasLayer()) { | 669 if (r->style()->visibility() == VISIBLE && (!r->hasLayer() || !r ->enclosingLayer()->isSelfPaintingLayer())) { |
| 668 m_hasVisibleContent = true; | 670 m_hasVisibleContent = true; |
| 669 break; | 671 break; |
| 670 } | 672 } |
| 671 LayoutObject* layoutObjectFirstChild = r->slowFirstChild(); | 673 LayoutObject* layoutObjectFirstChild = r->slowFirstChild(); |
| 672 if (layoutObjectFirstChild && !r->hasLayer()) { | 674 if (layoutObjectFirstChild && (!r->hasLayer() || !r->enclosingLa yer()->isSelfPaintingLayer())) { |
| 673 r = layoutObjectFirstChild; | 675 r = layoutObjectFirstChild; |
| 674 } else if (r->nextSibling()) { | 676 } else if (r->nextSibling()) { |
| 675 r = r->nextSibling(); | 677 r = r->nextSibling(); |
| 676 } else { | 678 } else { |
| 677 do { | 679 do { |
| 678 r = r->parent(); | 680 r = r->parent(); |
| 679 if (r == layoutObject()) | 681 if (r == layoutObject()) |
| 680 r = 0; | 682 r = 0; |
| 681 } while (r && !r->nextSibling()); | 683 } while (r && !r->nextSibling()); |
| 682 if (r) | 684 if (r) |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1143 if (!child->stackingNode()->isTreatedAsStackingContextForPainting()) | 1145 if (!child->stackingNode()->isTreatedAsStackingContextForPainting()) |
| 1144 m_stackingNode->dirtyNormalFlowList(); | 1146 m_stackingNode->dirtyNormalFlowList(); |
| 1145 | 1147 |
| 1146 if (child->stackingNode()->isTreatedAsStackingContextForPainting() || child- >firstChild()) { | 1148 if (child->stackingNode()->isTreatedAsStackingContextForPainting() || child- >firstChild()) { |
| 1147 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the | 1149 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the |
| 1148 // case where we're building up generated content layers. This is ok, si nce the lists will start | 1150 // case where we're building up generated content layers. This is ok, si nce the lists will start |
| 1149 // off dirty in that case anyway. | 1151 // off dirty in that case anyway. |
| 1150 child->stackingNode()->dirtyStackingContextZOrderLists(); | 1152 child->stackingNode()->dirtyStackingContextZOrderLists(); |
| 1151 } | 1153 } |
| 1152 | 1154 |
| 1155 // Non-self-painting children paint into this layer, so the visible contents status of this layer is affected. | |
| 1156 if (!child->isSelfPaintingLayer()) | |
| 1157 dirtyVisibleContentStatus(); | |
| 1158 | |
| 1153 dirtyAncestorChainVisibleDescendantStatus(); | 1159 dirtyAncestorChainVisibleDescendantStatus(); |
| 1154 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 1160 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| 1155 | 1161 |
| 1156 child->updateDescendantDependentFlags(); | 1162 child->updateDescendantDependentFlags(); |
| 1157 } | 1163 } |
| 1158 | 1164 |
| 1159 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild) | 1165 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild) |
| 1160 { | 1166 { |
| 1161 if (oldChild->previousSibling()) | 1167 if (oldChild->previousSibling()) |
| 1162 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); | 1168 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); |
| (...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2740 | 2746 |
| 2741 void showLayerTree(const blink::LayoutObject* layoutObject) | 2747 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2742 { | 2748 { |
| 2743 if (!layoutObject) { | 2749 if (!layoutObject) { |
| 2744 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2750 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2745 return; | 2751 return; |
| 2746 } | 2752 } |
| 2747 showLayerTree(layoutObject->enclosingLayer()); | 2753 showLayerTree(layoutObject->enclosingLayer()); |
| 2748 } | 2754 } |
| 2749 #endif | 2755 #endif |
| OLD | NEW |