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 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2846 } | 2846 } |
2847 } else { | 2847 } else { |
2848 rect.append(logicalBoundingBox()); | 2848 rect.append(logicalBoundingBox()); |
2849 rects.set(this, rect); | 2849 rects.set(this, rect); |
2850 } | 2850 } |
2851 } | 2851 } |
2852 } | 2852 } |
2853 | 2853 |
2854 void PaintLayer::setNeedsRepaint() | 2854 void PaintLayer::setNeedsRepaint() |
2855 { | 2855 { |
2856 m_needsRepaint = true; | 2856 setNeedsRepaintInternal(); |
2857 | 2857 |
2858 // Do this unconditionally to ensure container chain is marked when composit
ing status of the layer changes. | 2858 // Do this unconditionally to ensure container chain is marked when composit
ing status of the layer changes. |
2859 markCompositingContainerChainForNeedsRepaint(); | 2859 markCompositingContainerChainForNeedsRepaint(); |
2860 } | 2860 } |
2861 | 2861 |
| 2862 void PaintLayer::setNeedsRepaintInternal() |
| 2863 { |
| 2864 m_needsRepaint = true; |
| 2865 setDisplayItemsUncached(); // Invalidate as a display item client. |
| 2866 } |
| 2867 |
2862 void PaintLayer::markCompositingContainerChainForNeedsRepaint() | 2868 void PaintLayer::markCompositingContainerChainForNeedsRepaint() |
2863 { | 2869 { |
2864 // Need to access compositingState(). We've ensured correct flag setting whe
n compositingState() changes. | 2870 // Need to access compositingState(). We've ensured correct flag setting whe
n compositingState() changes. |
2865 DisableCompositingQueryAsserts disabler; | 2871 DisableCompositingQueryAsserts disabler; |
2866 | 2872 |
2867 PaintLayer* layer = this; | 2873 PaintLayer* layer = this; |
2868 while (true) { | 2874 while (true) { |
2869 if (layer->compositingState() == PaintsIntoOwnBacking) | 2875 if (layer->compositingState() == PaintsIntoOwnBacking) |
2870 return; | 2876 return; |
2871 if (CompositedLayerMapping* groupedMapping = layer->groupedMapping()) { | 2877 if (CompositedLayerMapping* groupedMapping = layer->groupedMapping()) { |
2872 // TODO(wkorman): As we clean up the CompositedLayerMapping needsRep
aint logic to | 2878 // TODO(wkorman): As we clean up the CompositedLayerMapping needsRep
aint logic to |
2873 // delegate to scrollbars, we may be able to remove the line below a
s well. | 2879 // delegate to scrollbars, we may be able to remove the line below a
s well. |
2874 groupedMapping->owningLayer().setNeedsRepaint(); | 2880 groupedMapping->owningLayer().setNeedsRepaint(); |
2875 return; | 2881 return; |
2876 } | 2882 } |
2877 | 2883 |
2878 PaintLayer* container = layer->compositingContainer(); | 2884 PaintLayer* container = layer->compositingContainer(); |
2879 if (!container) { | 2885 if (!container) { |
2880 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj
ect(); | 2886 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj
ect(); |
2881 if (!owner) | 2887 if (!owner) |
2882 break; | 2888 break; |
2883 container = owner->enclosingLayer(); | 2889 container = owner->enclosingLayer(); |
2884 } | 2890 } |
2885 if (container->m_needsRepaint) | 2891 if (container->m_needsRepaint) |
2886 break; | 2892 break; |
2887 container->m_needsRepaint = true; | 2893 container->setNeedsRepaintInternal(); |
2888 layer = container; | 2894 layer = container; |
2889 } | 2895 } |
2890 } | 2896 } |
2891 | 2897 |
2892 void PaintLayer::clearNeedsRepaintRecursively() | 2898 void PaintLayer::clearNeedsRepaintRecursively() |
2893 { | 2899 { |
2894 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) | 2900 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) |
2895 child->clearNeedsRepaintRecursively(); | 2901 child->clearNeedsRepaintRecursively(); |
2896 m_needsRepaint = false; | 2902 m_needsRepaint = false; |
2897 } | 2903 } |
(...skipping 27 matching lines...) Expand all Loading... |
2925 | 2931 |
2926 void showLayerTree(const blink::LayoutObject* layoutObject) | 2932 void showLayerTree(const blink::LayoutObject* layoutObject) |
2927 { | 2933 { |
2928 if (!layoutObject) { | 2934 if (!layoutObject) { |
2929 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2935 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2930 return; | 2936 return; |
2931 } | 2937 } |
2932 showLayerTree(layoutObject->enclosingLayer()); | 2938 showLayerTree(layoutObject->enclosingLayer()); |
2933 } | 2939 } |
2934 #endif | 2940 #endif |
OLD | NEW |