| 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/BlockPainter.h" | 6 #include "core/paint/BlockPainter.h" |
| 7 | 7 |
| 8 #include "core/editing/DragCaretController.h" | 8 #include "core/editing/DragCaretController.h" |
| 9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 layoutObject.paint(info, childPoint); | 136 layoutObject.paint(info, childPoint); |
| 137 info.phase = PaintPhaseForeground; | 137 info.phase = PaintPhaseForeground; |
| 138 layoutObject.paint(info, childPoint); | 138 layoutObject.paint(info, childPoint); |
| 139 info.phase = PaintPhaseOutline; | 139 info.phase = PaintPhaseOutline; |
| 140 layoutObject.paint(info, childPoint); | 140 layoutObject.paint(info, childPoint); |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) | 144 void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) |
| 145 { | 145 { |
| 146 if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && m_layoutB
lock.childrenInline() && !paintInfo.context->displayItemList()->skippingCache())
{ | 146 if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && m_layoutB
lock.childrenInline() && !paintInfo.context->paintController()->skippingCache())
{ |
| 147 if (m_layoutBlock.paintOffsetChanged(paintOffset)) { | 147 if (m_layoutBlock.paintOffsetChanged(paintOffset)) { |
| 148 LineBoxListPainter(m_layoutBlock.lineBoxes()).invalidateLineBoxPaint
Offsets(paintInfo); | 148 LineBoxListPainter(m_layoutBlock.lineBoxes()).invalidateLineBoxPaint
Offsets(paintInfo); |
| 149 paintInfo.context->displayItemList()->invalidatePaintOffset(m_layout
Block); | 149 paintInfo.context->paintController()->invalidatePaintOffset(m_layout
Block); |
| 150 } | 150 } |
| 151 // Set previousPaintOffset here in case that m_layoutBlock paints nothin
g and no | 151 // Set previousPaintOffset here in case that m_layoutBlock paints nothin
g and no |
| 152 // LayoutObjectDrawingRecorder updates its previousPaintOffset. | 152 // LayoutObjectDrawingRecorder updates its previousPaintOffset. |
| 153 // TODO(wangxianzhu): Integrate paint offset checking into new paint inv
alidation. | 153 // TODO(wangxianzhu): Integrate paint offset checking into new paint inv
alidation. |
| 154 m_layoutBlock.mutableForPainting().setPreviousPaintOffset(paintOffset); | 154 m_layoutBlock.mutableForPainting().setPreviousPaintOffset(paintOffset); |
| 155 } | 155 } |
| 156 | 156 |
| 157 const PaintPhase paintPhase = paintInfo.phase; | 157 const PaintPhase paintPhase = paintInfo.phase; |
| 158 | 158 |
| 159 if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChil
dBlockBackground) | 159 if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChil
dBlockBackground) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 // We don't paint our own background, but we do let the kids paint their
backgrounds. | 260 // We don't paint our own background, but we do let the kids paint their
backgrounds. |
| 261 PaintInfo paintInfoForChild(paintInfo); | 261 PaintInfo paintInfoForChild(paintInfo); |
| 262 paintInfoForChild.phase = newPhase; | 262 paintInfoForChild.phase = newPhase; |
| 263 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); | 263 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); |
| 264 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); | 264 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace blink | 268 } // namespace blink |
| OLD | NEW |