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

Side by Side Diff: Source/core/paint/BlockFlowPainter.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 unified diff | Download patch
« no previous file with comments | « Source/core/paint/BlockFlowPainter.h ('k') | Source/core/rendering/RenderBlockFlow.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/paint/BlockFlowPainter.h"
7
8 #include "core/rendering/FloatingObjects.h"
9 #include "core/rendering/PaintInfo.h"
10 #include "core/rendering/RenderBlockFlow.h"
11
12 namespace blink {
13
14 void BlockFlowPainter::paintFloats(PaintInfo& paintInfo, const LayoutPoint& pain tOffset, bool preservePhase)
15 {
16 if (!m_renderBlockFlow.floatingObjects())
17 return;
18
19 const FloatingObjectSet& floatingObjectSet = m_renderBlockFlow.floatingObjec ts()->set();
20 FloatingObjectSetIterator end = floatingObjectSet.end();
21 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++ it) {
22 FloatingObject* floatingObject = it->get();
23 // Only paint the object if our m_shouldPaint flag is set.
24 if (floatingObject->shouldPaint() && !floatingObject->renderer()->hasSel fPaintingLayer()) {
25 PaintInfo currentPaintInfo(paintInfo);
26 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhas eBlockBackground;
27 // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin wo uld make this much cleaner.
28 LayoutPoint childPoint = m_renderBlockFlow.flipFloatForWritingModeFo rChild(
29 floatingObject, LayoutPoint(paintOffset.x()
30 + m_renderBlockFlow.xPositionForFloatIncludingMargin(floatingObj ect) - floatingObject->renderer()->x(), paintOffset.y()
31 + m_renderBlockFlow.yPositionForFloatIncludingMargin(floatingObj ect) - floatingObject->renderer()->y()));
32 floatingObject->renderer()->paint(currentPaintInfo, childPoint);
33 if (!preservePhase) {
34 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
35 floatingObject->renderer()->paint(currentPaintInfo, childPoint);
36 currentPaintInfo.phase = PaintPhaseFloat;
37 floatingObject->renderer()->paint(currentPaintInfo, childPoint);
38 currentPaintInfo.phase = PaintPhaseForeground;
39 floatingObject->renderer()->paint(currentPaintInfo, childPoint);
40 currentPaintInfo.phase = PaintPhaseOutline;
41 floatingObject->renderer()->paint(currentPaintInfo, childPoint);
42 }
43 }
44 }
45 }
46
47 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/BlockFlowPainter.h ('k') | Source/core/rendering/RenderBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698