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

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

Issue 2872423002: Tweak PaintInvalidationReasons (Closed)
Patch Set: Rebaseline-cl Created 3 years, 7 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 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 GetLayoutView()->SetShouldDoFullPaintInvalidationOnResizeIfNeeded( 1699 GetLayoutView()->SetShouldDoFullPaintInvalidationOnResizeIfNeeded(
1700 width_changed, height_changed); 1700 width_changed, height_changed);
1701 } 1701 }
1702 } else if (height_changed) { 1702 } else if (height_changed) {
1703 // If the document rect doesn't fill the full view height, hiding the 1703 // If the document rect doesn't fill the full view height, hiding the
1704 // URL bar will expose area outside the current LayoutView so we need to 1704 // URL bar will expose area outside the current LayoutView so we need to
1705 // paint additional background. If RLS is on, we've already invalidated 1705 // paint additional background. If RLS is on, we've already invalidated
1706 // above. 1706 // above.
1707 LayoutViewItem lvi = GetLayoutViewItem(); 1707 LayoutViewItem lvi = GetLayoutViewItem();
1708 DCHECK(!lvi.IsNull()); 1708 DCHECK(!lvi.IsNull());
1709 if (lvi.DocumentRect().Height() < lvi.ViewRect().Height()) 1709 if (lvi.DocumentRect().Height() < lvi.ViewRect().Height()) {
1710 lvi.SetShouldDoFullPaintInvalidation(); 1710 lvi.SetShouldDoFullPaintInvalidation(
1711 PaintInvalidationReason::kGeometry);
1712 }
1711 } 1713 }
1712 } 1714 }
1713 1715
1714 if (GetFrame().GetDocument() && !IsInPerformLayout()) 1716 if (GetFrame().GetDocument() && !IsInPerformLayout())
1715 MarkViewportConstrainedObjectsForLayout(width_changed, height_changed); 1717 MarkViewportConstrainedObjectsForLayout(width_changed, height_changed);
1716 } 1718 }
1717 1719
1718 void FrameView::MarkViewportConstrainedObjectsForLayout(bool width_changed, 1720 void FrameView::MarkViewportConstrainedObjectsForLayout(bool width_changed,
1719 bool height_changed) { 1721 bool height_changed) {
1720 if (!HasViewportConstrainedObjects() || !(width_changed || height_changed)) 1722 if (!HasViewportConstrainedObjects() || !(width_changed || height_changed))
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1753 !frame_->GetEventHandler().IsMousePositionUnknown() && 1755 !frame_->GetEventHandler().IsMousePositionUnknown() &&
1754 page->GetFocusController().IsActive(); 1756 page->GetFocusController().IsActive();
1755 } 1757 }
1756 1758
1757 void FrameView::ScrollContentsIfNeededRecursive() { 1759 void FrameView::ScrollContentsIfNeededRecursive() {
1758 ForAllNonThrottledFrameViews( 1760 ForAllNonThrottledFrameViews(
1759 [](FrameView& frame_view) { frame_view.ScrollContentsIfNeeded(); }); 1761 [](FrameView& frame_view) { frame_view.ScrollContentsIfNeeded(); });
1760 } 1762 }
1761 1763
1762 void FrameView::InvalidateBackgroundAttachmentFixedObjects() { 1764 void FrameView::InvalidateBackgroundAttachmentFixedObjects() {
1763 for (const auto& layout_object : background_attachment_fixed_objects_) 1765 for (const auto& layout_object : background_attachment_fixed_objects_) {
1764 layout_object->SetShouldDoFullPaintInvalidation(); 1766 layout_object->SetShouldDoFullPaintInvalidation(
1767 PaintInvalidationReason::kBackground);
1768 }
1765 } 1769 }
1766 1770
1767 bool FrameView::HasBackgroundAttachmentFixedDescendants( 1771 bool FrameView::HasBackgroundAttachmentFixedDescendants(
1768 const LayoutObject& object) const { 1772 const LayoutObject& object) const {
1769 for (const auto* potential_descendant : 1773 for (const auto* potential_descendant :
1770 background_attachment_fixed_objects_) { 1774 background_attachment_fixed_objects_) {
1771 if (potential_descendant == &object) 1775 if (potential_descendant == &object)
1772 continue; 1776 continue;
1773 if (potential_descendant->IsDescendantOf(&object)) 1777 if (potential_descendant->IsDescendantOf(&object))
1774 return true; 1778 return true;
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
3473 // Thus we have to check that it makes sense to do paint 3477 // Thus we have to check that it makes sense to do paint
3474 // invalidation onto them here. 3478 // invalidation onto them here.
3475 if (!child_frame_view.GetLayoutView()) 3479 if (!child_frame_view.GetLayoutView())
3476 continue; 3480 continue;
3477 child_frame_view.DeprecatedInvalidateTreeRecursiveInternal(); 3481 child_frame_view.DeprecatedInvalidateTreeRecursiveInternal();
3478 } 3482 }
3479 } 3483 }
3480 3484
3481 // Process objects needing paint invalidation on the next frame. See the 3485 // Process objects needing paint invalidation on the next frame. See the
3482 // definition of PaintInvalidationDelayedFull for more details. 3486 // definition of PaintInvalidationDelayedFull for more details.
3483 for (auto& target : pending_delayed_paint_invalidations) 3487 for (auto& target : pending_delayed_paint_invalidations) {
3484 target->GetMutableForPainting().SetShouldDoFullPaintInvalidation( 3488 target->GetMutableForPainting().SetShouldDoFullPaintInvalidation(
3485 kPaintInvalidationDelayedFull); 3489 PaintInvalidationReason::kDelayedFull);
3490 }
3486 } 3491 }
3487 3492
3488 void FrameView::EnableAutoSizeMode(const IntSize& min_size, 3493 void FrameView::EnableAutoSizeMode(const IntSize& min_size,
3489 const IntSize& max_size) { 3494 const IntSize& max_size) {
3490 if (!auto_size_info_) 3495 if (!auto_size_info_)
3491 auto_size_info_ = FrameViewAutoSizeInfo::Create(this); 3496 auto_size_info_ = FrameViewAutoSizeInfo::Create(this);
3492 3497
3493 auto_size_info_->ConfigureAutoSizeMode(min_size, max_size); 3498 auto_size_info_->ConfigureAutoSizeMode(min_size, max_size);
3494 SetLayoutSizeFixedToFrameSize(true); 3499 SetLayoutSizeFixedToFrameSize(true);
3495 SetNeedsLayout(); 3500 SetNeedsLayout();
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after
5362 void FrameView::SetAnimationHost( 5367 void FrameView::SetAnimationHost(
5363 std::unique_ptr<CompositorAnimationHost> host) { 5368 std::unique_ptr<CompositorAnimationHost> host) {
5364 animation_host_ = std::move(host); 5369 animation_host_ = std::move(host);
5365 } 5370 }
5366 5371
5367 LayoutUnit FrameView::CaretWidth() const { 5372 LayoutUnit FrameView::CaretWidth() const {
5368 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1)); 5373 return LayoutUnit(GetChromeClient()->WindowToViewportScalar(1));
5369 } 5374 }
5370 5375
5371 } // namespace blink 5376 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698