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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp

Issue 2230513005: Move visual rect unioning between paired items to cc::DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
index c3f23f10a33fa5d6f954b9215cd12441797ab435..c7ecf68b4cf1047b58b55e0c380c628430fdcc0c 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -34,36 +34,7 @@ DisplayItem& DisplayItemList::appendByMoving(DisplayItem& item)
void DisplayItemList::appendVisualRect(const IntRect& visualRect)
{
- size_t itemIndex = m_visualRects.size();
- const DisplayItem& item = (*this)[itemIndex];
-
- // For paired display items such as transforms, since we are not guaranteed containment, the
- // visual rect must comprise the union of the visual rects for all items within its block.
-
- if (item.isBegin()) {
- m_visualRects.append(visualRect);
- m_beginItemIndices.append(itemIndex);
-
- } else if (item.isEnd()) {
- size_t lastBeginIndex = m_beginItemIndices.last();
- m_beginItemIndices.removeLast();
-
- // Ending bounds match the starting bounds.
- m_visualRects.append(m_visualRects[lastBeginIndex]);
-
- // The block that ended needs to be included in the bounds of the enclosing block.
- growCurrentBeginItemVisualRect(m_visualRects[lastBeginIndex]);
-
- } else {
- m_visualRects.append(visualRect);
- growCurrentBeginItemVisualRect(visualRect);
- }
-}
-
-void DisplayItemList::growCurrentBeginItemVisualRect(const IntRect& visualRect)
-{
- if (!m_beginItemIndices.isEmpty())
- m_visualRects[m_beginItemIndices.last()].unite(visualRect);
+ m_visualRects.append(visualRect);
}
DisplayItemList::Range<DisplayItemList::iterator>

Powered by Google App Engine
This is Rietveld 408576698