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

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

Issue 1588543004: Remove paintInvalidationRect from display item client invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 240
241 // Fixed-position is painted using transform. In the case that the object 241 // Fixed-position is painted using transform. In the case that the object
242 // gets the same layout after changing position property, although no 242 // gets the same layout after changing position property, although no
243 // re-raster (rect-based invalidation) is needed, display items should 243 // re-raster (rect-based invalidation) is needed, display items should
244 // still update their paint offset. 244 // still update their paint offset.
245 if (oldStyle) { 245 if (oldStyle) {
246 bool newStyleIsFixedPosition = style()->position() == FixedPosition; 246 bool newStyleIsFixedPosition = style()->position() == FixedPosition;
247 bool oldStyleIsFixedPosition = oldStyle->position() == FixedPosition; 247 bool oldStyleIsFixedPosition = oldStyle->position() == FixedPosition;
248 if (newStyleIsFixedPosition != oldStyleIsFixedPosition) 248 if (newStyleIsFixedPosition != oldStyleIsFixedPosition)
249 invalidateDisplayItemClientsIncludingNonCompositingDescendants(nullp tr, PaintInvalidationStyleChange, nullptr); 249 invalidateDisplayItemClientsIncludingNonCompositingDescendants(nullp tr, PaintInvalidationStyleChange);
250 } 250 }
251 251
252 // The used style for body background may change due to computed style chang e 252 // The used style for body background may change due to computed style chang e
253 // on the document element because of background stealing. 253 // on the document element because of background stealing.
254 // Refer to backgroundStolenForBeingBody() and 254 // Refer to backgroundStolenForBeingBody() and
255 // http://www.w3.org/TR/css3-background/#body-background for more info. 255 // http://www.w3.org/TR/css3-background/#body-background for more info.
256 if (isDocumentElement()) { 256 if (isDocumentElement()) {
257 HTMLBodyElement* body = document().firstBodyElement(); 257 HTMLBodyElement* body = document().firstBodyElement();
258 LayoutObject* bodyLayout = body ? body->layoutObject() : nullptr; 258 LayoutObject* bodyLayout = body ? body->layoutObject() : nullptr;
259 if (bodyLayout && bodyLayout->isBoxModelObject()) { 259 if (bodyLayout && bodyLayout->isBoxModelObject()) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 LayoutRect paintInvalidationRect = r; 394 LayoutRect paintInvalidationRect = r;
395 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) { 395 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) {
396 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account. 396 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account.
397 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason); 397 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason);
398 } 398 }
399 } else { 399 } else {
400 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason); 400 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason);
401 } 401 }
402 } 402 }
403 403
404 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClient& displayItemClient, PaintInvalidationReason invalidationReason, const La youtRect* paintInvalidationRect) const 404 void LayoutBoxModelObject::invalidateDisplayItemClientOnBacking(const DisplayIte mClient& displayItemClient, PaintInvalidationReason invalidationReason) const
405 { 405 {
406 if (layer()->groupedMapping()) { 406 if (layer()->groupedMapping()) {
407 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) { 407 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer())
408 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account. 408 squashingLayer->invalidateDisplayItemClient(displayItemClient, inval idationReason);
409 IntRect paintInvalidationRectOnSquashingLayer;
410 if (paintInvalidationRect)
411 paintInvalidationRectOnSquashingLayer = enclosingIntRect(*paintI nvalidationRect);
412 squashingLayer->invalidateDisplayItemClient(displayItemClient, inval idationReason, paintInvalidationRect ? &paintInvalidationRectOnSquashingLayer : nullptr);
413 }
414 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) { 409 } else if (CompositedLayerMapping* compositedLayerMapping = layer()->composi tedLayerMapping()) {
415 compositedLayerMapping->invalidateDisplayItemClient(displayItemClient, i nvalidationReason, paintInvalidationRect); 410 compositedLayerMapping->invalidateDisplayItemClient(displayItemClient, i nvalidationReason);
416 } 411 }
417 } 412 }
418 413
419 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const 414 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const
420 { 415 {
421 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 416 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
422 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects(). 417 // Outlines of out-of-flow positioned descendants are handled in LayoutB lock::addOutlineRects().
423 if (child->isOutOfFlowPositioned()) 418 if (child->isOutOfFlowPositioned())
424 continue; 419 continue;
425 420
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 if (rootElementStyle->hasBackground()) 1059 if (rootElementStyle->hasBackground())
1065 return false; 1060 return false;
1066 1061
1067 if (node() != document().firstBodyElement()) 1062 if (node() != document().firstBodyElement())
1068 return false; 1063 return false;
1069 1064
1070 return true; 1065 return true;
1071 } 1066 }
1072 1067
1073 } // namespace blink 1068 } // 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