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

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: fix displayItemTypeForClipping unreachable failure 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
« no previous file with comments | « Source/core/paint/PartPainter.cpp ('k') | Source/core/paint/RoundedInnerRectClipper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ReplacedPainter.cpp
diff --git a/Source/core/paint/ReplacedPainter.cpp b/Source/core/paint/ReplacedPainter.cpp
index 0edf96fa1936921c546edc534bd7c40d4deb3e4a..49392140b918fc1e382eaf480f29a4ac4dd070e1 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"
@@ -60,30 +61,30 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint
if (renderDrawingRecorder && renderDrawingRecorder->canUseCachedDrawing())
return;
- bool completelyClippedOut = false;
- if (m_renderReplaced.style()->hasBorderRadius()) {
- LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_renderReplaced.size());
-
- if (borderRect.isEmpty()) {
- completelyClippedOut = true;
- } else {
- // Push a clip if we have a border radius, since we want to round the foreground content that gets painted.
- 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);
+ {
+ OwnPtr<RoundedInnerRectClipper> clipper;
+ bool completelyClippedOut = false;
+ if (m_renderReplaced.style()->hasBorderRadius()) {
+ LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_renderReplaced.size());
+
+ if (borderRect.isEmpty()) {
+ completelyClippedOut = true;
+ } else {
+ // Push a clip if we have a border radius, since we want to round the foreground content that gets painted.
+ 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);
+
+ clipper = adoptPtr(new RoundedInnerRectClipper(m_renderReplaced, paintInfo, paintRect, roundedInnerRect, ApplyToContext));
+ }
}
- }
- if (!completelyClippedOut) {
- if (paintInfo.phase == PaintPhaseClippingMask) {
- m_renderReplaced.paintClippingMask(paintInfo, adjustedPaintOffset);
- } else {
- m_renderReplaced.paintReplaced(paintInfo, adjustedPaintOffset);
+ if (!completelyClippedOut) {
+ if (paintInfo.phase == PaintPhaseClippingMask) {
+ m_renderReplaced.paintClippingMask(paintInfo, adjustedPaintOffset);
+ } else {
+ m_renderReplaced.paintReplaced(paintInfo, adjustedPaintOffset);
+ }
}
-
- if (m_renderReplaced.style()->hasBorderRadius())
- paintInfo.context->restore();
}
// The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of
« no previous file with comments | « Source/core/paint/PartPainter.cpp ('k') | Source/core/paint/RoundedInnerRectClipper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698