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

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

Issue 865353002: Implement clip and scroll DisplayItems for PartPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: de-dupe clipRoundedInnerRect Created 5 years, 11 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/ReplacedPainter.cpp
diff --git a/Source/core/paint/ReplacedPainter.cpp b/Source/core/paint/ReplacedPainter.cpp
index 0edf96fa1936921c546edc534bd7c40d4deb3e4a..07a0306f9ebfe6f3d5da8345668817aadc33e50c 100644
--- a/Source/core/paint/ReplacedPainter.cpp
+++ b/Source/core/paint/ReplacedPainter.cpp
@@ -9,6 +9,7 @@
#include "core/paint/GraphicsContextAnnotator.h"
#include "core/paint/ObjectPainter.h"
#include "core/paint/RenderDrawingRecorder.h"
+#include "core/paint/RoundedInnerRectClipper.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderReplaced.h"
@@ -61,6 +62,7 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
return;
bool completelyClippedOut = false;
+ OwnPtr<RoundedInnerRectClipper> clipper;
if (m_renderReplaced.style()->hasBorderRadius()) {
LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_renderReplaced.size());
@@ -71,7 +73,8 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
paintInfo.context->save();
FloatRoundedRect roundedInnerRect = m_renderReplaced.style()->getRoundedInnerBorderFor(paintRect,
m_renderReplaced.paddingTop() + m_renderReplaced.borderTop(), m_renderReplaced.paddingBottom() + m_renderReplaced.borderBottom(), m_renderReplaced.paddingLeft() + m_renderReplaced.borderLeft(), m_renderReplaced.paddingRight() + m_renderReplaced.borderRight(), true, true);
- BoxPainter::clipRoundedInnerRect(paintInfo.context, paintRect, roundedInnerRect);
+
+ clipper = adoptPtr(new RoundedInnerRectClipper(m_renderReplaced, paintInfo, paintRect, roundedInnerRect, ApplyToContext));
}
}
@@ -81,10 +84,8 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
} else {
m_renderReplaced.paintReplaced(paintInfo, adjustedPaintOffset);
}
-
- if (m_renderReplaced.style()->hasBorderRadius())
- paintInfo.context->restore();
}
+ clipper.clear();
// The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of
// surrounding content.

Powered by Google App Engine
This is Rietveld 408576698