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

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: For landing 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 2674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2685 2685
2686 // Do this unconditionally to ensure container chain is marked when composit ing status of the layer changes. 2686 // Do this unconditionally to ensure container chain is marked when composit ing status of the layer changes.
2687 layer->markAncestorChainForNeedsRepaint(); 2687 layer->markAncestorChainForNeedsRepaint();
2688 } 2688 }
2689 2689
2690 void PaintLayer::markAncestorChainForNeedsRepaint() 2690 void PaintLayer::markAncestorChainForNeedsRepaint()
2691 { 2691 {
2692 // Need to access compositingState(). We've ensured correct flag setting whe n compositingState() changes. 2692 // Need to access compositingState(). We've ensured correct flag setting whe n compositingState() changes.
2693 DisableCompositingQueryAsserts disabler; 2693 DisableCompositingQueryAsserts disabler;
2694 2694
2695 if (compositingState() != NotComposited)
2696 return;
2697
2698 PaintLayer* layer = this; 2695 PaintLayer* layer = this;
2699 while (true) { 2696 while (true) {
2697 if (layer->compositingState() == PaintsIntoOwnBacking)
2698 return;
2699 if (CompositedLayerMapping* groupedMapping = layer->groupedMapping()) {
2700 groupedMapping->owningLayer().setNeedsRepaint();
2701 return;
2702 }
2703
2700 PaintLayer* container = layer->parent(); 2704 PaintLayer* container = layer->parent();
2701 if (!container) { 2705 if (!container) {
2702 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj ect(); 2706 LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObj ect();
2703 if (!owner) 2707 if (!owner)
2704 break; 2708 break;
2705 container = owner->enclosingLayer(); 2709 container = owner->enclosingLayer();
2706 } 2710 }
2707 if (container->isSelfPaintingLayer() || container->hasSelfPaintingLayerD escendant()) { 2711 if (container->isSelfPaintingLayer() || container->hasSelfPaintingLayerD escendant()) {
2708 if (container->m_needsRepaint) 2712 if (container->m_needsRepaint)
2709 break; 2713 break;
2710 container->m_needsRepaint = true; 2714 container->m_needsRepaint = true;
2711 } 2715 }
2712 if (container->compositingState() != NotComposited)
2713 break;
2714 layer = container; 2716 layer = container;
2715 } 2717 }
2716 } 2718 }
2717 2719
2718 void PaintLayer::clearNeedsRepaintRecursively() 2720 void PaintLayer::clearNeedsRepaintRecursively()
2719 { 2721 {
2720 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) 2722 for (PaintLayer* child = firstChild(); child; child = child->nextSibling())
2721 child->clearNeedsRepaintRecursively(); 2723 child->clearNeedsRepaintRecursively();
2722 m_needsRepaint = false; 2724 m_needsRepaint = false;
2723 } 2725 }
(...skipping 20 matching lines...) Expand all
2744 2746
2745 void showLayerTree(const blink::LayoutObject* layoutObject) 2747 void showLayerTree(const blink::LayoutObject* layoutObject)
2746 { 2748 {
2747 if (!layoutObject) { 2749 if (!layoutObject) {
2748 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2750 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2749 return; 2751 return;
2750 } 2752 }
2751 showLayerTree(layoutObject->enclosingLayer()); 2753 showLayerTree(layoutObject->enclosingLayer());
2752 } 2754 }
2753 #endif 2755 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698