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

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

Issue 2051333005: Let FrameView track object paint invalidations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@TrackInvalidation
Patch Set: - Created 4 years, 6 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 245
246 // Fixed-position is painted using transform. In the case that the object 246 // Fixed-position is painted using transform. In the case that the object
247 // gets the same layout after changing position property, although no 247 // gets the same layout after changing position property, although no
248 // re-raster (rect-based invalidation) is needed, display items should 248 // re-raster (rect-based invalidation) is needed, display items should
249 // still update their paint offset. 249 // still update their paint offset.
250 if (oldStyle) { 250 if (oldStyle) {
251 bool newStyleIsFixedPosition = style()->position() == FixedPosition; 251 bool newStyleIsFixedPosition = style()->position() == FixedPosition;
252 bool oldStyleIsFixedPosition = oldStyle->position() == FixedPosition; 252 bool oldStyleIsFixedPosition = oldStyle->position() == FixedPosition;
253 if (newStyleIsFixedPosition != oldStyleIsFixedPosition) 253 if (newStyleIsFixedPosition != oldStyleIsFixedPosition)
254 invalidateDisplayItemClientsIncludingNonCompositingDescendants(nullp tr, PaintInvalidationStyleChange); 254 invalidateDisplayItemClientsIncludingNonCompositingDescendants(Paint InvalidationStyleChange);
255 } 255 }
256 256
257 // The used style for body background may change due to computed style chang e 257 // The used style for body background may change due to computed style chang e
258 // on the document element because of background stealing. 258 // on the document element because of background stealing.
259 // Refer to backgroundStolenForBeingBody() and 259 // Refer to backgroundStolenForBeingBody() and
260 // http://www.w3.org/TR/css3-background/#body-background for more info. 260 // http://www.w3.org/TR/css3-background/#body-background for more info.
261 if (isDocumentElement()) { 261 if (isDocumentElement()) {
262 HTMLBodyElement* body = document().firstBodyElement(); 262 HTMLBodyElement* body = document().firstBodyElement();
263 LayoutObject* bodyLayout = body ? body->layoutObject() : nullptr; 263 LayoutObject* bodyLayout = body ? body->layoutObject() : nullptr;
264 if (bodyLayout && bodyLayout->isBoxModelObject()) { 264 if (bodyLayout && bodyLayout->isBoxModelObject()) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } else if (object.compositedScrollsWithRespectTo(*this)) { 431 } else if (object.compositedScrollsWithRespectTo(*this)) {
432 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect (r, invalidationReason, object); 432 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect (r, invalidationReason, object);
433 } else if (usesCompositedScrolling()) { 433 } else if (usesCompositedScrolling()) {
434 layer()->compositedLayerMapping()->setNonScrollingContentsNeedDisplayInR ect(r, invalidationReason, object); 434 layer()->compositedLayerMapping()->setNonScrollingContentsNeedDisplayInR ect(r, invalidationReason, object);
435 } else { 435 } else {
436 // Otherwise invalidate everything. 436 // Otherwise invalidate everything.
437 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object); 437 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object);
438 } 438 }
439 } 439 }
440 440
441 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClient& displayItemClient, PaintInvalidationReason invalidationReason, const La youtObject* layoutObject) const
442 {
443 displayItemClient.setDisplayItemsUncached();
444
445 // We need to inform the GraphicsLayer about this paint invalidation only wh en we are tracking
446 // paint invalidation or ENABLE(ASSERT).
447 #if !ENABLE(ASSERT)
448 if (!frameView()->isTrackingPaintInvalidations())
449 return;
450 #endif
451
452 if (layer()->groupedMapping()) {
453 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer())
454 squashingLayer->displayItemClientWasInvalidated(displayItemClient, i nvalidationReason);
455 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) {
456 if (layoutObject && layoutObject->compositedScrollsWithRespectTo(*this))
457 compositedLayerMapping->scrollingDisplayItemClientWasInvalidated(dis playItemClient, invalidationReason);
458 else
459 compositedLayerMapping->displayItemClientWasInvalidated(displayItemC lient, invalidationReason);
460 }
461 }
462
463 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const 441 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const
464 { 442 {
465 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 443 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
466 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects(). 444 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects().
467 if (child->isOutOfFlowPositioned()) 445 if (child->isOutOfFlowPositioned())
468 continue; 446 continue;
469 447
470 // Outline of an element continuation or anonymous block continuation is added when we iterate the continuation chain. 448 // Outline of an element continuation or anonymous block continuation is added when we iterate the continuation chain.
471 // See LayoutBlock::addOutlineRects() and LayoutInline::addOutlineRects( ). 449 // See LayoutBlock::addOutlineRects() and LayoutInline::addOutlineRects( ).
472 if (child->isElementContinuation() 450 if (child->isElementContinuation()
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 if (rootElementStyle->hasBackground()) 1104 if (rootElementStyle->hasBackground())
1127 return false; 1105 return false;
1128 1106
1129 if (node() != document().firstBodyElement()) 1107 if (node() != document().firstBodyElement())
1130 return false; 1108 return false;
1131 1109
1132 return true; 1110 return true;
1133 } 1111 }
1134 1112
1135 } // namespace blink 1113 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698