| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (context.paintInvalidationContainer->layer()->groupedMapping()) | 193 if (context.paintInvalidationContainer->layer()->groupedMapping()) |
| 194 PaintLayer::mapPointInPaintInvalidationContainerToBacking( | 194 PaintLayer::mapPointInPaintInvalidationContainerToBacking( |
| 195 *context.paintInvalidationContainer, point); | 195 *context.paintInvalidationContainer, point); |
| 196 | 196 |
| 197 return LayoutPoint(point); | 197 return LayoutPoint(point); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void PaintInvalidator::updatePaintingLayer(const LayoutObject& object, | 200 void PaintInvalidator::updatePaintingLayer(const LayoutObject& object, |
| 201 PaintInvalidatorContext& context) { | 201 PaintInvalidatorContext& context) { |
| 202 if (object.hasLayer() && | 202 if (object.hasLayer() && |
| 203 toLayoutBoxModelObject(object).hasSelfPaintingLayer()) | 203 toLayoutBoxModelObject(object).hasSelfPaintingLayer()) { |
| 204 context.paintingLayer = toLayoutBoxModelObject(object).layer(); | 204 context.paintingLayer = toLayoutBoxModelObject(object).layer(); |
| 205 } else if (object.isFloating() && !object.parent()->isLayoutBlock()) { |
| 206 // See LayoutObject::paintingLayer() for specialty of floating objects. |
| 207 context.paintingLayer = object.paintingLayer(); |
| 208 } |
| 205 | 209 |
| 206 if (object.isLayoutBlockFlow() && toLayoutBlockFlow(object).containsFloats()) | 210 if (object.isLayoutBlockFlow() && toLayoutBlockFlow(object).containsFloats()) |
| 207 context.paintingLayer->setNeedsPaintPhaseFloat(); | 211 context.paintingLayer->setNeedsPaintPhaseFloat(); |
| 208 | 212 |
| 209 if (object == context.paintingLayer->layoutObject()) | 213 if (object == context.paintingLayer->layoutObject()) |
| 210 return; | 214 return; |
| 211 | 215 |
| 212 if (object.styleRef().hasOutline()) | 216 if (object.styleRef().hasOutline()) |
| 213 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines(); | 217 context.paintingLayer->setNeedsPaintPhaseDescendantOutlines(); |
| 214 | 218 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 // paintInvalidationContainerForStackedContents is only for stacked | 280 // paintInvalidationContainerForStackedContents is only for stacked |
| 277 // descendants in its own frame, because it doesn't establish stacking | 281 // descendants in its own frame, because it doesn't establish stacking |
| 278 // context for stacked contents in sub-frames. | 282 // context for stacked contents in sub-frames. |
| 279 // Contents stacked in the root stacking context in this frame should use | 283 // Contents stacked in the root stacking context in this frame should use |
| 280 // this frame's paintInvalidationContainer. | 284 // this frame's paintInvalidationContainer. |
| 281 context.paintInvalidationContainerForStackedContents = | 285 context.paintInvalidationContainerForStackedContents = |
| 282 context.paintInvalidationContainer; | 286 context.paintInvalidationContainer; |
| 283 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 287 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
| 284 undoFrameViewContentClipAndScroll.emplace( | 288 undoFrameViewContentClipAndScroll.emplace( |
| 285 *toLayoutView(object).frameView(), context); | 289 *toLayoutView(object).frameView(), context); |
| 290 } else if (object.isFloating() && !object.parent()->isLayoutBlock()) { |
| 291 // See LayoutObject::paintingLayer() for specialty of floating objects. |
| 292 context.paintInvalidationContainer = |
| 293 &object.containerForPaintInvalidation(); |
| 286 } else if (object.styleRef().isStacked() && | 294 } else if (object.styleRef().isStacked() && |
| 287 // This is to exclude some objects (e.g. LayoutText) inheriting | 295 // This is to exclude some objects (e.g. LayoutText) inheriting |
| 288 // stacked style from parent but aren't actually stacked. | 296 // stacked style from parent but aren't actually stacked. |
| 289 object.hasLayer() && | 297 object.hasLayer() && |
| 290 context.paintInvalidationContainer != | 298 context.paintInvalidationContainer != |
| 291 context.paintInvalidationContainerForStackedContents) { | 299 context.paintInvalidationContainerForStackedContents) { |
| 292 // The current object is stacked, so we should use | 300 // The current object is stacked, so we should use |
| 293 // m_paintInvalidationContainerForStackedContents as its paint invalidation | 301 // m_paintInvalidationContainerForStackedContents as its paint invalidation |
| 294 // container on which the current object is painted. | 302 // container on which the current object is painted. |
| 295 context.paintInvalidationContainer = | 303 context.paintInvalidationContainer = |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; | 453 PaintInvalidatorContext::ForcedSubtreeInvalidationRectUpdate; |
| 446 } | 454 } |
| 447 | 455 |
| 448 void PaintInvalidator::processPendingDelayedPaintInvalidations() { | 456 void PaintInvalidator::processPendingDelayedPaintInvalidations() { |
| 449 for (auto target : m_pendingDelayedPaintInvalidations) | 457 for (auto target : m_pendingDelayedPaintInvalidations) |
| 450 target->getMutableForPainting().setShouldDoFullPaintInvalidation( | 458 target->getMutableForPainting().setShouldDoFullPaintInvalidation( |
| 451 PaintInvalidationDelayedFull); | 459 PaintInvalidationDelayedFull); |
| 452 } | 460 } |
| 453 | 461 |
| 454 } // namespace blink | 462 } // namespace blink |
| OLD | NEW |