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

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

Issue 931003002: Move and rename RenderPart to LayoutPart. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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.h ('k') | Source/core/rendering/RenderEmbeddedObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/PartPainter.cpp
diff --git a/Source/core/paint/PartPainter.cpp b/Source/core/paint/PartPainter.cpp
index 32275dbc9d5fe407a980e5fdca863e7f1622b962..df0661298f287d7a7fcf9075cc5040440d44b624 100644
--- a/Source/core/paint/PartPainter.cpp
+++ b/Source/core/paint/PartPainter.cpp
@@ -6,6 +6,7 @@
#include "core/paint/PartPainter.h"
#include "core/layout/Layer.h"
+#include "core/layout/LayoutPart.h"
#include "core/layout/PaintInfo.h"
#include "core/paint/BoxPainter.h"
#include "core/paint/GraphicsContextAnnotator.h"
@@ -13,80 +14,79 @@
#include "core/paint/RoundedInnerRectClipper.h"
#include "core/paint/ScrollableAreaPainter.h"
#include "core/paint/TransformRecorder.h"
-#include "core/rendering/RenderPart.h"
namespace blink {
void PartPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_renderPart);
+ ANNOTATE_GRAPHICS_CONTEXT(paintInfo, &m_layoutPart);
- if (!m_renderPart.shouldPaint(paintInfo, paintOffset))
+ if (!m_layoutPart.shouldPaint(paintInfo, paintOffset))
return;
- LayoutPoint adjustedPaintOffset = paintOffset + m_renderPart.location();
- LayoutRect borderRect(adjustedPaintOffset, m_renderPart.size());
+ LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location();
+ LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size());
- if (m_renderPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
- BoxPainter(m_renderPart).paintBoxDecorationBackground(paintInfo, adjustedPaintOffset);
+ if (m_layoutPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
+ BoxPainter(m_layoutPart).paintBoxDecorationBackground(paintInfo, adjustedPaintOffset);
if (paintInfo.phase == PaintPhaseMask) {
- BoxPainter(m_renderPart).paintMask(paintInfo, adjustedPaintOffset);
+ BoxPainter(m_layoutPart).paintMask(paintInfo, adjustedPaintOffset);
return;
}
- if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && m_renderPart.style()->hasOutline())
- ObjectPainter(m_renderPart).paintOutline(paintInfo, borderRect);
+ if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && m_layoutPart.style()->hasOutline())
+ ObjectPainter(m_layoutPart).paintOutline(paintInfo, borderRect);
if (paintInfo.phase != PaintPhaseForeground)
return;
{
OwnPtr<RoundedInnerRectClipper> clipper;
- if (m_renderPart.style()->hasBorderRadius()) {
+ if (m_layoutPart.style()->hasBorderRadius()) {
if (borderRect.isEmpty())
return;
- FloatRoundedRect roundedInnerRect = m_renderPart.style()->getRoundedInnerBorderFor(borderRect,
- m_renderPart.paddingTop() + m_renderPart.borderTop(), m_renderPart.paddingBottom() + m_renderPart.borderBottom(), m_renderPart.paddingLeft() + m_renderPart.borderLeft(), m_renderPart.paddingRight() + m_renderPart.borderRight(), true, true);
- clipper = adoptPtr(new RoundedInnerRectClipper(m_renderPart, paintInfo, borderRect, roundedInnerRect, ApplyToDisplayListIfEnabled));
+ FloatRoundedRect roundedInnerRect = m_layoutPart.style()->getRoundedInnerBorderFor(borderRect,
+ m_layoutPart.paddingTop() + m_layoutPart.borderTop(), m_layoutPart.paddingBottom() + m_layoutPart.borderBottom(), m_layoutPart.paddingLeft() + m_layoutPart.borderLeft(), m_layoutPart.paddingRight() + m_layoutPart.borderRight(), true, true);
+ clipper = adoptPtr(new RoundedInnerRectClipper(m_layoutPart, paintInfo, borderRect, roundedInnerRect, ApplyToDisplayListIfEnabled));
}
- if (m_renderPart.widget())
- m_renderPart.paintContents(paintInfo, paintOffset);
+ if (m_layoutPart.widget())
+ m_layoutPart.paintContents(paintInfo, paintOffset);
}
// Paint a partially transparent wash over selected widgets.
- if (m_renderPart.isSelected() && !m_renderPart.document().printing()) {
- LayoutRect rect = m_renderPart.localSelectionRect();
+ if (m_layoutPart.isSelected() && !m_layoutPart.document().printing()) {
+ LayoutRect rect = m_layoutPart.localSelectionRect();
rect.moveBy(adjustedPaintOffset);
IntRect selectionRect = pixelSnappedIntRect(rect);
- RenderDrawingRecorder recorder(paintInfo.context, m_renderPart, paintInfo.phase, selectionRect);
- paintInfo.context->fillRect(selectionRect, m_renderPart.selectionBackgroundColor());
+ RenderDrawingRecorder recorder(paintInfo.context, m_layoutPart, paintInfo.phase, selectionRect);
+ paintInfo.context->fillRect(selectionRect, m_layoutPart.selectionBackgroundColor());
}
- if (m_renderPart.canResize())
- ScrollableAreaPainter(*m_renderPart.layer()->scrollableArea()).paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
+ if (m_layoutPart.canResize())
+ ScrollableAreaPainter(*m_layoutPart.layer()->scrollableArea()).paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
}
void PartPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
- LayoutPoint adjustedPaintOffset = paintOffset + m_renderPart.location();
+ LayoutPoint adjustedPaintOffset = paintOffset + m_layoutPart.location();
- Widget* widget = m_renderPart.widget();
+ Widget* widget = m_layoutPart.widget();
RELEASE_ASSERT(widget);
// Tell the widget to paint now. This is the only time the widget is allowed
// to paint itself. That way it will composite properly with z-indexed layers.
IntPoint widgetLocation = widget->frameRect().location();
- IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + m_renderPart.borderLeft() + m_renderPart.paddingLeft()),
- roundToInt(adjustedPaintOffset.y() + m_renderPart.borderTop() + m_renderPart.paddingTop()));
+ IntPoint paintLocation(roundToInt(adjustedPaintOffset.x() + m_layoutPart.borderLeft() + m_layoutPart.paddingLeft()),
+ roundToInt(adjustedPaintOffset.y() + m_layoutPart.borderTop() + m_layoutPart.paddingTop()));
IntRect paintRect = paintInfo.rect;
IntSize widgetPaintOffset = paintLocation - widgetLocation;
// When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer,
// not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing.
- TransformRecorder transform(*paintInfo.context, m_renderPart.displayItemClient(),
+ TransformRecorder transform(*paintInfo.context, m_layoutPart.displayItemClient(),
AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffset.height()));
paintRect.move(-widgetPaintOffset);
widget->paint(paintInfo.context, paintRect);
« no previous file with comments | « Source/core/paint/PartPainter.h ('k') | Source/core/rendering/RenderEmbeddedObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698