Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1416053003: Let synchronized painting generate correct paint invalidation rects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2675 matching lines...) Expand 10 before | Expand all | Expand 10 after
2686 2686
2687 // Do this unconditionally to ensure container chain is marked when composit ing status of the layer changes. 2687 // Do this unconditionally to ensure container chain is marked when composit ing status of the layer changes.
2688 layer->markAncestorChainForNeedsRepaint(); 2688 layer->markAncestorChainForNeedsRepaint();
2689 } 2689 }
2690 2690
2691 void PaintLayer::markAncestorChainForNeedsRepaint() 2691 void PaintLayer::markAncestorChainForNeedsRepaint()
2692 { 2692 {
2693 // Need to access compositingState(). We've ensured correct flag setting whe n compositingState() changes. 2693 // Need to access compositingState(). We've ensured correct flag setting whe n compositingState() changes.
2694 DisableCompositingQueryAsserts disabler; 2694 DisableCompositingQueryAsserts disabler;
2695 2695
2696 if (compositingState() != NotComposited)
2697 return;
2698
2699 PaintLayer* layer = this; 2696 PaintLayer* layer = this;
2700 while (true) { 2697 while (true) {
2698 if (layer->compositingState() == PaintsIntoOwnBacking)
2699 return;
2700 if (CompositedLayerMapping* groupedMapping = layer->groupedMapping()) {
2701 groupedMapping->owningLayer().setNeedsRepaint();
2702 return;
2703 }
2704
2701 PaintLayer* container = layer->parent(); 2705 PaintLayer* container = layer->parent();
2702 if (!container) { 2706 if (!container) {
2703 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj ect(); 2707 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj ect();
2704 if (!owner) 2708 if (!owner)
2705 break; 2709 break;
2706 container = owner->enclosingLayer(); 2710 container = owner->enclosingLayer();
2707 } 2711 }
2708 if (container->isSelfPaintingLayer() || container->hasSelfPaintingLayerD escendant()) { 2712 if (container->isSelfPaintingLayer() || container->hasSelfPaintingLayerD escendant()) {
2709 if (container->m_needsRepaint) 2713 if (container->m_needsRepaint)
2710 break; 2714 break;
2711 container->m_needsRepaint = true; 2715 container->m_needsRepaint = true;
2712 } 2716 }
2713 if (container->compositingState() != NotComposited)
2714 break;
2715 layer = container; 2717 layer = container;
2716 } 2718 }
2717 } 2719 }
2718 2720
2719 void PaintLayer::clearNeedsRepaintRecursively() 2721 void PaintLayer::clearNeedsRepaintRecursively()
2720 { 2722 {
2721 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) 2723 for (PaintLayer* child = firstChild(); child; child = child->nextSibling())
2722 child->clearNeedsRepaintRecursively(); 2724 child->clearNeedsRepaintRecursively();
2723 m_needsRepaint = false; 2725 m_needsRepaint = false;
2724 } 2726 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2761 2763
2762 void showLayerTree(const blink::LayoutObject* layoutObject) 2764 void showLayerTree(const blink::LayoutObject* layoutObject)
2763 { 2765 {
2764 if (!layoutObject) { 2766 if (!layoutObject) {
2765 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2767 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2766 return; 2768 return;
2767 } 2769 }
2768 showLayerTree(layoutObject->enclosingLayer()); 2770 showLayerTree(layoutObject->enclosingLayer());
2769 } 2771 }
2770 #endif 2772 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698