Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2266103002: Repaint when background switches painting from/to scrolling contents layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698