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

Unified Diff: Source/core/paint/BoxClipper.cpp

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Ready for review Created 5 years, 6 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: Source/core/paint/BoxClipper.cpp
diff --git a/Source/core/paint/BoxClipper.cpp b/Source/core/paint/BoxClipper.cpp
index ce1de5652c9232df953bec572020b00fd471b139..34361623f6b98d4eded1179e3fc03a84175b9378 100644
--- a/Source/core/paint/BoxClipper.cpp
+++ b/Source/core/paint/BoxClipper.cpp
@@ -52,19 +52,23 @@ BoxClipper::BoxClipper(LayoutBox& box, const PaintInfo& paintInfo, const LayoutP
return;
}
- if (RuntimeEnabledFeatures::slimmingPaintEnabled())
- m_clipType = m_paintInfo.displayItemTypeForClipping();
-
- OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(m_box, m_clipType, pixelSnappedIntRect(clipRect));
- if (hasBorderRadius)
- clipDisplayItem->roundedRectClips().append(clipRoundedRect);
-
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
ASSERT(m_paintInfo.context->displayItemList());
- if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled())
- m_paintInfo.context->displayItemList()->add(clipDisplayItem.release());
+ m_clipType = m_paintInfo.displayItemTypeForClipping();
+ if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled()) {
+ if (hasBorderRadius)
+ m_paintInfo.context->displayItemList()->createAndAppendIfNeeded<ClipDisplayItem>(m_box, m_clipType, pixelSnappedIntRect(clipRect), clipRoundedRect);
+ else
+ m_paintInfo.context->displayItemList()->createAndAppendIfNeeded<ClipDisplayItem>(m_box, m_clipType, pixelSnappedIntRect(clipRect));
+ }
} else {
- clipDisplayItem->replay(*paintInfo.context);
+ if (hasBorderRadius) {
+ ClipDisplayItem clipDisplayItem(m_box, m_clipType, pixelSnappedIntRect(clipRect), clipRoundedRect);
+ clipDisplayItem.replay(*paintInfo.context);
+ } else {
+ ClipDisplayItem clipDisplayItem(m_box, m_clipType, pixelSnappedIntRect(clipRect));
+ clipDisplayItem.replay(*paintInfo.context);
+ }
}
m_pushedClip = true;
@@ -81,9 +85,8 @@ BoxClipper::~BoxClipper()
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
if (m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled())
return;
- OwnPtr<EndClipDisplayItem> endClipDisplayItem = EndClipDisplayItem::create(m_box, endType);
ASSERT(m_paintInfo.context->displayItemList());
- m_paintInfo.context->displayItemList()->add(endClipDisplayItem.release());
+ m_paintInfo.context->displayItemList()->createAndAppendIfNeeded<EndClipDisplayItem>(m_box, endType);
} else {
EndClipDisplayItem endClipDisplayItem(m_box, endType);
endClipDisplayItem.replay(*m_paintInfo.context);

Powered by Google App Engine
This is Rietveld 408576698