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

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: NeedsRebaseline 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 // Fixed-position is painted using transform. In the case that the object 247 // Fixed-position is painted using transform. In the case that the object
248 // gets the same layout after changing position property, although no 248 // gets the same layout after changing position property, although no
249 // re-raster (rect-based invalidation) is needed, display items should 249 // re-raster (rect-based invalidation) is needed, display items should
250 // still update their paint offset. 250 // still update their paint offset.
251 if (oldStyle) { 251 if (oldStyle) {
252 bool newStyleIsFixedPosition = style()->position() == FixedPosition; 252 bool newStyleIsFixedPosition = style()->position() == FixedPosition;
253 bool oldStyleIsFixedPosition = oldStyle->position() == FixedPosition; 253 bool oldStyleIsFixedPosition = oldStyle->position() == FixedPosition;
254 if (newStyleIsFixedPosition != oldStyleIsFixedPosition) 254 if (newStyleIsFixedPosition != oldStyleIsFixedPosition)
255 invalidateDisplayItemClientsIncludingNonCompositingDescendants(nullp tr, PaintInvalidationStyleChange); 255 invalidateDisplayItemClientsIncludingNonCompositingDescendants(Paint InvalidationStyleChange);
256 } 256 }
257 257
258 // The used style for body background may change due to computed style chang e 258 // The used style for body background may change due to computed style chang e
259 // on the document element because of background stealing. 259 // on the document element because of background stealing.
260 // Refer to backgroundStolenForBeingBody() and 260 // Refer to backgroundStolenForBeingBody() and
261 // http://www.w3.org/TR/css3-background/#body-background for more info. 261 // http://www.w3.org/TR/css3-background/#body-background for more info.
262 if (isDocumentElement()) { 262 if (isDocumentElement()) {
263 HTMLBodyElement* body = document().firstBodyElement(); 263 HTMLBodyElement* body = document().firstBodyElement();
264 LayoutObject* bodyLayout = body ? body->layoutObject() : nullptr; 264 LayoutObject* bodyLayout = body ? body->layoutObject() : nullptr;
265 if (bodyLayout && bodyLayout->isBoxModelObject()) { 265 if (bodyLayout && bodyLayout->isBoxModelObject()) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 } else if (object.compositedScrollsWithRespectTo(*this)) { 432 } else if (object.compositedScrollsWithRespectTo(*this)) {
433 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect (r, invalidationReason, object); 433 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect (r, invalidationReason, object);
434 } else if (usesCompositedScrolling()) { 434 } else if (usesCompositedScrolling()) {
435 layer()->compositedLayerMapping()->setNonScrollingContentsNeedDisplayInR ect(r, invalidationReason, object); 435 layer()->compositedLayerMapping()->setNonScrollingContentsNeedDisplayInR ect(r, invalidationReason, object);
436 } else { 436 } else {
437 // Otherwise invalidate everything. 437 // Otherwise invalidate everything.
438 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object); 438 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object);
439 } 439 }
440 } 440 }
441 441
442 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClient& displayItemClient, PaintInvalidationReason invalidationReason, const La youtObject* layoutObject) const
443 {
444 displayItemClient.setDisplayItemsUncached();
445
446 // We need to inform the GraphicsLayer about this paint invalidation only wh en we are tracking
447 // paint invalidation or ENABLE(ASSERT).
448 #if !ENABLE(ASSERT)
449 if (!frameView()->isTrackingPaintInvalidations())
450 return;
451 #endif
452
453 if (layer()->groupedMapping()) {
454 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer())
455 squashingLayer->displayItemClientWasInvalidated(displayItemClient, i nvalidationReason);
456 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) {
457 if (layoutObject && layoutObject->compositedScrollsWithRespectTo(*this))
458 compositedLayerMapping->scrollingDisplayItemClientWasInvalidated(dis playItemClient, invalidationReason);
459 else
460 compositedLayerMapping->displayItemClientWasInvalidated(displayItemC lient, invalidationReason);
461 }
462 }
463
464 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const 442 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const
465 { 443 {
466 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 444 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
467 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects(). 445 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects().
468 if (child->isOutOfFlowPositioned()) 446 if (child->isOutOfFlowPositioned())
469 continue; 447 continue;
470 448
471 // Outline of an element continuation or anonymous block continuation is added when we iterate the continuation chain. 449 // Outline of an element continuation or anonymous block continuation is added when we iterate the continuation chain.
472 // See LayoutBlock::addOutlineRects() and LayoutInline::addOutlineRects( ). 450 // See LayoutBlock::addOutlineRects() and LayoutInline::addOutlineRects( ).
473 if (child->isElementContinuation() 451 if (child->isElementContinuation()
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 if (rootElementStyle->hasBackground()) 1111 if (rootElementStyle->hasBackground())
1134 return false; 1112 return false;
1135 1113
1136 if (node() != document().firstBodyElement()) 1114 if (node() != document().firstBodyElement())
1137 return false; 1115 return false;
1138 1116
1139 return true; 1117 return true;
1140 } 1118 }
1141 1119
1142 } // namespace blink 1120 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutInline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698