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

Unified Diff: third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp

Issue 1569293003: Revert of ObjectPainter::paintAsStackingContext() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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: third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
index ee5fe04da99025bfeaae2c078bce0fd8a7505e37..6282469aabc55097d2e9900c9a20c814d1377f7e 100644
--- a/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BlockFlowPainter.cpp
@@ -8,35 +8,41 @@
#include "core/layout/LayoutBlockFlow.h"
#include "core/paint/ClipScope.h"
#include "core/paint/LayoutObjectDrawingRecorder.h"
-#include "core/paint/ObjectPainter.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/PaintLayer.h"
namespace blink {
-void BlockFlowPainter::paintFloats(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+void BlockFlowPainter::paintFloats(const PaintInfo& paintInfo, const LayoutPoint& paintOffset, bool preservePhase)
{
if (!m_layoutBlockFlow.floatingObjects())
return;
- ASSERT(paintInfo.phase == PaintPhaseFloat);
- PaintInfo floatPaintInfo(paintInfo);
- floatPaintInfo.phase = PaintPhaseForeground;
-
- for (const auto& floatingObject : m_layoutBlockFlow.floatingObjects()->set()) {
- if (!floatingObject->shouldPaint())
- continue;
-
- const LayoutBox* floatingLayoutObject = floatingObject->layoutObject();
- if (floatingLayoutObject->hasSelfPaintingLayer())
- continue;
-
- // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner.
- LayoutPoint childPoint = m_layoutBlockFlow.flipFloatForWritingModeForChild(
- *floatingObject, LayoutPoint(paintOffset.x()
- + m_layoutBlockFlow.xPositionForFloatIncludingMargin(*floatingObject) - floatingLayoutObject->location().x(), paintOffset.y()
- + m_layoutBlockFlow.yPositionForFloatIncludingMargin(*floatingObject) - floatingLayoutObject->location().y()));
- ObjectPainter(*floatingLayoutObject).paintAsPseudoStackingContext(floatPaintInfo, childPoint);
+ const FloatingObjectSet& floatingObjectSet = m_layoutBlockFlow.floatingObjects()->set();
+ FloatingObjectSetIterator end = floatingObjectSet.end();
+ for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
+ const FloatingObject& floatingObject = *it->get();
+ // Only paint the object if our m_shouldPaint flag is set.
+ if (floatingObject.shouldPaint() && !floatingObject.layoutObject()->hasSelfPaintingLayer()) {
+ PaintInfo currentPaintInfo(paintInfo);
+ currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
+ // FIXME: LayoutPoint version of xPositionForFloatIncludingMargin would make this much cleaner.
+ LayoutPoint childPoint = m_layoutBlockFlow.flipFloatForWritingModeForChild(
+ floatingObject, LayoutPoint(paintOffset.x()
+ + m_layoutBlockFlow.xPositionForFloatIncludingMargin(floatingObject) - floatingObject.layoutObject()->location().x(), paintOffset.y()
+ + m_layoutBlockFlow.yPositionForFloatIncludingMargin(floatingObject) - floatingObject.layoutObject()->location().y()));
+ floatingObject.layoutObject()->paint(currentPaintInfo, childPoint);
+ if (!preservePhase) {
+ currentPaintInfo.phase = PaintPhaseChildBlockBackgrounds;
+ floatingObject.layoutObject()->paint(currentPaintInfo, childPoint);
+ currentPaintInfo.phase = PaintPhaseFloat;
+ floatingObject.layoutObject()->paint(currentPaintInfo, childPoint);
+ currentPaintInfo.phase = PaintPhaseForeground;
+ floatingObject.layoutObject()->paint(currentPaintInfo, childPoint);
+ currentPaintInfo.phase = PaintPhaseOutline;
+ floatingObject.layoutObject()->paint(currentPaintInfo, childPoint);
+ }
+ }
}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/BlockFlowPainter.h ('k') | third_party/WebKit/Source/core/paint/BlockPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698