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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } else if (paintInvalidationContainer.usesCompositedScrolling()) { | 227 } else if (paintInvalidationContainer.usesCompositedScrolling()) { |
228 if (layer.compositedLayerMapping()->shouldPaintBackgroundOntoScrollingCo
ntentsLayer()) { | 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 LayoutRect& scrollingContentsRect = toLayoutBox(m_object).layo
utOverflowRect(); |
232 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRec
t(scrollingContentsRect, reason, m_object); | 232 layer.compositedLayerMapping()->setScrollingContentsNeedDisplayInRec
t(scrollingContentsRect, reason, m_object); |
233 layer.setNeedsRepaint(); | 233 layer.setNeedsRepaint(); |
234 invalidateDisplayItemClient(*layer.compositedLayerMapping()->scrolli
ngContentsLayer(), reason); | 234 invalidateDisplayItemClient(*layer.compositedLayerMapping()->scrolli
ngContentsLayer(), reason); |
235 } | 235 } |
236 layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect
(rect, reason, m_object); | 236 layer.compositedLayerMapping()->setNonScrollingContentsNeedDisplayInRect
(rect, reason, m_object); |
237 } else { | 237 } else { |
238 // Otherwise invalidate everything. | 238 // Otherwise invalidate everything. |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 m_object.invalidateDisplayItemClients(reason); | 467 m_object.invalidateDisplayItemClients(reason); |
468 return reason; | 468 return reason; |
469 } | 469 } |
470 | 470 |
471 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() | 471 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() |
472 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) | 472 : m_disabler(&gDisablePaintInvalidationStateAsserts, true) |
473 { | 473 { |
474 } | 474 } |
475 | 475 |
476 } // namespace blink | 476 } // namespace blink |
OLD | NEW |