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

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: Simplified 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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1524 if (!isRooted()) 1524 if (!isRooted())
1525 return; 1525 return;
1526 1526
1527 if (view()->document().printing()) 1527 if (view()->document().printing())
1528 return; // Don't invalidate paints if we're printing. 1528 return; // Don't invalidate paints if we're printing.
1529 1529
1530 // FIXME: really, we're in the paint invalidation phase here, and the follow ing queries are legal. 1530 // FIXME: really, we're in the paint invalidation phase here, and the follow ing queries are legal.
1531 // Until those states are fully fledged, I'll just disable the ASSERTS. 1531 // Until those states are fully fledged, I'll just disable the ASSERTS.
1532 DisableCompositingQueryAsserts disabler; 1532 DisableCompositingQueryAsserts disabler;
1533 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation(); 1533 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint Invalidation();
1534 LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInval idationContainer); 1534
1535 // FIXME: We should invalidate previousPaintInvalidationRect, but for object s that don't save previousPaintInvalidationRect,
1536 // we have to use the current paint invalidation rect. crbug.com/394133.
1537 LayoutRect paintInvalidationRect = savesPreviousPaintInvalidationRect() ? pr eviousPaintInvalidationRect() : boundsRectForPaintInvalidation(paintInvalidation Container);
1535 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR ect, InvalidationPaint); 1538 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR ect, InvalidationPaint);
1536 } 1539 }
1537 1540
1538 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const 1541 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio nState) const
1539 { 1542 {
1540 if (!paintInvalidationContainer) 1543 if (!paintInvalidationContainer)
1541 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState); 1544 return computePaintInvalidationRect(paintInvalidationContainer, paintInv alidationState);
1542 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState); 1545 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont ainer->layer(), paintInvalidationState);
1543 } 1546 }
1544 1547
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 setNeedsLayoutAndPrefWidthsRecalc(); 2051 setNeedsLayoutAndPrefWidthsRecalc();
2049 else if (updatedDiff.needsPositionedMovementLayout()) 2052 else if (updatedDiff.needsPositionedMovementLayout())
2050 setNeedsPositionedMovementLayout(); 2053 setNeedsPositionedMovementLayout();
2051 } 2054 }
2052 2055
2053 if (diff.transformChanged() && !needsLayout()) { 2056 if (diff.transformChanged() && !needsLayout()) {
2054 if (RenderBlock* container = containingBlock()) 2057 if (RenderBlock* container = containingBlock())
2055 container->setNeedsOverflowRecalcAfterStyleChange(); 2058 container->setNeedsOverflowRecalcAfterStyleChange();
2056 } 2059 }
2057 2060
2058 if (updatedDiff.needsRepaint()) { 2061 if (updatedDiff.needsRepaint()) {
chrishtr 2014/07/16 17:56:25 Just discussed some more with Levi. I think you ca
Xianzhu 2014/07/16 18:05:39 OK will do. I have tried that way, but it seems to
2059 // Invalidate paints with the new style, e.g., for example if we go from not having 2062 // Invalidate paints with the new style, e.g., for example if we go from not having
2060 // an outline to having an outline. 2063 // an outline to having an outline.
2061 2064
2062 // The paintInvalidationForWholeRenderer() call is needed for non-layout changes to style. See the corresponding 2065 // The paintInvalidationForWholeRenderer() call is needed for non-layout changes to style. See the corresponding
2063 // comment in RenderObject::styleWillChange for why. 2066 // comment in RenderObject::styleWillChange for why.
2064 if (needsLayout()) 2067 if (needsLayout()) {
2065 setShouldDoFullPaintInvalidationAfterLayout(true); 2068 setShouldDoFullPaintInvalidationAfterLayout(true);
2066 else if (!selfNeedsLayout()) 2069 } else {
2070 if (savesPreviousPaintInvalidationRect())
2071 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation( containerForPaintInvalidation()));
leviw_travelin_and_unemployed 2014/07/16 23:06:48 Isn't this redundant with the change you're making
Xianzhu 2014/07/16 23:47:52 No. Actually this is paired with the change in pai
leviw_travelin_and_unemployed 2014/07/22 21:42:29 If we've ever put up a frame with the thing at the
Xianzhu 2014/07/22 21:53:52 This change has been abandoned. The above code was
2067 paintInvalidationForWholeRenderer(); 2072 paintInvalidationForWholeRenderer();
2073 }
2068 } 2074 }
2069 } 2075 }
2070 2076
2071 static inline bool rendererHasBackground(const RenderObject* renderer) 2077 static inline bool rendererHasBackground(const RenderObject* renderer)
2072 { 2078 {
2073 return renderer && renderer->hasBackground(); 2079 return renderer && renderer->hasBackground();
2074 } 2080 }
2075 2081
2076 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS tyle) 2082 void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS tyle)
2077 { 2083 {
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
3446 { 3452 {
3447 if (object1) { 3453 if (object1) {
3448 const WebCore::RenderObject* root = object1; 3454 const WebCore::RenderObject* root = object1;
3449 while (root->parent()) 3455 while (root->parent())
3450 root = root->parent(); 3456 root = root->parent();
3451 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3457 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3452 } 3458 }
3453 } 3459 }
3454 3460
3455 #endif 3461 #endif
OLDNEW
« Source/core/rendering/RenderObject.h ('K') | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698