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

Unified Diff: Source/core/rendering/RenderLineBoxList.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/RenderLineBoxList.cpp
diff --git a/Source/core/rendering/RenderLineBoxList.cpp b/Source/core/rendering/RenderLineBoxList.cpp
index 1205f19a1fe46009d8439ce88b3cc609f9772516..927b0f40ea420446f1a54b74c9de83b0f1fe36d9 100644
--- a/Source/core/rendering/RenderLineBoxList.cpp
+++ b/Source/core/rendering/RenderLineBoxList.cpp
@@ -186,21 +186,21 @@ bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, co
return rangeIntersectsRect(renderer, logicalTop, logicalBottom, rect, offset);
}
-bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, const PaintInfo& paintInfo, const LayoutPoint& offset) const
+bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer, InlineFlowBox* box, PaintInfo& paintInfo, const LayoutPoint& offset) const
{
RootInlineBox* root = box->root();
- LayoutUnit logicalTop = min<LayoutUnit>(box->logicalTopVisualOverflow(root->lineTop()), root->selectionTop()) - renderer->maximalOutlineSize(paintInfo.phase);
- LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(root->lineBottom()) + renderer->maximalOutlineSize(paintInfo.phase);
+ LayoutUnit logicalTop = min<LayoutUnit>(box->logicalTopVisualOverflow(root->lineTop()), root->selectionTop()) - renderer->maximalOutlineSize(paintInfo.getPhase());
+ LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(root->lineBottom()) + renderer->maximalOutlineSize(paintInfo.getPhase());
- return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.rect, offset);
+ return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.getRect(), offset);
}
void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
{
// Only paint during the foreground/selection phases.
- if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseOutline
- && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines && paintInfo.phase != PaintPhaseTextClip
- && paintInfo.phase != PaintPhaseMask)
+ if (paintInfo.getPhase() != PaintPhaseForeground && paintInfo.getPhase() != PaintPhaseSelection && paintInfo.getPhase() != PaintPhaseOutline
+ && paintInfo.getPhase() != PaintPhaseSelfOutline && paintInfo.getPhase() != PaintPhaseChildOutlines && paintInfo.getPhase() != PaintPhaseTextClip
+ && paintInfo.getPhase() != PaintPhaseMask)
return;
ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer->hasLayer())); // The only way an inline could paint like this is if it has a layer.
@@ -209,13 +209,13 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
if (!firstLineBox())
return;
- LayoutUnit outlineSize = renderer->maximalOutlineSize(paintInfo.phase);
- if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset, outlineSize))
+ LayoutUnit outlineSize = renderer->maximalOutlineSize(paintInfo.getPhase());
+ if (!anyLineIntersectsRect(renderer, paintInfo.getRect(), paintOffset, outlineSize))
return;
PaintInfo info(paintInfo);
ListHashSet<RenderInline*> outlineObjects;
- info.outlineObjects = &outlineObjects;
+ info.setOutlineObjects(&outlineObjects);
// See if our root lines intersect with the dirty rect. If so, then we paint
// them. Note that boxes can easily overlap, so we can't make any assumptions
@@ -227,13 +227,13 @@ void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
}
}
- if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline || info.phase == PaintPhaseChildOutlines) {
- ListHashSet<RenderInline*>::iterator end = info.outlineObjects->end();
- for (ListHashSet<RenderInline*>::iterator it = info.outlineObjects->begin(); it != end; ++it) {
+ if (info.getPhase() == PaintPhaseOutline || info.getPhase() == PaintPhaseSelfOutline || info.getPhase() == PaintPhaseChildOutlines) {
+ ListHashSet<RenderInline*>::iterator end = info.getOutlineObjects()->end();
+ for (ListHashSet<RenderInline*>::iterator it = info.getOutlineObjects()->begin(); it != end; ++it) {
RenderInline* flow = *it;
flow->paintOutline(info, paintOffset);
}
- info.outlineObjects->clear();
+ info.getOutlineObjects()->clear();
}
}

Powered by Google App Engine
This is Rietveld 408576698