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

Side by Side Diff: Source/core/paint/BlockFlowPainter.cpp

Issue 763173003: Convert RenderBlockFlow code to use FloatingObject references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address Review Comments Created 5 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/BlockFlowPainter.h" 6 #include "core/paint/BlockFlowPainter.h"
7 7
8 #include "core/layout/FloatingObjects.h" 8 #include "core/layout/FloatingObjects.h"
9 #include "core/layout/Layer.h" 9 #include "core/layout/Layer.h"
10 #include "core/layout/LayoutBlockFlow.h" 10 #include "core/layout/LayoutBlockFlow.h"
(...skipping 11 matching lines...) Expand all
22 const FloatingObjectSet& floatingObjectSet = m_layoutBlockFlow.floatingObjec ts()->set(); 22 const FloatingObjectSet& floatingObjectSet = m_layoutBlockFlow.floatingObjec ts()->set();
23 FloatingObjectSetIterator end = floatingObjectSet.end(); 23 FloatingObjectSetIterator end = floatingObjectSet.end();
24 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++ it) { 24 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++ it) {
25 FloatingObject* floatingObject = it->get(); 25 FloatingObject* floatingObject = it->get();
26 // Only paint the object if our m_shouldPaint flag is set. 26 // Only paint the object if our m_shouldPaint flag is set.
27 if (floatingObject->shouldPaint() && !floatingObject->layoutObject()->ha sSelfPaintingLayer()) { 27 if (floatingObject->shouldPaint() && !floatingObject->layoutObject()->ha sSelfPaintingLayer()) {
28 PaintInfo currentPaintInfo(paintInfo); 28 PaintInfo currentPaintInfo(paintInfo);
29 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhas eBlockBackground; 29 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhas eBlockBackground;
30 // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin wo uld make this much cleaner. 30 // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin wo uld make this much cleaner.
31 LayoutPoint childPoint = m_layoutBlockFlow.flipFloatForWritingModeFo rChild( 31 LayoutPoint childPoint = m_layoutBlockFlow.flipFloatForWritingModeFo rChild(
32 floatingObject, LayoutPoint(paintOffset.x() 32 *floatingObject, LayoutPoint(paintOffset.x()
33 + m_layoutBlockFlow.xPositionForFloatIncludingMargin(floatingObj ect) - floatingObject->layoutObject()->location().x(), paintOffset.y() 33 + m_layoutBlockFlow.xPositionForFloatIncludingMargin(*floatingOb ject) - floatingObject->layoutObject()->location().x(), paintOffset.y()
34 + m_layoutBlockFlow.yPositionForFloatIncludingMargin(floatingObj ect) - floatingObject->layoutObject()->location().y())); 34 + m_layoutBlockFlow.yPositionForFloatIncludingMargin(*floatingOb ject) - floatingObject->layoutObject()->location().y()));
35 floatingObject->layoutObject()->paint(currentPaintInfo, childPoint); 35 floatingObject->layoutObject()->paint(currentPaintInfo, childPoint);
36 if (!preservePhase) { 36 if (!preservePhase) {
37 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds; 37 currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
38 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt); 38 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt);
39 currentPaintInfo.phase = PaintPhaseFloat; 39 currentPaintInfo.phase = PaintPhaseFloat;
40 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt); 40 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt);
41 currentPaintInfo.phase = PaintPhaseForeground; 41 currentPaintInfo.phase = PaintPhaseForeground;
42 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt); 42 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt);
43 currentPaintInfo.phase = PaintPhaseOutline; 43 currentPaintInfo.phase = PaintPhaseOutline;
44 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt); 44 floatingObject->layoutObject()->paint(currentPaintInfo, childPoi nt);
(...skipping 28 matching lines...) Expand all
73 gapRectsBounds = LayoutRect(m_layoutBlockFlow.localToContainerQu ad(FloatRect(localBounds), layer->layoutObject()).enclosingBoundingBox()); 73 gapRectsBounds = LayoutRect(m_layoutBlockFlow.localToContainerQu ad(FloatRect(localBounds), layer->layoutObject()).enclosingBoundingBox());
74 if (layer->layoutObject()->hasOverflowClip()) 74 if (layer->layoutObject()->hasOverflowClip())
75 gapRectsBounds.move(layer->layoutBox()->scrolledContentOffse t()); 75 gapRectsBounds.move(layer->layoutBox()->scrolledContentOffse t());
76 } 76 }
77 layer->addBlockSelectionGapsBounds(gapRectsBounds); 77 layer->addBlockSelectionGapsBounds(gapRectsBounds);
78 } 78 }
79 } 79 }
80 } 80 }
81 81
82 } // namespace blink 82 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698