OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/paint/PaintInvalidator.h" |
| 6 |
| 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutObject.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 void PaintInvalidator::invalidatePaintIfNeeded(FrameView& frameView, const Paint
PropertyTreeBuilderContext& treeContext, Optional<PaintInvalidatorContext>& pain
tInvalidatorContext) |
| 13 { |
| 14 paintInvalidatorContext.emplace(*frameView.layoutView(), m_pendingDelayedPai
ntInvalidations); |
| 15 frameView.invalidatePaintIfNeeded(*paintInvalidatorContext); |
| 16 } |
| 17 |
| 18 void PaintInvalidator::invalidatePaintIfNeeded(const LayoutObject& layoutObject,
const PaintPropertyTreeBuilderContext& treeContext, const PaintInvalidatorConte
xt& parentPaintInvalidatorContext, Optional<PaintInvalidatorContext>& paintInval
idatorContext) |
| 19 { |
| 20 if (!layoutObject.shouldCheckForPaintInvalidation(parentPaintInvalidatorCont
ext)) |
| 21 return; |
| 22 |
| 23 paintInvalidatorContext.emplace(parentPaintInvalidatorContext, layoutObject)
; |
| 24 |
| 25 if (layoutObject.mayNeedPaintInvalidationSubtree()) |
| 26 paintInvalidatorContext->setForceSubtreeInvalidationCheckingWithinContai
ner(); |
| 27 |
| 28 PaintInvalidationReason reason = layoutObject.getMutableForPainting().invali
datePaintIfNeeded(*paintInvalidatorContext); |
| 29 layoutObject.getMutableForPainting().clearPaintInvalidationFlags(*paintInval
idatorContext); |
| 30 |
| 31 paintInvalidatorContext->updateForChildren(reason); |
| 32 } |
| 33 |
| 34 void PaintInvalidator::processPendingDelayedPaintInvalidations() |
| 35 { |
| 36 for (auto target : m_pendingDelayedPaintInvalidations) |
| 37 target->getMutableForPainting().setShouldDoDelayedFullPaintInvalidation(
); |
| 38 } |
| 39 |
| 40 } // namespace blink |
OLD | NEW |