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

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

Issue 2292353003: Cherry-pick r415013 to M53. (Closed)
Patch Set: Created 4 years, 3 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. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 { 1225 {
1226 paintInvalidationState.paintingLayer().setNeedsRepaint(); 1226 paintInvalidationState.paintingLayer().setNeedsRepaint();
1227 invalidateDisplayItemClients(reason); 1227 invalidateDisplayItemClients(reason);
1228 } 1228 }
1229 1229
1230 bool LayoutObject::compositedScrollsWithRespectTo(const LayoutBoxModelObject& pa intInvalidationContainer) const 1230 bool LayoutObject::compositedScrollsWithRespectTo(const LayoutBoxModelObject& pa intInvalidationContainer) const
1231 { 1231 {
1232 return paintInvalidationContainer.usesCompositedScrolling() && this != &pain tInvalidationContainer; 1232 return paintInvalidationContainer.usesCompositedScrolling() && this != &pain tInvalidationContainer;
1233 } 1233 }
1234 1234
1235 void LayoutObject::invalidatePaintRectangle(const LayoutRect& dirtyRect) const 1235 void LayoutObject::invalidatePaintRectangle(const LayoutRect& dirtyRect, Display ItemClient* displayItemClient) const
1236 { 1236 {
1237 RELEASE_ASSERT(isRooted()); 1237 RELEASE_ASSERT(isRooted());
1238 1238
1239 if (dirtyRect.isEmpty()) 1239 if (dirtyRect.isEmpty())
1240 return; 1240 return;
1241 1241
1242 if (view()->document().printing()) 1242 if (view()->document().printing())
1243 return; // Don't invalidate paints if we're printing. 1243 return; // Don't invalidate paints if we're printing.
1244 1244
1245 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation(); 1245 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation();
1246 LayoutRect dirtyRectOnBacking = dirtyRect; 1246 LayoutRect dirtyRectOnBacking = dirtyRect;
1247 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai ner, dirtyRectOnBacking); 1247 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai ner, dirtyRectOnBacking);
1248 1248
1249 // Composited scrolling should not be included in the bounds of composited-s crolled items. 1249 // Composited scrolling should not be included in the bounds of composited-s crolled items.
1250 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) { 1250 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) {
1251 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset()); 1251 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset());
1252 dirtyRectOnBacking.move(inverseOffset); 1252 dirtyRectOnBacking.move(inverseOffset);
1253 } 1253 }
1254 1254
1255 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle); 1255 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle);
1256 1256
1257 slowSetPaintingLayerNeedsRepaint(); 1257 slowSetPaintingLayerNeedsRepaint();
1258 invalidateDisplayItemClients(PaintInvalidationRectangle); 1258 if (displayItemClient)
1259 invalidateDisplayItemClient(*displayItemClient, PaintInvalidationRectang le);
1260 else
1261 invalidateDisplayItemClients(PaintInvalidationRectangle);
1259 } 1262 }
1260 1263
1261 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv alidationState) 1264 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv alidationState)
1262 { 1265 {
1263 ASSERT(!needsLayout()); 1266 ASSERT(!needsLayout());
1264 1267
1265 // If we didn't need paint invalidation then our children don't need as well . 1268 // If we didn't need paint invalidation then our children don't need as well .
1266 // Skip walking down the tree as everything should be fine below us. 1269 // Skip walking down the tree as everything should be fine below us.
1267 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) 1270 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
1268 return; 1271 return;
(...skipping 2377 matching lines...) Expand 10 before | Expand all | Expand 10 after
3646 const blink::LayoutObject* root = object1; 3649 const blink::LayoutObject* root = object1;
3647 while (root->parent()) 3650 while (root->parent())
3648 root = root->parent(); 3651 root = root->parent();
3649 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3652 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3650 } else { 3653 } else {
3651 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3654 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3652 } 3655 }
3653 } 3656 }
3654 3657
3655 #endif 3658 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698