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 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 } | 2665 } |
2666 } else { | 2666 } else { |
2667 rect.append(logicalBoundingBox()); | 2667 rect.append(logicalBoundingBox()); |
2668 rects.set(this, rect); | 2668 rects.set(this, rect); |
2669 } | 2669 } |
2670 } | 2670 } |
2671 } | 2671 } |
2672 | 2672 |
2673 void PaintLayer::setNeedsRepaint() | 2673 void PaintLayer::setNeedsRepaint() |
2674 { | 2674 { |
2675 PaintLayer* layer = this; | 2675 m_needsRepaint = true; |
2676 while (layer && !layer->isSelfPaintingLayer() && !layer->hasSelfPaintingLaye
rDescendant()) | |
2677 layer = layer->parent(); | |
2678 | |
2679 // This layer is in an orphaned layer tree. Will mark ancestor for repaint w
hen | |
2680 // the orphaned tree is added into another tree. | |
2681 if (!layer) | |
2682 return; | |
2683 | |
2684 layer->m_needsRepaint = true; | |
2685 | 2676 |
2686 // Do this unconditionally to ensure container chain is marked when composit
ing status of the layer changes. | 2677 // Do this unconditionally to ensure container chain is marked when composit
ing status of the layer changes. |
2687 layer->markAncestorChainForNeedsRepaint(); | 2678 markAncestorChainForNeedsRepaint(); |
2688 } | 2679 } |
2689 | 2680 |
2690 void PaintLayer::markAncestorChainForNeedsRepaint() | 2681 void PaintLayer::markAncestorChainForNeedsRepaint() |
2691 { | 2682 { |
2692 // Need to access compositingState(). We've ensured correct flag setting whe
n compositingState() changes. | 2683 // Need to access compositingState(). We've ensured correct flag setting whe
n compositingState() changes. |
2693 DisableCompositingQueryAsserts disabler; | 2684 DisableCompositingQueryAsserts disabler; |
2694 | 2685 |
2695 PaintLayer* layer = this; | 2686 PaintLayer* layer = this; |
2696 while (true) { | 2687 while (true) { |
2697 if (layer->compositingState() == PaintsIntoOwnBacking) | 2688 if (layer->compositingState() == PaintsIntoOwnBacking) |
2698 return; | 2689 return; |
2699 if (CompositedLayerMapping* groupedMapping = layer->groupedMapping()) { | 2690 if (CompositedLayerMapping* groupedMapping = layer->groupedMapping()) { |
2700 groupedMapping->owningLayer().setNeedsRepaint(); | 2691 groupedMapping->owningLayer().setNeedsRepaint(); |
2701 return; | 2692 return; |
2702 } | 2693 } |
2703 | 2694 |
2704 PaintLayer* container = layer->parent(); | 2695 PaintLayer* container = layer->parent(); |
2705 if (!container) { | 2696 if (!container) { |
2706 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj
ect(); | 2697 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj
ect(); |
2707 if (!owner) | 2698 if (!owner) |
2708 break; | 2699 break; |
2709 container = owner->enclosingLayer(); | 2700 container = owner->enclosingLayer(); |
2710 } | 2701 } |
2711 if (container->isSelfPaintingLayer() || container->hasSelfPaintingLayerD
escendant()) { | 2702 if (container->m_needsRepaint) |
2712 if (container->m_needsRepaint) | 2703 break; |
2713 break; | 2704 container->m_needsRepaint = true; |
2714 container->m_needsRepaint = true; | |
2715 } | |
2716 layer = container; | 2705 layer = container; |
2717 } | 2706 } |
2718 } | 2707 } |
2719 | 2708 |
2720 void PaintLayer::clearNeedsRepaintRecursively() | 2709 void PaintLayer::clearNeedsRepaintRecursively() |
2721 { | 2710 { |
2722 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) | 2711 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) |
2723 child->clearNeedsRepaintRecursively(); | 2712 child->clearNeedsRepaintRecursively(); |
2724 m_needsRepaint = false; | 2713 m_needsRepaint = false; |
2725 } | 2714 } |
(...skipping 20 matching lines...) Expand all Loading... |
2746 | 2735 |
2747 void showLayerTree(const blink::LayoutObject* layoutObject) | 2736 void showLayerTree(const blink::LayoutObject* layoutObject) |
2748 { | 2737 { |
2749 if (!layoutObject) { | 2738 if (!layoutObject) { |
2750 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2739 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2751 return; | 2740 return; |
2752 } | 2741 } |
2753 showLayerTree(layoutObject->enclosingLayer()); | 2742 showLayerTree(layoutObject->enclosingLayer()); |
2754 } | 2743 } |
2755 #endif | 2744 #endif |
OLD | NEW |