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/layout/LayoutObject.cpp

Issue 2761673005: Optimize scroll adjustment for paint invalidation
Patch Set: - Created 3 years, 9 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 // DisplayItemClient. 1105 // DisplayItemClient.
1106 ObjectPaintInvalidator(*this).invalidateDisplayItemClient(*this, reason); 1106 ObjectPaintInvalidator(*this).invalidateDisplayItemClient(*this, reason);
1107 } 1107 }
1108 1108
1109 bool LayoutObject::compositedScrollsWithRespectTo( 1109 bool LayoutObject::compositedScrollsWithRespectTo(
1110 const LayoutBoxModelObject& paintInvalidationContainer) const { 1110 const LayoutBoxModelObject& paintInvalidationContainer) const {
1111 return paintInvalidationContainer.usesCompositedScrolling() && 1111 return paintInvalidationContainer.usesCompositedScrolling() &&
1112 this != &paintInvalidationContainer; 1112 this != &paintInvalidationContainer;
1113 } 1113 }
1114 1114
1115 IntSize LayoutObject::scrollAdjustmentForPaintInvalidation(
1116 const LayoutBoxModelObject& paintInvalidationContainer) const {
1117 // Non-composited scrolling should be included in the bounds of scrolled
1118 // items. Since mapToVisualRectInAncestorSpace does not include scrolling of
1119 // the ancestor, we need to add it back in after.
1120 if (paintInvalidationContainer.isBox() &&
1121 !paintInvalidationContainer.usesCompositedScrolling() &&
1122 this != &paintInvalidationContainer) {
1123 const LayoutBox* box = toLayoutBox(&paintInvalidationContainer);
1124 if (box->hasOverflowClip())
1125 return -box->scrolledContentOffset();
1126 }
1127 return IntSize();
1128 }
1129
1130 LayoutRect LayoutObject::invalidatePaintRectangle( 1115 LayoutRect LayoutObject::invalidatePaintRectangle(
1131 const LayoutRect& dirtyRect, 1116 const LayoutRect& dirtyRect,
1132 DisplayItemClient* displayItemClient) const { 1117 DisplayItemClient* displayItemClient) const {
1133 return ObjectPaintInvalidator(*this).invalidatePaintRectangle( 1118 return ObjectPaintInvalidator(*this).invalidatePaintRectangle(
1134 dirtyRect, displayItemClient); 1119 dirtyRect, displayItemClient);
1135 } 1120 }
1136 1121
1137 void LayoutObject::invalidateTreeIfNeeded( 1122 void LayoutObject::invalidateTreeIfNeeded(
1138 const PaintInvalidationState& paintInvalidationState) { 1123 const PaintInvalidationState& paintInvalidationState) {
1139 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); 1124 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after
3625 const blink::LayoutObject* root = object1; 3610 const blink::LayoutObject* root = object1;
3626 while (root->parent()) 3611 while (root->parent())
3627 root = root->parent(); 3612 root = root->parent();
3628 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3613 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3629 } else { 3614 } else {
3630 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3615 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3631 } 3616 }
3632 } 3617 }
3633 3618
3634 #endif 3619 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/PaintInvalidationState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698