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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 702 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
| 703 if (curr->renderer()->hasColumns()) { | 703 if (curr->renderer()->hasColumns()) { |
| 704 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c urr->renderBox()); | 704 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c urr->renderBox()); |
| 705 return; | 705 return; |
| 706 } | 706 } |
| 707 if (curr->stackingNode() == ancestorStackingContextNode) | 707 if (curr->stackingNode() == ancestorStackingContextNode) |
| 708 return; | 708 return; |
| 709 } | 709 } |
| 710 } | 710 } |
| 711 | 711 |
| 712 void RenderLayer::computeRectForRepaint(const RenderLayerModelObject* repaintCon tainer, LayoutRect& rect) const | |
| 713 { | |
| 714 if (!repaintContainer->groupedMapping()) { | |
| 715 m_renderer->computeRectForRepaint(repaintContainer, rect); | |
| 716 return; | |
| 717 } | |
| 718 | |
| 719 ASSERT(enclosingTransformedAncestor()); | |
| 720 ASSERT(enclosingTransformedAncestor()->renderer()); | |
| 721 | |
| 722 // FIXME: this defensive code should not have to exist. None of these pointe rs should ever be 0. See crbug.com/370410. | |
| 723 RenderLayerModelObject* transformedAncestor = 0; | |
| 724 if (RenderLayer* ancestor = repaintContainer->layer()->enclosingTransformedA ncestor()) | |
| 725 transformedAncestor = ancestor->renderer(); | |
| 726 if (!transformedAncestor) | |
| 727 return; | |
| 728 | |
| 729 // If the transformedAncestor is actually the RenderView, we might get | |
| 730 // confused and think that we can use LayoutState. Ideally, we'd made | |
| 731 // LayoutState work for all composited layers as well, but until then | |
| 732 // we need to disable LayoutState for squashed layers. | |
| 733 LayoutStateDisabler layoutStateDisabler(*transformedAncestor); | |
|
leviw_travelin_and_unemployed
2014/05/29 18:27:08
:(
This should go away with RAL.
chrishtr
2014/05/29 18:34:11
OK. FTR I just copied the code from its previous l
| |
| 734 | |
| 735 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed) | |
| 736 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is | |
| 737 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. | |
| 738 // FIXME: remove this special-case code that works around the repainting cod e structure. | |
| 739 m_renderer->computeRectForRepaint(transformedAncestor, rect); | |
| 740 rect.moveBy(-repaintContainer->groupedMapping()->squashingOffsetFromTransfor medAncestor()); | |
| 741 | |
| 742 return; | |
| 743 } | |
| 744 | |
| 745 LayoutRect RenderLayer::computeRepaintRect(const RenderLayerModelObject* repaint Container) const | |
| 746 { | |
| 747 if (!repaintContainer->groupedMapping()) | |
| 748 return m_renderer->computeRepaintRect(repaintContainer); | |
| 749 | |
| 750 LayoutRect rect = renderer()->clippedOverflowRectForRepaint(repaintContainer ); | |
| 751 repaintContainer->layer()->computeRectForRepaint(repaintContainer, rect); | |
| 752 return rect; | |
| 753 } | |
| 754 | |
| 712 void RenderLayer::setHasVisibleContent() | 755 void RenderLayer::setHasVisibleContent() |
| 713 { | 756 { |
| 714 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { | 757 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { |
| 715 ASSERT(!parent() || parent()->hasVisibleDescendant()); | 758 ASSERT(!parent() || parent()->hasVisibleDescendant()); |
| 716 return; | 759 return; |
| 717 } | 760 } |
| 718 | 761 |
| 719 m_hasVisibleContent = true; | 762 m_hasVisibleContent = true; |
| 720 m_visibleContentStatusDirty = false; | 763 m_visibleContentStatusDirty = false; |
| 721 | 764 |
| (...skipping 3299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4021 } | 4064 } |
| 4022 } | 4065 } |
| 4023 | 4066 |
| 4024 void showLayerTree(const WebCore::RenderObject* renderer) | 4067 void showLayerTree(const WebCore::RenderObject* renderer) |
| 4025 { | 4068 { |
| 4026 if (!renderer) | 4069 if (!renderer) |
| 4027 return; | 4070 return; |
| 4028 showLayerTree(renderer->enclosingLayer()); | 4071 showLayerTree(renderer->enclosingLayer()); |
| 4029 } | 4072 } |
| 4030 #endif | 4073 #endif |
| OLD | NEW |