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

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

Issue 2768453003: Put SVGResourceContainer subtypes into their own property trees. (Closed)
Patch Set: none 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"
11 #include "core/frame/Settings.h" 11 #include "core/frame/Settings.h"
12 #include "core/layout/LayoutInline.h" 12 #include "core/layout/LayoutInline.h"
13 #include "core/layout/LayoutView.h" 13 #include "core/layout/LayoutView.h"
14 #include "core/layout/compositing/CompositingReasonFinder.h" 14 #include "core/layout/compositing/CompositingReasonFinder.h"
15 #include "core/layout/svg/LayoutSVGResourceMasker.h" 15 #include "core/layout/svg/LayoutSVGResourceMasker.h"
16 #include "core/layout/svg/LayoutSVGRoot.h" 16 #include "core/layout/svg/LayoutSVGRoot.h"
17 #include "core/layout/svg/SVGLayoutSupport.h" 17 #include "core/layout/svg/SVGLayoutSupport.h"
18 #include "core/layout/svg/SVGResources.h" 18 #include "core/layout/svg/SVGResources.h"
19 #include "core/layout/svg/SVGResourcesCache.h" 19 #include "core/layout/svg/SVGResourcesCache.h"
20 #include "core/paint/FindPropertiesNeedingUpdate.h" 20 #include "core/paint/FindPropertiesNeedingUpdate.h"
21 #include "core/paint/ObjectPaintProperties.h" 21 #include "core/paint/ObjectPaintProperties.h"
22 #include "core/paint/PaintLayer.h" 22 #include "core/paint/PaintLayer.h"
23 #include "core/paint/SVGRootPainter.h" 23 #include "core/paint/SVGRootPainter.h"
24 #include "platform/transforms/TransformationMatrix.h" 24 #include "platform/transforms/TransformationMatrix.h"
25 #include "wtf/PtrUtil.h" 25 #include "wtf/PtrUtil.h"
26 26
27 namespace blink { 27 namespace blink {
28 28
29 void PaintPropertyTreeBuilder::setupInitialContext( 29 PaintPropertyTreeBuilderContext::PaintPropertyTreeBuilderContext()
30 PaintPropertyTreeBuilderContext& context) { 30 : containerForAbsolutePosition(nullptr),
31 context.current.clip = context.absolutePosition.clip = 31 currentEffect(EffectPaintPropertyNode::root()),
32 context.fixedPosition.clip = ClipPaintPropertyNode::root(); 32 inputClipOfCurrentEffect(ClipPaintPropertyNode::root()),
33 context.currentEffect = EffectPaintPropertyNode::root(); 33 forceSubtreeUpdate(false) {
34 context.inputClipOfCurrentEffect = ClipPaintPropertyNode::root(); 34 current.clip = absolutePosition.clip = fixedPosition.clip =
35 context.current.transform = context.absolutePosition.transform = 35 ClipPaintPropertyNode::root();
36 context.fixedPosition.transform = TransformPaintPropertyNode::root(); 36 current.transform = absolutePosition.transform = fixedPosition.transform =
37 context.current.scroll = context.absolutePosition.scroll = 37 TransformPaintPropertyNode::root();
38 context.fixedPosition.scroll = ScrollPaintPropertyNode::root(); 38 current.scroll = absolutePosition.scroll = fixedPosition.scroll =
39 ScrollPaintPropertyNode::root();
39 } 40 }
40 41
41 // True if a new property was created, false if an existing one was updated. 42 // True if a new property was created, false if an existing one was updated.
42 static bool updatePreTranslation( 43 static bool updatePreTranslation(
43 FrameView& frameView, 44 FrameView& frameView,
44 PassRefPtr<const TransformPaintPropertyNode> parent, 45 PassRefPtr<const TransformPaintPropertyNode> parent,
45 const TransformationMatrix& matrix, 46 const TransformationMatrix& matrix,
46 const FloatPoint3D& origin) { 47 const FloatPoint3D& origin) {
47 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled()); 48 DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled());
48 if (auto* existingPreTranslation = frameView.preTranslation()) { 49 if (auto* existingPreTranslation = frameView.preTranslation()) {
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 // frame rect, so force a property update if it changes. TODO(pdr): We 1088 // frame rect, so force a property update if it changes. TODO(pdr): We
1088 // only need to update properties if there are relative lengths. 1089 // only need to update properties if there are relative lengths.
1089 box.styleRef().hasTransform() || box.styleRef().hasPerspective() || 1090 box.styleRef().hasTransform() || box.styleRef().hasPerspective() ||
1090 boxGeneratesPropertyNodesForMaskAndClipPath) 1091 boxGeneratesPropertyNodesForMaskAndClipPath)
1091 box.getMutableForPainting().setNeedsPaintPropertyUpdate(); 1092 box.getMutableForPainting().setNeedsPaintPropertyUpdate();
1092 } 1093 }
1093 1094
1094 void PaintPropertyTreeBuilder::updatePropertiesForSelf( 1095 void PaintPropertyTreeBuilder::updatePropertiesForSelf(
1095 const LayoutObject& object, 1096 const LayoutObject& object,
1096 PaintPropertyTreeBuilderContext& context) { 1097 PaintPropertyTreeBuilderContext& context) {
1098 if (object.isSVGHiddenContainer()) {
1099 // SVG resources are painted within one or more other locations in the
1100 // SVG during paint, and hence have their own independent paint property
1101 // trees, paint offset, etc.
1102 context = PaintPropertyTreeBuilderContext();
1103 }
1104
1097 // This is not in FindObjectPropertiesNeedingUpdateScope because paint offset 1105 // This is not in FindObjectPropertiesNeedingUpdateScope because paint offset
1098 // can change without needsPaintPropertyUpdate. 1106 // can change without needsPaintPropertyUpdate.
1099 updateForObjectLocationAndSize(object, context); 1107 updateForObjectLocationAndSize(object, context);
1100 1108
1101 #if DCHECK_IS_ON() 1109 #if DCHECK_IS_ON()
1102 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context); 1110 FindObjectPropertiesNeedingUpdateScope checkNeedsUpdateScope(object, context);
1103 #endif 1111 #endif
1104 1112
1105 if (object.isBoxModelObject() || object.isSVG()) { 1113 if (object.isBoxModelObject() || object.isSVG()) {
1106 updateTransform(object, context); 1114 updateTransform(object, context);
(...skipping 21 matching lines...) Expand all
1128 updateOverflowClip(object, context); 1136 updateOverflowClip(object, context);
1129 updatePerspective(object, context); 1137 updatePerspective(object, context);
1130 updateSvgLocalToBorderBoxTransform(object, context); 1138 updateSvgLocalToBorderBoxTransform(object, context);
1131 updateScrollAndScrollTranslation(object, context); 1139 updateScrollAndScrollTranslation(object, context);
1132 updateOutOfFlowContext(object, context); 1140 updateOutOfFlowContext(object, context);
1133 1141
1134 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); 1142 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate();
1135 } 1143 }
1136 1144
1137 } // namespace blink 1145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698