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

Unified Diff: Source/core/rendering/InlineBox.cpp

Issue 21430003: Implement interfaces in PaintInfo and make it a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@getterPaintInfo01
Patch Set: Second try Created 7 years, 5 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/rendering/InlineBox.cpp
diff --git a/Source/core/rendering/InlineBox.cpp b/Source/core/rendering/InlineBox.cpp
index a1bc0b9c136570ccb34fb3a4f803cde55e5cd836..c20b9830ba273dd805e7f95f7fe60c7d9609c9ca 100644
--- a/Source/core/rendering/InlineBox.cpp
+++ b/Source/core/rendering/InlineBox.cpp
@@ -214,7 +214,7 @@ void InlineBox::adjustPosition(float dx, float dy)
void InlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/)
{
- if (!paintInfo.shouldPaintWithinRoot(renderer()) || (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection))
+ if (!paintInfo.shouldPaintWithinRoot(renderer()) || (paintInfo.getPhase() != PaintPhaseForeground && paintInfo.getPhase() != PaintPhaseSelection))
return;
LayoutPoint childPoint = paintOffset;
@@ -224,18 +224,19 @@ void InlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, Layo
// Paint all phases of replaced elements atomically, as though the replaced element established its
// own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1
// specification.)
- bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseTextClip;
+ bool preservePhase = paintInfo.getPhase() == PaintPhaseSelection || paintInfo.getPhase() == PaintPhaseTextClip;
PaintInfo info(paintInfo);
- info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
+ PaintPhase phase = preservePhase ? paintInfo.getPhase() : PaintPhaseBlockBackground;
+ info.setPhase(phase);
renderer()->paint(info, childPoint);
if (!preservePhase) {
- info.phase = PaintPhaseChildBlockBackgrounds;
+ info.setPhase(PaintPhaseChildBlockBackgrounds);
renderer()->paint(info, childPoint);
- info.phase = PaintPhaseFloat;
+ info.setPhase(PaintPhaseFloat);
renderer()->paint(info, childPoint);
- info.phase = PaintPhaseForeground;
+ info.setPhase(PaintPhaseForeground);
renderer()->paint(info, childPoint);
- info.phase = PaintPhaseOutline;
+ info.setPhase(PaintPhaseOutline);
renderer()->paint(info, childPoint);
}
}

Powered by Google App Engine
This is Rietveld 408576698