| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/ObjectPaintInvalidator.h" | 5 #include "core/paint/ObjectPaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "core/layout/LayoutBlockFlow.h" | 9 #include "core/layout/LayoutBlockFlow.h" |
| 10 #include "core/layout/compositing/CompositedLayerMapping.h" | 10 #include "core/layout/compositing/CompositedLayerMapping.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 DCHECK(paintInvalidationContainer.compositingState() != NotComposited); | 217 DCHECK(paintInvalidationContainer.compositingState() != NotComposited); |
| 218 | 218 |
| 219 PaintLayer& layer = *paintInvalidationContainer.layer(); | 219 PaintLayer& layer = *paintInvalidationContainer.layer(); |
| 220 if (layer.groupedMapping()) { | 220 if (layer.groupedMapping()) { |
| 221 if (GraphicsLayer* squashingLayer = layer.groupedMapping()->squashingLay
er()) { | 221 if (GraphicsLayer* squashingLayer = layer.groupedMapping()->squashingLay
er()) { |
| 222 // Note: the subpixel accumulation of layer() does not need to be ad
ded here. It is already taken into account. | 222 // Note: the subpixel accumulation of layer() does not need to be ad
ded here. It is already taken into account. |
| 223 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(rect), reason
, m_object); | 223 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(rect), reason
, m_object); |
| 224 } | 224 } |
| 225 } else if (m_object.compositedScrollsWithRespectTo(paintInvalidationContaine
r)) { | 225 } else if (m_object.compositedScrollsWithRespectTo(paintInvalidationContaine
r)) { |
| 226 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRect(re
ct, reason, m_object); | 226 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRect(re
ct, reason, m_object); |
| 227 if (paintInvalidationContainer.usesCompositedScrolling() && layer.compos
itedLayerMapping()->backgroundPaintsOntoScrollingContentsLayer()) { |
| 228 invalidateDisplayItemClient(*layer.compositedLayerMapping()->scrolli
ngContentsLayer(), reason); |
| 229 } |
| 227 } else if (paintInvalidationContainer.usesCompositedScrolling()) { | 230 } else if (paintInvalidationContainer.usesCompositedScrolling()) { |
| 228 if (layer.compositedLayerMapping()->backgroundPaintsOntoScrollingContent
sLayer()) { | 231 if (layer.compositedLayerMapping()->backgroundPaintsOntoScrollingContent
sLayer()) { |
| 229 // TODO(flackr): Get a correct rect in the context of the scrolling
contents layer to update | 232 // TODO(flackr): Get a correct rect in the context of the scrolling
contents layer to update |
| 230 // rather than updating the entire rect. | 233 // rather than updating the entire rect. |
| 231 const LayoutRect& scrollingContentsRect = toLayoutBox(m_object).layo
utOverflowRect(); | 234 const LayoutRect& scrollingContentsRect = toLayoutBox(m_object).layo
utOverflowRect(); |
| 232 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRec
t(scrollingContentsRect, reason, m_object); | 235 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRec
t(scrollingContentsRect, reason, m_object); |
| 233 layer.setNeedsRepaint(); | 236 layer.setNeedsRepaint(); |
| 234 invalidateDisplayItemClient(*layer.compositedLayerMapping()->scrolli
ngContentsLayer(), reason); | 237 invalidateDisplayItemClient(*layer.compositedLayerMapping()->scrolli
ngContentsLayer(), reason); |
| 235 } | 238 } |
| 236 layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect
(rect, reason, m_object); | 239 layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect
(rect, reason, m_object); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 m_object.invalidateDisplayItemClients(reason); | 474 m_object.invalidateDisplayItemClients(reason); |
| 472 return reason; | 475 return reason; |
| 473 } | 476 } |
| 474 | 477 |
| 475 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() | 478 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() |
| 476 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) | 479 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) |
| 477 { | 480 { |
| 478 } | 481 } |
| 479 | 482 |
| 480 } // namespace blink | 483 } // namespace blink |
| OLD | NEW |