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

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

Issue 2605543002: Replace adjustment of previous visual rects on scroll with normal paint invalidation (Closed)
Patch Set: Remove unused parameters Created 3 years, 12 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 return (orientation == HorizontalScrollbar) ? scrollDimensions.width() 365 return (orientation == HorizontalScrollbar) ? scrollDimensions.width()
366 : scrollDimensions.height(); 366 : scrollDimensions.height();
367 } 367 }
368 368
369 void PaintLayerScrollableArea::updateScrollOffset(const ScrollOffset& newOffset, 369 void PaintLayerScrollableArea::updateScrollOffset(const ScrollOffset& newOffset,
370 ScrollType scrollType) { 370 ScrollType scrollType) {
371 if (getScrollOffset() == newOffset) 371 if (getScrollOffset() == newOffset)
372 return; 372 return;
373 373
374 showOverlayScrollbars(); 374 showOverlayScrollbars();
375 ScrollOffset scrollDelta = getScrollOffset() - newOffset;
376 m_scrollOffset = newOffset; 375 m_scrollOffset = newOffset;
377 376
378 LocalFrame* frame = box().frame(); 377 LocalFrame* frame = box().frame();
379 DCHECK(frame); 378 DCHECK(frame);
380 379
381 FrameView* frameView = box().frameView(); 380 FrameView* frameView = box().frameView();
382 381
383 TRACE_EVENT1("devtools.timeline", "ScrollLayer", "data", 382 TRACE_EVENT1("devtools.timeline", "ScrollLayer", "data",
384 InspectorScrollLayerEvent::data(&box())); 383 InspectorScrollLayerEvent::data(&box()));
385 384
386 // FIXME(420741): Resolve circular dependency between scroll offset and 385 // FIXME(420741): Resolve circular dependency between scroll offset and
387 // compositing state, and remove this disabler. 386 // compositing state, and remove this disabler.
388 DisableCompositingQueryAsserts disabler; 387 DisableCompositingQueryAsserts disabler;
389 388
390 // Update the positions of our child layers (if needed as only fixed layers 389 // Update the positions of our child layers (if needed as only fixed layers
391 // should be impacted by a scroll). We don't update compositing layers, 390 // should be impacted by a scroll). We don't update compositing layers,
392 // because we need to do a deep update from the compositing ancestor. 391 // because we need to do a deep update from the compositing ancestor.
393 if (!frameView->isInPerformLayout()) { 392 if (!frameView->isInPerformLayout()) {
394 // If we're in the middle of layout, we'll just update layers once layout 393 // If we're in the middle of layout, we'll just update layers once layout
395 // has finished. 394 // has finished.
396 layer()->updateLayerPositionsAfterOverflowScroll(scrollDelta); 395 layer()->updateLayerPositionsAfterOverflowScroll();
397 // Update regions, scrolling may change the clip of a particular region. 396 // Update regions, scrolling may change the clip of a particular region.
398 frameView->updateDocumentAnnotatedRegions(); 397 frameView->updateDocumentAnnotatedRegions();
399 frameView->setNeedsUpdateWidgetGeometries(); 398 frameView->setNeedsUpdateWidgetGeometries();
400 updateCompositingLayersAfterScroll(); 399 updateCompositingLayersAfterScroll();
401 } 400 }
402 401
403 const LayoutBoxModelObject& paintInvalidationContainer = 402 const LayoutBoxModelObject& paintInvalidationContainer =
404 box().containerForPaintInvalidation(); 403 box().containerForPaintInvalidation();
405 // The caret rect needs to be invalidated after scrolling 404 // The caret rect needs to be invalidated after scrolling
406 frame->selection().setCaretRectNeedsUpdate(); 405 frame->selection().setCaretRectNeedsUpdate();
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after
2072 2071
2073 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2072 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2074 clampScrollableAreas() { 2073 clampScrollableAreas() {
2075 for (auto& scrollableArea : *s_needsClamp) 2074 for (auto& scrollableArea : *s_needsClamp)
2076 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2075 scrollableArea->clampScrollOffsetAfterOverflowChange();
2077 delete s_needsClamp; 2076 delete s_needsClamp;
2078 s_needsClamp = nullptr; 2077 s_needsClamp = nullptr;
2079 } 2078 }
2080 2079
2081 } // namespace blink 2080 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698