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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2213553002: Delete FrameView::rectToCopyOnScroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 return true; 1455 return true;
1456 } 1456 }
1457 1457
1458 if (!invalidateViewportConstrainedObjects()) 1458 if (!invalidateViewportConstrainedObjects())
1459 return false; 1459 return false;
1460 1460
1461 InspectorInstrumentation::didUpdateLayout(m_frame.get()); 1461 InspectorInstrumentation::didUpdateLayout(m_frame.get());
1462 return true; 1462 return true;
1463 } 1463 }
1464 1464
1465 void FrameView::scrollContentsSlowPath(const IntRect& updateRect) 1465 void FrameView::scrollContentsSlowPath()
1466 { 1466 {
1467 TRACE_EVENT0("blink", "FrameView::scrollContentsSlowPath"); 1467 TRACE_EVENT0("blink", "FrameView::scrollContentsSlowPath");
1468 // We need full invalidation during slow scrolling. For slimming paint, full invalidation 1468 // We need full invalidation during slow scrolling. For slimming paint, full invalidation
1469 // of the LayoutView is not enough. We also need to invalidate all of the ob jects. 1469 // of the LayoutView is not enough. We also need to invalidate all of the ob jects.
1470 // FIXME: Find out what are enough to invalidate in slow path scrolling. crb ug.com/451090#9. 1470 // FIXME: Find out what are enough to invalidate in slow path scrolling. crb ug.com/451090#9.
1471 ASSERT(!layoutViewItem().isNull()); 1471 ASSERT(!layoutViewItem().isNull());
1472 if (contentsInCompositedLayer()) 1472 if (contentsInCompositedLayer())
1473 layoutViewItem().layer()->compositedLayerMapping()->setContentsNeedDispl ay(); 1473 layoutViewItem().layer()->compositedLayerMapping()->setContentsNeedDispl ay();
1474 else 1474 else
1475 layoutViewItem().setShouldDoFullPaintInvalidationIncludingNonCompositing Descendants(); 1475 layoutViewItem().setShouldDoFullPaintInvalidationIncludingNonCompositing Descendants();
(...skipping 10 matching lines...) Expand all
1486 if (isEnclosedInCompositingLayer()) { 1486 if (isEnclosedInCompositingLayer()) {
1487 LayoutRect rect(frameLayoutObject->borderLeft() + frameLayoutObject- >paddingLeft(), 1487 LayoutRect rect(frameLayoutObject->borderLeft() + frameLayoutObject- >paddingLeft(),
1488 frameLayoutObject->borderTop() + frameLayoutObject->paddingTop() , 1488 frameLayoutObject->borderTop() + frameLayoutObject->paddingTop() ,
1489 LayoutUnit(visibleWidth()), LayoutUnit(visibleHeight())); 1489 LayoutUnit(visibleWidth()), LayoutUnit(visibleHeight()));
1490 // FIXME: We should not allow paint invalidation out of paint invali dation state. crbug.com/457415 1490 // FIXME: We should not allow paint invalidation out of paint invali dation state. crbug.com/457415
1491 DisablePaintInvalidationStateAsserts disabler; 1491 DisablePaintInvalidationStateAsserts disabler;
1492 frameLayoutObject->invalidatePaintRectangle(rect); 1492 frameLayoutObject->invalidatePaintRectangle(rect);
1493 return; 1493 return;
1494 } 1494 }
1495 } 1495 }
1496
1497 getHostWindow()->invalidateRect(updateRect);
1498 } 1496 }
1499 1497
1500 void FrameView::restoreScrollbar() 1498 void FrameView::restoreScrollbar()
1501 { 1499 {
1502 setScrollbarsSuppressed(false); 1500 setScrollbarsSuppressed(false);
1503 } 1501 }
1504 1502
1505 void FrameView::processUrlFragment(const KURL& url, UrlFragmentBehavior behavior ) 1503 void FrameView::processUrlFragment(const KURL& url, UrlFragmentBehavior behavior )
1506 { 1504 {
1507 // If our URL has no ref, then we have no place we need to jump to. 1505 // If our URL has no ref, then we have no place we need to jump to.
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 return; 2177 return;
2180 2178
2181 for (LayoutObject* layoutObject = view; layoutObject; layoutObject = layoutO bject->nextInPreOrder()) { 2179 for (LayoutObject* layoutObject = view; layoutObject; layoutObject = layoutO bject->nextInPreOrder()) {
2182 if (!layoutObject->isCounter()) 2180 if (!layoutObject->isCounter())
2183 continue; 2181 continue;
2184 2182
2185 toLayoutCounter(layoutObject)->updateCounter(); 2183 toLayoutCounter(layoutObject)->updateCounter();
2186 } 2184 }
2187 } 2185 }
2188 2186
2189 IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co nst
2190 {
2191 ASSERT(m_frame->view() == this);
2192
2193 LayoutRect clipRect(LayoutPoint(), LayoutSize(visibleContentSize(scrollbarIn clusion)));
2194 layoutViewItem().mapToVisualRectInAncestorSpace(&layoutView()->containerForP aintInvalidation(), clipRect);
2195 return enclosingIntRect(clipRect);
2196 }
2197
2198 bool FrameView::shouldUseIntegerScrollOffset() const 2187 bool FrameView::shouldUseIntegerScrollOffset() const
2199 { 2188 {
2200 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE nabled()) 2189 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE nabled())
2201 return true; 2190 return true;
2202 2191
2203 return ScrollableArea::shouldUseIntegerScrollOffset(); 2192 return ScrollableArea::shouldUseIntegerScrollOffset();
2204 } 2193 }
2205 2194
2206 bool FrameView::isActive() const 2195 bool FrameView::isActive() const
2207 { 2196 {
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after
3653 if (clamped != scrollPositionDouble() && shouldPerformScrollAnchoring()) { 3642 if (clamped != scrollPositionDouble() && shouldPerformScrollAnchoring()) {
3654 m_scrollAnchor.restore(); 3643 m_scrollAnchor.restore();
3655 clamped = clampScrollPosition(scrollPositionDouble()); 3644 clamped = clampScrollPosition(scrollPositionDouble());
3656 } 3645 }
3657 if (clamped != scrollPositionDouble() || scrollOriginChanged()) { 3646 if (clamped != scrollPositionDouble() || scrollOriginChanged()) {
3658 ScrollableArea::setScrollPosition(clamped, ProgrammaticScroll); 3647 ScrollableArea::setScrollPosition(clamped, ProgrammaticScroll);
3659 resetScrollOriginChanged(); 3648 resetScrollOriginChanged();
3660 } 3649 }
3661 } 3650 }
3662 3651
3663 IntRect FrameView::rectToCopyOnScroll() const
3664 {
3665 IntRect scrollViewRect = convertToRootFrame(IntRect((shouldPlaceVerticalScro llbarOnLeft() && verticalScrollbar()) ? verticalScrollbar()->width() : 0, 0, vis ibleWidth(), visibleHeight()));
3666 if (hasOverlayScrollbars()) {
3667 int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVertica lScrollbar()) ? verticalScrollbar()->width() : 0;
3668 int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHo rizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
3669
3670 scrollViewRect.setWidth(scrollViewRect.width() - verticalScrollbarWidth) ;
3671 scrollViewRect.setHeight(scrollViewRect.height() - horizontalScrollbarHe ight);
3672 }
3673 return scrollViewRect;
3674 }
3675
3676 void FrameView::scrollContentsIfNeeded() 3652 void FrameView::scrollContentsIfNeeded()
3677 { 3653 {
3678 if (m_pendingScrollDelta.isZero()) 3654 if (m_pendingScrollDelta.isZero())
3679 return; 3655 return;
3680 DoubleSize scrollDelta = m_pendingScrollDelta; 3656 DoubleSize scrollDelta = m_pendingScrollDelta;
3681 m_pendingScrollDelta = DoubleSize(); 3657 m_pendingScrollDelta = DoubleSize();
3682 // FIXME: Change scrollContents() to take DoubleSize. crbug.com/414283. 3658 // FIXME: Change scrollContents() to take DoubleSize. crbug.com/414283.
3683 scrollContents(flooredIntSize(scrollDelta)); 3659 scrollContents(flooredIntSize(scrollDelta));
3684 } 3660 }
3685 3661
3686 void FrameView::scrollContents(const IntSize& scrollDelta) 3662 void FrameView::scrollContents(const IntSize& scrollDelta)
3687 { 3663 {
3688 HostWindow* window = getHostWindow(); 3664 HostWindow* window = getHostWindow();
3689 if (!window) 3665 if (!window)
3690 return; 3666 return;
3691 3667
3692 TRACE_EVENT0("blink", "FrameView::scrollContents"); 3668 TRACE_EVENT0("blink", "FrameView::scrollContents");
3693 3669
3694 IntRect clipRect = windowClipRect();
3695 IntRect updateRect = clipRect;
3696 updateRect.intersect(rectToCopyOnScroll());
3697
3698 if (!scrollContentsFastPath(-scrollDelta)) 3670 if (!scrollContentsFastPath(-scrollDelta))
3699 scrollContentsSlowPath(updateRect); 3671 scrollContentsSlowPath();
3700 3672
3701 // This call will move children with native widgets (plugins) and invalidate them as well. 3673 // This call will move children with native widgets (plugins) and invalidate them as well.
3702 frameRectsChanged(); 3674 frameRectsChanged();
3703 } 3675 }
3704 3676
3705 IntPoint FrameView::contentsToFrame(const IntPoint& pointInContentSpace) const 3677 IntPoint FrameView::contentsToFrame(const IntPoint& pointInContentSpace) const
3706 { 3678 {
3707 return pointInContentSpace - scrollOffset(); 3679 return pointInContentSpace - scrollOffset();
3708 } 3680 }
3709 3681
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
4281 } 4253 }
4282 4254
4283 bool FrameView::canThrottleRendering() const 4255 bool FrameView::canThrottleRendering() const
4284 { 4256 {
4285 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4257 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4286 return false; 4258 return false;
4287 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4259 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4288 } 4260 }
4289 4261
4290 } // namespace blink 4262 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/web/tests/TouchActionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698