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

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

Issue 2307983002: Include scroll offset in scrolling contents painted background rect invalidation. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/composited-overflow-with-local-background-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/composited-overflow-with-local-background-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698