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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.cpp

Issue 1813383002: Move all fast-path paint invalidation mapping into PaintInvalidationState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable fast-path/slow-path comparison because of saturated operations of LayoutUnit Created 4 years, 9 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 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (isBlendingAllowed()) { 75 if (isBlendingAllowed()) {
76 bool hasBlendModeChanged = (oldStyle && oldStyle->hasBlendMode()) == !st yle()->hasBlendMode(); 76 bool hasBlendModeChanged = (oldStyle && oldStyle->hasBlendMode()) == !st yle()->hasBlendMode();
77 if (parent() && hasBlendModeChanged) 77 if (parent() && hasBlendModeChanged)
78 parent()->descendantIsolationRequirementsChanged(style()->hasBlendMo de() ? DescendantIsolationRequired : DescendantIsolationNeedsUpdate); 78 parent()->descendantIsolationRequirementsChanged(style()->hasBlendMo de() ? DescendantIsolationRequired : DescendantIsolationNeedsUpdate);
79 } 79 }
80 80
81 LayoutBlock::styleDidChange(diff, oldStyle); 81 LayoutBlock::styleDidChange(diff, oldStyle);
82 SVGResourcesCache::clientStyleChanged(this, diff, styleRef()); 82 SVGResourcesCache::clientStyleChanged(this, diff, styleRef());
83 } 83 }
84 84
85 void LayoutSVGBlock::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tr ansformState& transformState, MapCoordinatesFlags, bool* wasFixed, const PaintIn validationState* paintInvalidationState) const 85 void LayoutSVGBlock::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, Tr ansformState& transformState, MapCoordinatesFlags, bool* wasFixed) const
86 { 86 {
87 SVGLayoutSupport::mapLocalToAncestor(this, ancestor, transformState, wasFixe d, paintInvalidationState); 87 SVGLayoutSupport::mapLocalToAncestor(this, ancestor, transformState, wasFixe d);
88 } 88 }
89 89
90 void LayoutSVGBlock::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tr ansformState& transformState, MapCoordinatesFlags) const 90 void LayoutSVGBlock::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Tr ansformState& transformState, MapCoordinatesFlags) const
91 { 91 {
92 if (this == ancestor) 92 if (this == ancestor)
93 return; 93 return;
94 SVGLayoutSupport::mapAncestorToLocal(*this, ancestor, transformState); 94 SVGLayoutSupport::mapAncestorToLocal(*this, ancestor, transformState);
95 } 95 }
96 96
97 const LayoutObject* LayoutSVGBlock::pushMappingToContainer(const LayoutBoxModelO bject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const 97 const LayoutObject* LayoutSVGBlock::pushMappingToContainer(const LayoutBoxModelO bject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const
98 { 98 {
99 return SVGLayoutSupport::pushMappingToContainer(this, ancestorToStopAt, geom etryMap); 99 return SVGLayoutSupport::pushMappingToContainer(this, ancestorToStopAt, geom etryMap);
100 } 100 }
101 101
102 LayoutRect LayoutSVGBlock::clippedOverflowRectForPaintInvalidation(const LayoutB oxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn validationState) const 102 LayoutRect LayoutSVGBlock::absoluteClippedOverflowRect() const
103 { 103 {
104 return SVGLayoutSupport::clippedOverflowRectForPaintInvalidation(*this, pain tInvalidationContainer, paintInvalidationState); 104 return SVGLayoutSupport::clippedOverflowRectForPaintInvalidation(*this, *vie w());
105 } 105 }
106 106
107 bool LayoutSVGBlock::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationStat e, VisibleRectFlags visibleRectFlags) const 107 bool LayoutSVGBlock::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisibleRectFlags visibleRectFlags) const
108 { 108 {
109 FloatRect paintInvalidationRect(rect); 109 return SVGLayoutSupport::mapToVisibleRectInAncestorSpace(*this, ancestor, Fl oatRect(rect), rect);
110 const LayoutSVGRoot& svgRoot = SVGLayoutSupport::mapRectToSVGRootForPaintInv alidation(*this, paintInvalidationRect, rect);
111 return svgRoot.mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalida tionState, visibleRectFlags);
112 } 110 }
113 111
114 bool LayoutSVGBlock::nodeAtPoint(HitTestResult&, const HitTestLocation&, const L ayoutPoint&, HitTestAction) 112 bool LayoutSVGBlock::nodeAtPoint(HitTestResult&, const HitTestLocation&, const L ayoutPoint&, HitTestAction)
115 { 113 {
116 ASSERT_NOT_REACHED(); 114 ASSERT_NOT_REACHED();
117 return false; 115 return false;
118 } 116 }
119 117
120 void LayoutSVGBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintI nvalidationState) 118 void LayoutSVGBlock::invalidateTreeIfNeeded(const PaintInvalidationState& paintI nvalidationState)
121 { 119 {
122 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) 120 if (!shouldCheckForPaintInvalidation(paintInvalidationState))
123 return; 121 return;
124 122
123 // TODO(wangxianzhu): Move this to fast path if possible. crbug.com/391054.
125 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState); 124 ForceHorriblySlowRectMapping slowRectMapping(&paintInvalidationState);
126 LayoutBlockFlow::invalidateTreeIfNeeded(paintInvalidationState); 125 LayoutBlockFlow::invalidateTreeIfNeeded(paintInvalidationState);
127 } 126 }
128 127
129 } // namespace blink 128 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698