| OLD | NEW |
| 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/Layer.h" |
| 8 #include "core/rendering/FloatingObjects.h" | 9 #include "core/rendering/FloatingObjects.h" |
| 9 #include "core/rendering/PaintInfo.h" | 10 #include "core/rendering/PaintInfo.h" |
| 10 #include "core/rendering/RenderBlockFlow.h" | 11 #include "core/rendering/RenderBlockFlow.h" |
| 11 #include "core/rendering/RenderLayer.h" | |
| 12 #include "platform/graphics/paint/ClipRecorderStack.h" | 12 #include "platform/graphics/paint/ClipRecorderStack.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 void BlockFlowPainter::paintFloats(const PaintInfo& paintInfo, const LayoutPoint
& paintOffset, bool preservePhase) | 16 void BlockFlowPainter::paintFloats(const PaintInfo& paintInfo, const LayoutPoint
& paintOffset, bool preservePhase) |
| 17 { | 17 { |
| 18 if (!m_renderBlockFlow.floatingObjects()) | 18 if (!m_renderBlockFlow.floatingObjects()) |
| 19 return; | 19 return; |
| 20 | 20 |
| 21 const FloatingObjectSet& floatingObjectSet = m_renderBlockFlow.floatingObjec
ts()->set(); | 21 const FloatingObjectSet& floatingObjectSet = m_renderBlockFlow.floatingObjec
ts()->set(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 49 void BlockFlowPainter::paintSelection(const PaintInfo& paintInfo, const LayoutPo
int& paintOffset) | 49 void BlockFlowPainter::paintSelection(const PaintInfo& paintInfo, const LayoutPo
int& paintOffset) |
| 50 { | 50 { |
| 51 if (m_renderBlockFlow.shouldPaintSelectionGaps() && paintInfo.phase == Paint
PhaseForeground) { | 51 if (m_renderBlockFlow.shouldPaintSelectionGaps() && paintInfo.phase == Paint
PhaseForeground) { |
| 52 LayoutUnit lastTop = 0; | 52 LayoutUnit lastTop = 0; |
| 53 LayoutUnit lastLeft = m_renderBlockFlow.logicalLeftSelectionOffset(&m_re
nderBlockFlow, lastTop); | 53 LayoutUnit lastLeft = m_renderBlockFlow.logicalLeftSelectionOffset(&m_re
nderBlockFlow, lastTop); |
| 54 LayoutUnit lastRight = m_renderBlockFlow.logicalRightSelectionOffset(&m_
renderBlockFlow, lastTop); | 54 LayoutUnit lastRight = m_renderBlockFlow.logicalRightSelectionOffset(&m_
renderBlockFlow, lastTop); |
| 55 ClipRecorderStack clipRecorderStack(paintInfo.context); | 55 ClipRecorderStack clipRecorderStack(paintInfo.context); |
| 56 | 56 |
| 57 LayoutRect gapRectsBounds = m_renderBlockFlow.selectionGaps(&m_renderBlo
ckFlow, paintOffset, LayoutSize(), lastTop, lastLeft, lastRight, &paintInfo); | 57 LayoutRect gapRectsBounds = m_renderBlockFlow.selectionGaps(&m_renderBlo
ckFlow, paintOffset, LayoutSize(), lastTop, lastLeft, lastRight, &paintInfo); |
| 58 if (!gapRectsBounds.isEmpty()) { | 58 if (!gapRectsBounds.isEmpty()) { |
| 59 RenderLayer* layer = m_renderBlockFlow.enclosingLayer(); | 59 Layer* layer = m_renderBlockFlow.enclosingLayer(); |
| 60 gapRectsBounds.moveBy(-paintOffset); | 60 gapRectsBounds.moveBy(-paintOffset); |
| 61 if (!m_renderBlockFlow.hasLayer()) { | 61 if (!m_renderBlockFlow.hasLayer()) { |
| 62 LayoutRect localBounds(gapRectsBounds); | 62 LayoutRect localBounds(gapRectsBounds); |
| 63 m_renderBlockFlow.flipForWritingMode(localBounds); | 63 m_renderBlockFlow.flipForWritingMode(localBounds); |
| 64 gapRectsBounds = m_renderBlockFlow.localToContainerQuad(FloatRec
t(localBounds), layer->renderer()).enclosingBoundingBox(); | 64 gapRectsBounds = m_renderBlockFlow.localToContainerQuad(FloatRec
t(localBounds), layer->renderer()).enclosingBoundingBox(); |
| 65 if (layer->renderer()->hasOverflowClip()) | 65 if (layer->renderer()->hasOverflowClip()) |
| 66 gapRectsBounds.move(layer->renderBox()->scrolledContentOffse
t()); | 66 gapRectsBounds.move(layer->renderBox()->scrolledContentOffse
t()); |
| 67 } | 67 } |
| 68 layer->addBlockSelectionGapsBounds(gapRectsBounds); | 68 layer->addBlockSelectionGapsBounds(gapRectsBounds); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace blink | 73 } // namespace blink |
| OLD | NEW |