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

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

Issue 1284203004: Generate scroll/clip display item hierarchy for SPv2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix failing test. Update test expectation. Created 5 years, 3 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/LayerClipRecorder.cpp
diff --git a/Source/core/paint/LayerClipRecorder.cpp b/Source/core/paint/LayerClipRecorder.cpp
index 748999d616ee5be0b64ce38d9cd791740081ea58..cc24eb0aa167135254bf3844e0bd1196245067f1 100644
--- a/Source/core/paint/LayerClipRecorder.cpp
+++ b/Source/core/paint/LayerClipRecorder.cpp
@@ -39,6 +39,28 @@ LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext, const Lay
}
}
+LayerClipRecorder::LayerClipRecorder(GraphicsContext& context, const LayoutBox& layoutBox, const LayoutPoint& paintOffset)
+ : m_graphicsContext(context)
+ , m_layoutObject(layoutBox)
+ , m_clipType(DisplayItem::ClipDescendantStackingContext)
+{
+ ASSERT(layoutBox.hasOverflowClip());
pdr. 2015/09/03 06:16:59 Can you assert spv2 here? ASSERT(RuntimeEnabledFea
trchen 2015/09/04 06:10:15 Done.
+
+ LayoutRect clipRect = layoutBox.overflowClipRect(paintOffset);
+ Vector<FloatRoundedRect> roundedRects;
+ if (layoutBox.style()->hasBorderRadius())
+ roundedRects.append(layoutBox.style()->getRoundedInnerBorderFor(LayoutRect(paintOffset, layoutBox.size())));
+
+ if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
+ if (m_graphicsContext.displayItemList()->displayItemConstructionIsDisabled())
+ return;
+ m_graphicsContext.displayItemList()->createAndAppend<ClipDisplayItem>(m_layoutObject, m_clipType, pixelSnappedIntRect(clipRect), roundedRects);
+ } else {
+ ClipDisplayItem clipDisplayItem(m_layoutObject, m_clipType, pixelSnappedIntRect(clipRect), roundedRects);
+ clipDisplayItem.replay(m_graphicsContext);
+ }
+}
+
static bool inContainingBlockChain(DeprecatedPaintLayer* startLayer, DeprecatedPaintLayer* endLayer)
{
if (startLayer == endLayer)

Powered by Google App Engine
This is Rietveld 408576698