Chromium Code Reviews| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // before we call calculateClipRects so that calculateClipRects will hit | 144 // before we call calculateClipRects so that calculateClipRects will hit |
| 145 // the cache. | 145 // the cache. |
| 146 ClipRects* parentClipRects = 0; | 146 ClipRects* parentClipRects = 0; |
| 147 if (context.rootLayer != m_layoutObject.layer() && m_layoutObject.layer()->p arent()) | 147 if (context.rootLayer != m_layoutObject.layer() && m_layoutObject.layer()->p arent()) |
| 148 parentClipRects = m_layoutObject.layer()->parent()->clipper().getClipRec ts(context); | 148 parentClipRects = m_layoutObject.layer()->parent()->clipper().getClipRec ts(context); |
| 149 RefPtr<ClipRects> clipRects = ClipRects::create(); | 149 RefPtr<ClipRects> clipRects = ClipRects::create(); |
| 150 calculateClipRects(context, *clipRects); | 150 calculateClipRects(context, *clipRects); |
| 151 return storeClipRectsInCache(context, parentClipRects, *clipRects); | 151 return storeClipRectsInCache(context, parentClipRects, *clipRects); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void PaintLayerClipper::clearClipRectsIncludingDescendants() | 154 void PaintLayerClipper::clearClipRectsIncludingDescendants() |
|
chrishtr
2015/11/18 00:32:02
It looks like PaintLayer::updateLayerPositionsAfte
Xianzhu
2015/11/18 22:38:14
You are right.
The latest patch checks actual cha
| |
| 155 { | 155 { |
| 156 m_cache = nullptr; | 156 m_cache = nullptr; |
| 157 m_layoutObject.layer()->setNeedsRepaint(); | |
| 157 | 158 |
| 158 for (PaintLayer* layer = m_layoutObject.layer()->firstChild(); layer; layer = layer->nextSibling()) { | 159 for (PaintLayer* layer = m_layoutObject.layer()->firstChild(); layer; layer = layer->nextSibling()) { |
| 159 layer->clipper().clearClipRectsIncludingDescendants(); | 160 layer->clipper().clearClipRectsIncludingDescendants(); |
| 160 } | 161 } |
| 161 } | 162 } |
| 162 | 163 |
| 163 void PaintLayerClipper::clearClipRectsIncludingDescendants(ClipRectsCacheSlot ca cheSlot) | 164 void PaintLayerClipper::clearClipRectsIncludingDescendants(ClipRectsCacheSlot ca cheSlot) |
| 164 { | 165 { |
| 165 if (m_cache) | 166 if (m_cache) |
| 166 m_cache->clear(cacheSlot); | 167 m_cache->clear(cacheSlot); |
| 168 m_layoutObject.layer()->setNeedsRepaint(); | |
| 167 | 169 |
| 168 for (PaintLayer* layer = m_layoutObject.layer()->firstChild(); layer; layer = layer->nextSibling()) { | 170 for (PaintLayer* layer = m_layoutObject.layer()->firstChild(); layer; layer = layer->nextSibling()) { |
| 169 layer->clipper().clearClipRectsIncludingDescendants(cacheSlot); | 171 layer->clipper().clearClipRectsIncludingDescendants(cacheSlot); |
| 170 } | 172 } |
| 171 } | 173 } |
| 172 | 174 |
| 173 | 175 |
| 174 LayoutRect PaintLayerClipper::localClipRect(const PaintLayer* clippingRootLayer) const | 176 LayoutRect PaintLayerClipper::localClipRect(const PaintLayer* clippingRootLayer) const |
| 175 { | 177 { |
| 176 LayoutRect layerBounds; | 178 LayoutRect layerBounds; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 if (context.respectOverflowClip == IgnoreOverflowClip) | 325 if (context.respectOverflowClip == IgnoreOverflowClip) |
| 324 return false; | 326 return false; |
| 325 | 327 |
| 326 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) | 328 if (layer->isRootLayer() && context.respectOverflowClipForViewport == Ignore OverflowClip) |
| 327 return false; | 329 return false; |
| 328 | 330 |
| 329 return true; | 331 return true; |
| 330 } | 332 } |
| 331 | 333 |
| 332 } // namespace blink | 334 } // namespace blink |
| OLD | NEW |