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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 395463003: Invalidate previous paint rect in RenderObject::paintInvalidationForWholeRenderer() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Invalidate both old and new paint rects Created 6 years, 5 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 | Annotate | Revision Log
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 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 if (!isRooted()) 1523 if (!isRooted())
1524 return; 1524 return;
1525 1525
1526 if (view()->document().printing()) 1526 if (view()->document().printing())
1527 return; // Don't invalidate paints if we're printing. 1527 return; // Don't invalidate paints if we're printing.
1528 1528
1529 // FIXME: really, we're in the paint invalidation phase here, and the follow ing queries are legal. 1529 // FIXME: really, we're in the paint invalidation phase here, and the follow ing queries are legal.
1530 // Until those states are fully fledged, I'll just disable the ASSERTS. 1530 // Until those states are fully fledged, I'll just disable the ASSERTS.
1531 DisableCompositingQueryAsserts disabler; 1531 DisableCompositingQueryAsserts disabler;
1532 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation(); 1532 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation();
1533
1534 // FIXME: We should invalidate previousPaintInvalidationRect, but for now we invalidate
1535 // both the previous and current paint rects to meet the expectations of som e callers in some cases:
dsinclair 2014/07/25 14:16:31 Can we add a crbug for this and block it on the tw
Xianzhu 2014/07/25 17:02:05 Done.
1536 // - transform style change without a layout - crbug.com/394004;
1537 // - objects that don't save previousPaintInvalidationRect - crbug.com/39413 3.
1533 LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInval idationContainer); 1538 LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInval idationContainer);
1534 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR ect, InvalidationPaint); 1539 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR ect, InvalidationPaint);
1540 if (paintInvalidationRect != previousPaintInvalidationRect())
1541 invalidatePaintUsingContainer(paintInvalidationContainer, previousPaintI nvalidationRect(), InvalidationPaint);
1535 } 1542 }
1536 1543
1537 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const 1544 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const
1538 { 1545 {
1539 if (!paintInvalidationContainer) 1546 if (!paintInvalidationContainer)
1540 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState); 1547 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState);
1541 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState); 1548 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState);
1542 } 1549 }
1543 1550
1544 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const 1551 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 } 2062 }
2056 2063
2057 if (updatedDiff.needsRepaint()) { 2064 if (updatedDiff.needsRepaint()) {
2058 // Invalidate paints with the new style, e.g., for example if we go from not having 2065 // Invalidate paints with the new style, e.g., for example if we go from not having
2059 // an outline to having an outline. 2066 // an outline to having an outline.
2060 2067
2061 // The paintInvalidationForWholeRenderer() call is needed for non-layout changes to style. See the corresponding 2068 // The paintInvalidationForWholeRenderer() call is needed for non-layout changes to style. See the corresponding
2062 // comment in RenderObject::styleWillChange for why. 2069 // comment in RenderObject::styleWillChange for why.
2063 if (needsLayout()) 2070 if (needsLayout())
2064 setShouldDoFullPaintInvalidation(true); 2071 setShouldDoFullPaintInvalidation(true);
2065 else if (!selfNeedsLayout()) 2072 else
2066 paintInvalidationForWholeRenderer(); 2073 paintInvalidationForWholeRenderer();
2067 } 2074 }
2068 } 2075 }
2069 2076
2070 static inline bool rendererHasBackground(const RenderObject* renderer) 2077 static inline bool rendererHasBackground(const RenderObject* renderer)
2071 { 2078 {
2072 return renderer && renderer->hasBackground(); 2079 return renderer && renderer->hasBackground();
2073 } 2080 }
2074 2081
2075 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS tyle) 2082 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS tyle)
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
3448 { 3455 {
3449 if (object1) { 3456 if (object1) {
3450 const blink::RenderObject* root = object1; 3457 const blink::RenderObject* root = object1;
3451 while (root->parent()) 3458 while (root->parent())
3452 root = root->parent(); 3459 root = root->parent();
3453 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3460 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3454 } 3461 }
3455 } 3462 }
3456 3463
3457 #endif 3464 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698