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

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

Issue 399173005: Incrementally invalidate boxes with borders if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject: :invalidatePaintIfNeeded()", 1661 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject: :invalidatePaintIfNeeded()",
1662 "object", this->debugName().ascii(), 1662 "object", this->debugName().ascii(),
1663 "info", jsonObjectForOldAndNewRects(oldBounds, newBounds)); 1663 "info", jsonObjectForOldAndNewRects(oldBounds, newBounds));
1664 1664
1665 InvalidationReason invalidationReason = getPaintInvalidationReason(paintInva lidationContainer, oldBounds, oldLocation, newBounds, newLocation); 1665 InvalidationReason invalidationReason = getPaintInvalidationReason(paintInva lidationContainer, oldBounds, oldLocation, newBounds, newLocation);
1666 1666
1667 if (invalidationReason == InvalidationNone) 1667 if (invalidationReason == InvalidationNone)
1668 return invalidationReason; 1668 return invalidationReason;
1669 1669
1670 if (invalidationReason == InvalidationIncremental) { 1670 if (invalidationReason == InvalidationIncremental) {
1671 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds); 1671 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds, newLocation);
1672 return invalidationReason; 1672 return invalidationReason;
1673 } 1673 }
1674 1674
1675 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds); 1675 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun ds, newBounds);
1676 return invalidationReason; 1676 return invalidationReason;
1677 } 1677 }
1678 1678
1679 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod elObject& paintInvalidationContainer, 1679 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod elObject& paintInvalidationContainer,
1680 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation) 1680 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation)
1681 { 1681 {
(...skipping 28 matching lines...) Expand all
1710 // This covers the case where we mark containing blocks for layout 1710 // This covers the case where we mark containing blocks for layout
1711 // and they change size but don't have anything to paint. This is 1711 // and they change size but don't have anything to paint. This is
1712 // a pretty common case for <body> as we add / remove children 1712 // a pretty common case for <body> as we add / remove children
1713 // (and the default background is done by FrameView). 1713 // (and the default background is done by FrameView).
1714 if (skipInvalidationWhenLaidOutChildren() && !mayNeedPaintInvalidation()) 1714 if (skipInvalidationWhenLaidOutChildren() && !mayNeedPaintInvalidation())
1715 return InvalidationNone; 1715 return InvalidationNone;
1716 1716
1717 return InvalidationIncremental; 1717 return InvalidationIncremental;
1718 } 1718 }
1719 1719
1720 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& pa intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun ds) 1720 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& pa intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun ds, const LayoutPoint& positionFromPaintInvalidationContainer)
1721 { 1721 {
1722 ASSERT(oldBounds.location() == newBounds.location()); 1722 ASSERT(oldBounds.location() == newBounds.location());
1723 1723
1724 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); 1724 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
1725 if (deltaRight > 0) 1725 if (deltaRight > 0)
1726 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol dBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncr emental); 1726 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol dBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncr emental);
1727 else if (deltaRight < 0) 1727 else if (deltaRight < 0)
1728 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ne wBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationInc remental); 1728 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ne wBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationInc remental);
1729 1729
1730 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); 1730 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
3474 { 3474 {
3475 if (object1) { 3475 if (object1) {
3476 const blink::RenderObject* root = object1; 3476 const blink::RenderObject* root = object1;
3477 while (root->parent()) 3477 while (root->parent())
3478 root = root->parent(); 3478 root = root->parent();
3479 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3479 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3480 } 3480 }
3481 } 3481 }
3482 3482
3483 #endif 3483 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698