| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } else if (paintInvalidationContainer.usesCompositedScrolling()) { | 227 } else if (paintInvalidationContainer.usesCompositedScrolling()) { |
| 228 if (layer.compositedLayerMapping()->backgroundPaintsOntoScrollingContent
sLayer()) { | 228 if (layer.compositedLayerMapping()->backgroundPaintsOntoScrollingContent
sLayer()) { |
| 229 // TODO(flackr): Get a correct rect in the context of the scrolling
contents layer to update | 229 // TODO(flackr): Get a correct rect in the context of the scrolling
contents layer to update |
| 230 // rather than updating the entire rect. | 230 // rather than updating the entire rect. |
| 231 const LayoutRect& scrollingContentsRect = toLayoutBox(m_object).layo
utOverflowRect(); | 231 const LayoutBox& box = toLayoutBox(m_object); |
| 232 LayoutRect scrollingContentsRect = box.layoutOverflowRect(); |
| 233 scrollingContentsRect.move(-box.scrolledContentOffset()); |
| 232 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRec
t(scrollingContentsRect, reason, m_object); | 234 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRec
t(scrollingContentsRect, reason, m_object); |
| 233 layer.setNeedsRepaint(); | 235 layer.setNeedsRepaint(); |
| 234 invalidateDisplayItemClient(*layer.compositedLayerMapping()->scrolli
ngContentsLayer(), reason); | 236 invalidateDisplayItemClient(*layer.compositedLayerMapping()->scrolli
ngContentsLayer(), reason); |
| 235 } | 237 } |
| 236 layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect
(rect, reason, m_object); | 238 layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect
(rect, reason, m_object); |
| 237 } else { | 239 } else { |
| 238 // Otherwise invalidate everything. | 240 // Otherwise invalidate everything. |
| 239 layer.compositedLayerMapping()->setContentsNeedDisplayInRect(rect, reaso
n, m_object); | 241 layer.compositedLayerMapping()->setContentsNeedDisplayInRect(rect, reaso
n, m_object); |
| 240 } | 242 } |
| 241 } | 243 } |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 m_object.invalidateDisplayItemClients(reason); | 473 m_object.invalidateDisplayItemClients(reason); |
| 472 return reason; | 474 return reason; |
| 473 } | 475 } |
| 474 | 476 |
| 475 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() | 477 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() |
| 476 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) | 478 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) |
| 477 { | 479 { |
| 478 } | 480 } |
| 479 | 481 |
| 480 } // namespace blink | 482 } // namespace blink |
| OLD | NEW |