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

Side by Side Diff: Source/core/rendering/RenderLayer.cpp

Issue 261053004: Simplify RenderLayer::setParent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/compositing/squashing/tricky-element-removal-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after
3607 childLocalRect.moveBy(-childOffset); 3607 childLocalRect.moveBy(-childOffset);
3608 3608
3609 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect)) 3609 if (childLayer->backgroundIsKnownToBeOpaqueInRect(childLocalRect))
3610 return true; 3610 return true;
3611 } 3611 }
3612 return false; 3612 return false;
3613 } 3613 }
3614 3614
3615 void RenderLayer::setParent(RenderLayer* parent) 3615 void RenderLayer::setParent(RenderLayer* parent)
3616 { 3616 {
3617 if (parent == m_parent)
3618 return;
3619
3620 if (m_parent && !renderer()->documentBeingDestroyed())
3621 compositor()->layerWillBeRemoved(m_parent, this);
3622
3623 m_parent = parent; 3617 m_parent = parent;
esprehn 2014/05/01 21:50:41 This should be inline now. :)
3624
3625 if (m_parent && !renderer()->documentBeingDestroyed())
3626 compositor()->layerWasAdded(m_parent, this);
3627 } 3618 }
3628 3619
3629 bool RenderLayer::shouldBeSelfPaintingLayer() const 3620 bool RenderLayer::shouldBeSelfPaintingLayer() const
3630 { 3621 {
3631 return m_layerType == NormalLayer 3622 return m_layerType == NormalLayer
3632 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars()) 3623 || (m_scrollableArea && m_scrollableArea->hasOverlayScrollbars())
3633 || needsCompositedScrolling(); 3624 || needsCompositedScrolling();
3634 } 3625 }
3635 3626
3636 void RenderLayer::updateSelfPaintingLayer() 3627 void RenderLayer::updateSelfPaintingLayer()
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
4024 } 4015 }
4025 } 4016 }
4026 4017
4027 void showLayerTree(const WebCore::RenderObject* renderer) 4018 void showLayerTree(const WebCore::RenderObject* renderer)
4028 { 4019 {
4029 if (!renderer) 4020 if (!renderer)
4030 return; 4021 return;
4031 showLayerTree(renderer->enclosingLayer()); 4022 showLayerTree(renderer->enclosingLayer());
4032 } 4023 }
4033 #endif 4024 #endif
OLDNEW
« no previous file with comments | « LayoutTests/compositing/squashing/tricky-element-removal-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698