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