Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintInvalidator.cpp

Issue 2033183002: [SPv2] Paint invalidation in PreWalkTreeWalk, plumbed on PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@RootFrame
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698