Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/paint/PaintInvalidator.h" | 5 #include "core/paint/PaintInvalidator.h" |
| 6 | 6 |
| 7 #include "core/editing/FrameSelection.h" | 7 #include "core/editing/FrameSelection.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 } else if (object.isColumnSpanAll() || | 207 } else if (object.isColumnSpanAll() || |
| 208 object.isFloatingWithNonContainingBlockParent()) { | 208 object.isFloatingWithNonContainingBlockParent()) { |
| 209 // See LayoutObject::paintingLayer() for the special-cases of floating under | 209 // See LayoutObject::paintingLayer() for the special-cases of floating under |
| 210 // inline and multicolumn. | 210 // inline and multicolumn. |
| 211 context.paintingLayer = object.paintingLayer(); | 211 context.paintingLayer = object.paintingLayer(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 if (object.isLayoutBlockFlow() && toLayoutBlockFlow(object).containsFloats()) | 214 if (object.isLayoutBlockFlow() && toLayoutBlockFlow(object).containsFloats()) |
| 215 context.paintingLayer->setNeedsPaintPhaseFloat(); | 215 context.paintingLayer->setNeedsPaintPhaseFloat(); |
| 216 | 216 |
| 217 if (&object == &context.paintingLayer->layoutObject()) | 217 // Table collapsed borders are painted in PaintPhaseDescendantBlockBackgrounds |
| 218 // on the table's layer. | |
| 219 if (object.isTable()) { | |
| 220 const LayoutTable& table = toLayoutTable(object); | |
| 221 if (table.collapseBorders() && !table.collapsedBorders().isEmpty()) | |
| 222 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); | |
|
wkorman
2017/02/27 19:46:23
LayoutTable::invalidatePaintIfNeeded already does
Xianzhu
2017/02/27 20:22:49
LayoutTable::invalidatePaintIfNeeded(PaintInvalida
| |
| 223 } | |
| 224 | |
| 225 // The following flags are for descendants of the layer object only. | |
| 226 if (object == context.paintingLayer->layoutObject()) | |
|
wkorman
2017/02/27 19:46:23
Why change from pointer to operator==? Are there p
Xianzhu
2017/02/27 20:22:49
They are the same in binary code, but omitting '&'
| |
| 218 return; | 227 return; |
| 219 | 228 |
| 220 if (object.styleRef().hasOutline()) | 229 if (object.styleRef().hasOutline()) |
| 221 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines(); | 230 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines(); |
| 222 | 231 |
| 223 if (object.hasBoxDecorationBackground() | 232 if (object.hasBoxDecorationBackground() |
| 224 // We also paint overflow controls in background phase. | 233 // We also paint overflow controls in background phase. |
| 225 || (object.hasOverflowClip() && | 234 || (object.hasOverflowClip() && |
| 226 toLayoutBox(object).getScrollableArea()->hasOverflowControls())) { | 235 toLayoutBox(object).getScrollableArea()->hasOverflowControls())) { |
| 227 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); | 236 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); |
| 228 } | 237 } |
| 229 | |
| 230 if (object.isTable()) { | |
| 231 const LayoutTable& table = toLayoutTable(object); | |
| 232 if (table.collapseBorders() && !table.collapsedBorders().isEmpty()) | |
| 233 context.paintingLayer->setNeedsPaintPhaseDescendantBlockBackgrounds(); | |
| 234 } | |
| 235 } | 238 } |
| 236 | 239 |
| 237 namespace { | 240 namespace { |
| 238 | 241 |
| 239 // This is temporary to workaround paint invalidation issues in | 242 // This is temporary to workaround paint invalidation issues in |
| 240 // non-rootLayerScrolls mode. | 243 // non-rootLayerScrolls mode. |
| 241 // It undoes FrameView's content clip and scroll for paint invalidation of frame | 244 // It undoes FrameView's content clip and scroll for paint invalidation of frame |
| 242 // scroll controls and the LayoutView to which the content clip and scroll don't | 245 // scroll controls and the LayoutView to which the content clip and scroll don't |
| 243 // apply. | 246 // apply. |
| 244 class ScopedUndoFrameViewContentClipAndScroll { | 247 class ScopedUndoFrameViewContentClipAndScroll { |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; | 467 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; |
| 465 } | 468 } |
| 466 | 469 |
| 467 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 470 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
| 468 for (auto target : m_pendingDelayedPaintInvalidations) | 471 for (auto target : m_pendingDelayedPaintInvalidations) |
| 469 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 472 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
| 470 PaintInvalidationDelayedFull); | 473 PaintInvalidationDelayedFull); |
| 471 } | 474 } |
| 472 | 475 |
| 473 } // namespace blink | 476 } // namespace blink |
| OLD | NEW |