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

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

Issue 583023002: Move paint code from RenderBlockFlow into BlockFlowPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix Created 6 years, 3 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/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderTableCell.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlockFlow.cpp
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index 068627320dad05554a93bd69b39d3ba7dbdbe420..1dec21bc0ebced9228759ef718b579d34d7a032e 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -36,6 +36,7 @@
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLDialogElement.h"
+#include "core/paint/BlockFlowPainter.h"
#include "core/rendering/HitTestLocation.h"
#include "core/rendering/RenderFlowThread.h"
#include "core/rendering/RenderLayer.h"
@@ -2102,32 +2103,7 @@ void RenderBlockFlow::invalidatePaintForOverflow()
void RenderBlockFlow::paintFloats(PaintInfo& paintInfo, const LayoutPoint& paintOffset, bool preservePhase)
{
- if (!m_floatingObjects)
- return;
-
- const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
- FloatingObjectSetIterator end = floatingObjectSet.end();
- for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
- FloatingObject* floatingObject = it->get();
- // Only paint the object if our m_shouldPaint flag is set.
- if (floatingObject->shouldPaint() && !floatingObject->renderer()->hasSelfPaintingLayer()) {
- PaintInfo currentPaintInfo(paintInfo);
- currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
- // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner.
- LayoutPoint childPoint = flipFloatForWritingModeForChild(floatingObject, LayoutPoint(paintOffset.x() + xPositionForFloatIncludingMargin(floatingObject) - floatingObject->renderer()->x(), paintOffset.y() + yPositionForFloatIncludingMargin(floatingObject) - floatingObject->renderer()->y()));
- floatingObject->renderer()->paint(currentPaintInfo, childPoint);
- if (!preservePhase) {
- currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
- floatingObject->renderer()->paint(currentPaintInfo, childPoint);
- currentPaintInfo.phase = PaintPhaseFloat;
- floatingObject->renderer()->paint(currentPaintInfo, childPoint);
- currentPaintInfo.phase = PaintPhaseForeground;
- floatingObject->renderer()->paint(currentPaintInfo, childPoint);
- currentPaintInfo.phase = PaintPhaseOutline;
- floatingObject->renderer()->paint(currentPaintInfo, childPoint);
- }
- }
- }
+ BlockFlowPainter(*this).paintFloats(paintInfo, paintOffset, preservePhase);
}
void RenderBlockFlow::clipOutFloatingObjects(const RenderBlock* rootBlock, const PaintInfo* paintInfo, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock) const
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698