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

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

Issue 2782343002: Store local border box property cache outside ObjectPaintProperties (Closed)
Patch Set: Rebase Created 3 years, 8 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/PaintPropertyTreeBuilder.h" 5 #include "core/paint/PaintPropertyTreeBuilder.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "core/dom/DOMNodeIds.h" 8 #include "core/dom/DOMNodeIds.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 if (properties && properties->cssClip()) 677 if (properties && properties->cssClip())
678 context.current.clip = properties->cssClip(); 678 context.current.clip = properties->cssClip();
679 } 679 }
680 680
681 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext( 681 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(
682 const LayoutObject& object, 682 const LayoutObject& object,
683 PaintPropertyTreeBuilderContext& context) { 683 PaintPropertyTreeBuilderContext& context) {
684 if (!object.needsPaintPropertyUpdate() && !context.forceSubtreeUpdate) 684 if (!object.needsPaintPropertyUpdate() && !context.forceSubtreeUpdate)
685 return; 685 return;
686 686
687 // We need localBorderBoxProperties for layered objects only. 687 // We only need to cache the local border box properties for layered objects.
688 if (!object.hasLayer()) { 688 if (!object.hasLayer()) {
689 if (auto* properties = object.getMutableForPainting().paintProperties()) 689 object.getMutableForPainting().clearLocalBorderBoxProperties();
690 properties->clearLocalBorderBoxProperties();
691 } else { 690 } else {
692 auto& properties = object.getMutableForPainting().ensurePaintProperties(); 691 PropertyTreeState localBorderBox = PropertyTreeState(
693 properties.updateLocalBorderBoxProperties(
694 context.current.transform, context.current.clip, context.currentEffect); 692 context.current.transform, context.current.clip, context.currentEffect);
693 object.getMutableForPainting().setLocalBorderBoxProperties(localBorderBox);
695 } 694 }
696 } 695 }
697 696
698 // TODO(trchen): Remove this once we bake the paint offset into frameRect. 697 // TODO(trchen): Remove this once we bake the paint offset into frameRect.
699 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset( 698 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(
700 const LayoutObject& object, 699 const LayoutObject& object,
701 PaintPropertyTreeBuilderContext& context) { 700 PaintPropertyTreeBuilderContext& context) {
702 if (!object.needsPaintPropertyUpdate() && !context.forceSubtreeUpdate) 701 if (!object.needsPaintPropertyUpdate() && !context.forceSubtreeUpdate)
703 return; 702 return;
704 703
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 updateOverflowClip(object, context); 1131 updateOverflowClip(object, context);
1133 updatePerspective(object, context); 1132 updatePerspective(object, context);
1134 updateSvgLocalToBorderBoxTransform(object, context); 1133 updateSvgLocalToBorderBoxTransform(object, context);
1135 updateScrollAndScrollTranslation(object, context); 1134 updateScrollAndScrollTranslation(object, context);
1136 updateOutOfFlowContext(object, context); 1135 updateOutOfFlowContext(object, context);
1137 1136
1138 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); 1137 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate();
1139 } 1138 }
1140 1139
1141 } // namespace blink 1140 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698