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

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

Issue 2235873002: Invalidate scrolling contents layer on background invalidations painted into it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invalidate entire scrolling contents layer. Created 4 years, 4 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic. 427 // FIXME: generalize accessors to backing GraphicsLayers so that this code i s squashing-agnostic.
428 if (layer()->groupedMapping()) { 428 if (layer()->groupedMapping()) {
429 LayoutRect paintInvalidationRect = r; 429 LayoutRect paintInvalidationRect = r;
430 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) { 430 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing Layer()) {
431 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account. 431 // Note: the subpixel accumulation of layer() does not need to be ad ded here. It is already taken into account.
432 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason, object); 432 squashingLayer->setNeedsDisplayInRect(enclosingIntRect(paintInvalida tionRect), invalidationReason, object);
433 } 433 }
434 } else if (object.compositedScrollsWithRespectTo(*this)) { 434 } else if (object.compositedScrollsWithRespectTo(*this)) {
435 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect (r, invalidationReason, object); 435 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayInRect (r, invalidationReason, object);
436 } else if (usesCompositedScrolling()) { 436 } else if (usesCompositedScrolling()) {
437 if (layer()->compositedLayerMapping()->shouldPaintBackgroundOntoScrollin gContentsLayer()) {
438 // TODO(flackr): Get a correct rect in the context of the scrolling contents layer to update
439 // rather than updating the entire rect.
440 const LayoutRect& scrollingContentsRect = toLayoutBox(this)->layoutO verflowRect();
441 layer()->compositedLayerMapping()->setScrollingContentsNeedDisplayIn Rect(scrollingContentsRect, invalidationReason, object);
442 }
437 layer()->compositedLayerMapping()->setNonScrollingContentsNeedDisplayInR ect(r, invalidationReason, object); 443 layer()->compositedLayerMapping()->setNonScrollingContentsNeedDisplayInR ect(r, invalidationReason, object);
438 } else { 444 } else {
439 // Otherwise invalidate everything. 445 // Otherwise invalidate everything.
440 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object); 446 layer()->compositedLayerMapping()->setContentsNeedDisplayInRect(r, inval idationReason, object);
441 } 447 }
442 } 448 }
443 449
444 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const 450 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset, IncludeBlockVisualOverflowOrNot incl udeBlockOverflows) const
445 { 451 {
446 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { 452 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) {
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1129 if (rootElementStyle->hasBackground()) 1135 if (rootElementStyle->hasBackground())
1130 return false; 1136 return false;
1131 1137
1132 if (node() != document().firstBodyElement()) 1138 if (node() != document().firstBodyElement())
1133 return false; 1139 return false;
1134 1140
1135 return true; 1141 return true;
1136 } 1142 }
1137 1143
1138 } // namespace blink 1144 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698