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

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

Issue 2694193004: Early out PrePaintTreeWalk::walk() earlier (Closed)
Patch Set: Rebase Created 3 years, 10 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 "core/dom/DOMNodeIds.h" 7 #include "core/dom/DOMNodeIds.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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 // Similar adjustment is done in LayoutTableCell::offsetFromContainer(). 912 // Similar adjustment is done in LayoutTableCell::offsetFromContainer().
913 if (object.isTableCell()) { 913 if (object.isTableCell()) {
914 LayoutObject* parentRow = object.parent(); 914 LayoutObject* parentRow = object.parent();
915 DCHECK(parentRow && parentRow->isTableRow()); 915 DCHECK(parentRow && parentRow->isTableRow());
916 context.current.paintOffset.moveBy( 916 context.current.paintOffset.moveBy(
917 -toLayoutBox(parentRow)->physicalLocation()); 917 -toLayoutBox(parentRow)->physicalLocation());
918 } 918 }
919 } 919 }
920 } 920 }
921 921
922 void PaintPropertyTreeBuilder::updateContextForBoxPosition( 922 void PaintPropertyTreeBuilder::updateForObjectLocation(
923 const LayoutObject& object, 923 const LayoutObject& object,
924 PaintPropertyTreeBuilderContext& context) { 924 PaintPropertyTreeBuilderContext& context) {
925 if (object.isBoxModelObject()) { 925 if (object.isBoxModelObject()) {
926 updatePaintOffset(toLayoutBoxModelObject(object), context); 926 updatePaintOffset(toLayoutBoxModelObject(object), context);
927 updatePaintOffsetTranslation(toLayoutBoxModelObject(object), context); 927 updatePaintOffsetTranslation(toLayoutBoxModelObject(object), context);
928 } 928 }
929 929
930 if (object.paintOffset() == context.current.paintOffset) 930 if (object.paintOffset() == context.current.paintOffset)
931 return; 931 return;
932 932
933 // Many paint properties depend on paint offset so we force an update of 933 // Many paint properties depend on paint offset so we force an update of
934 // the entire subtree on paint offset changes. 934 // the entire subtree on paint offset changes.
935 context.forceSubtreeUpdate = true; 935 context.forceSubtreeUpdate = true;
936 936
937 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 937 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
938 object.getMutableForPainting().setShouldDoFullPaintInvalidation( 938 object.getMutableForPainting().setShouldDoFullPaintInvalidation(
939 PaintInvalidationLocationChange); 939 PaintInvalidationLocationChange);
940 } 940 }
941 object.getMutableForPainting().setPaintOffset(context.current.paintOffset); 941 object.getMutableForPainting().setPaintOffset(context.current.paintOffset);
942 } 942 }
943 943
944 void PaintPropertyTreeBuilder::updatePropertiesForSelf( 944 void PaintPropertyTreeBuilder::updatePropertiesForSelf(
945 const LayoutObject& object, 945 const LayoutObject& object,
946 PaintPropertyTreeBuilderContext& context) { 946 PaintPropertyTreeBuilderContext& context) {
947 // This is not in FindObjectPropertiesNeedingUpdateScope because paint offset
948 // can change without needsPaintPropertyUpdate.
949 updateForObjectLocation(object, context);
950
947 #if DCHECK_IS_ON() 951 #if DCHECK_IS_ON()
948 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); 952 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context);
949 #endif 953 #endif
950 954
951 if (object.isBoxModelObject() || object.isSVG()) { 955 if (object.isBoxModelObject() || object.isSVG()) {
952 updateTransform(object, context); 956 updateTransform(object, context);
953 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) 957 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
954 updateEffect(object, context); 958 updateEffect(object, context);
955 updateCssClip(object, context); 959 updateCssClip(object, context);
956 updateLocalBorderBoxContext(object, context); 960 updateLocalBorderBoxContext(object, context);
(...skipping 15 matching lines...) Expand all
972 updateOverflowClip(object, context); 976 updateOverflowClip(object, context);
973 updatePerspective(object, context); 977 updatePerspective(object, context);
974 updateSvgLocalToBorderBoxTransform(object, context); 978 updateSvgLocalToBorderBoxTransform(object, context);
975 updateScrollAndScrollTranslation(object, context); 979 updateScrollAndScrollTranslation(object, context);
976 updateOutOfFlowContext(object, context); 980 updateOutOfFlowContext(object, context);
977 981
978 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); 982 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate();
979 } 983 }
980 984
981 } // namespace blink 985 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698