Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| index 5eed81877f073cfb7a536b2120991c542dc3b312..f9d52d6067206cbbf207c6b3a00e0875fc7538c9 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
| @@ -1198,6 +1198,8 @@ void PaintLayer::addChild(PaintLayer* child, PaintLayer* beforeChild) |
| // Non-self-painting children paint into this layer, so the visible contents status of this layer is affected. |
| if (!child->isSelfPaintingLayer()) |
| dirtyVisibleContentStatus(); |
| + else if (PaintLayer* enclosingSelfPaintingLayer = this->enclosingSelfPaintingLayer()) |
| + child->mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer); |
| dirtyAncestorChainVisibleDescendantStatus(); |
| dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| @@ -1247,6 +1249,11 @@ PaintLayer* PaintLayer::removeChild(PaintLayer* oldChild) |
| if (oldChild->enclosingPaginationLayer()) |
| oldChild->clearPaginationRecursive(); |
| + if (oldChild->isSelfPaintingLayer()) { |
| + if (PaintLayer* enclosingSelfPaintingLayer = this->enclosingSelfPaintingLayer()) |
|
pdr.
2016/04/08 04:19:00
enclosingSelfPaintingLayer is O(n) so it looks lik
Xianzhu
2016/04/08 18:08:48
Because except for non-composited non-stacked over
|
| + enclosingSelfPaintingLayer->mergeNeedsPaintPhaseFlagsFrom(*oldChild); |
|
pdr.
2016/04/08 04:19:00
I'm new to this code... does "removeChild" always
Xianzhu
2016/04/08 18:08:48
Good catch. We should avoid the operation when thi
pdr.
2016/04/08 19:46:07
Because PaintLayer::{insert,remove}OnlyThisLayer()
Xianzhu
2016/04/08 21:30:55
Done renaming.
|
| + } |
| + |
| setNeedsRepaint(); |
| return oldChild; |
| @@ -2433,8 +2440,18 @@ void PaintLayer::updateSelfPaintingLayer() |
| m_isSelfPaintingLayer = isSelfPaintingLayer; |
| - if (parent()) |
| - parent()->dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| + if (PaintLayer* parent = this->parent()) { |
| + parent->dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| + |
| + if (PaintLayer* enclosingSelfPaintingLayer = parent->enclosingSelfPaintingLayer()) { |
|
pdr.
2016/04/08 04:19:00
Are these codepaths tested? I removed these lines
Xianzhu
2016/04/08 18:08:48
Added these code because I was afraid there were c
|
| + if (isSelfPaintingLayer) { |
| + mergeNeedsPaintPhaseFlagsFrom(*enclosingSelfPaintingLayer); |
| + } else { |
| + enclosingSelfPaintingLayer->mergeNeedsPaintPhaseFlagsFrom(*this); |
| + clearNeedsPaintPhaseFlags(); |
| + } |
| + } |
| + } |
|
pdr.
2016/04/08 04:19:00
Is the call to clearNeedsPaintPhaseFlags needed or
Xianzhu
2016/04/08 18:08:48
Good questions. I think this affects how accuratel
|
| } |
| PaintLayer* PaintLayer::enclosingSelfPaintingLayer() |