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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1406133005: Calculate paint invalidation rect for scrollbars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 ASSERT(paintInvalidationContainer); 449 ASSERT(paintInvalidationContainer);
450 if (paintInvalidationContainer == this) 450 if (paintInvalidationContainer == this)
451 return; 451 return;
452 452
453 Element* owner = document().ownerElement(); 453 Element* owner = document().ownerElement();
454 if (!owner) 454 if (!owner)
455 return; 455 return;
456 456
457 if (LayoutBox* obj = owner->layoutBox()) { 457 if (LayoutBox* obj = owner->layoutBox()) {
458 // Intersect the viewport with the paint invalidation rect. 458 if (!state || !state->viewClippingAndScrollOffsetDisabled()) {
459 LayoutRect viewRectangle = viewRect(); 459 // Intersect the viewport with the paint invalidation rect.
460 rect.intersect(viewRectangle); 460 LayoutRect viewRectangle = viewRect();
461 rect.intersect(viewRectangle);
461 462
462 // Adjust for scroll offset of the view. 463 // Adjust for scroll offset of the view.
463 rect.moveBy(-viewRectangle.location()); 464 rect.moveBy(-viewRectangle.location());
465 }
464 466
465 // Adjust for frame border. 467 // Adjust for frame border.
466 rect.move(obj->contentBoxOffset()); 468 rect.move(obj->contentBoxOffset());
467 obj->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, 0); 469 obj->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, 0);
468 } 470 }
469 } 471 }
470 472
471 void LayoutView::adjustViewportConstrainedOffset(LayoutRect& rect, ViewportConst rainedPosition viewportConstraint) const 473 void LayoutView::adjustViewportConstrainedOffset(LayoutRect& rect, ViewportConst rainedPosition viewportConstraint) const
472 { 474 {
473 if (viewportConstraint != IsFixedPosition) 475 if (viewportConstraint != IsFixedPosition)
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 } 965 }
964 966
965 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect ) 967 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect )
966 { 968 {
967 for (auto& media : m_mediaForPositionNotification) { 969 for (auto& media : m_mediaForPositionNotification) {
968 media->notifyPositionMayHaveChanged(visibleRect); 970 media->notifyPositionMayHaveChanged(visibleRect);
969 } 971 }
970 } 972 }
971 973
972 } // namespace blink 974 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTheme.cpp ('k') | third_party/WebKit/Source/core/layout/PaintInvalidationState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698