OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2009, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... | |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "core/rendering/svg/RenderSVGModelObject.h" | 33 #include "core/rendering/svg/RenderSVGModelObject.h" |
34 | 34 |
35 #include "SVGNames.h" | 35 #include "SVGNames.h" |
36 #include "core/rendering/RenderLayer.h" | |
37 #include "core/rendering/RenderView.h" | |
36 #include "core/rendering/svg/RenderSVGRoot.h" | 38 #include "core/rendering/svg/RenderSVGRoot.h" |
37 #include "core/rendering/svg/SVGResourcesCache.h" | 39 #include "core/rendering/svg/SVGResourcesCache.h" |
38 #include "core/svg/SVGGraphicsElement.h" | 40 #include "core/svg/SVGGraphicsElement.h" |
39 | 41 |
40 namespace WebCore { | 42 namespace WebCore { |
41 | 43 |
42 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node) | 44 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node) |
43 : RenderObject(node) | 45 : RenderObject(node) |
44 { | 46 { |
45 } | 47 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 return false; | 118 return false; |
117 } | 119 } |
118 | 120 |
119 // The SVG addFocusRingRects() method adds rects in local coordinates so the def ault absoluteFocusRingQuads | 121 // The SVG addFocusRingRects() method adds rects in local coordinates so the def ault absoluteFocusRingQuads |
120 // returns incorrect values for SVG objects. Overriding this method provides acc ess to the absolute bounds. | 122 // returns incorrect values for SVG objects. Overriding this method provides acc ess to the absolute bounds. |
121 void RenderSVGModelObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads) | 123 void RenderSVGModelObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads) |
122 { | 124 { |
123 quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())) ); | 125 quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())) ); |
124 } | 126 } |
125 | 127 |
128 void RenderSVGModelObject::repaintTreeAfterLayout() | |
129 { | |
130 // Note: This is a reduced version of RenderBox::repaintTreeAfterLayout(). | |
131 | |
132 ASSERT(RuntimeEnabledFeatures::repaintAfterLayoutEnabled()); | |
133 ASSERT(!needsLayout()); | |
134 | |
135 const LayoutRect oldRepaintRect = previousRepaintRect(); | |
136 const LayoutPoint oldPositionFromRepaintContainer = previousPositionFromRepa intContainer(); | |
137 RenderLayerModelObject* repaintContainer = containerForRepaint(); | |
138 setPreviousRepaintRect(clippedOverflowRectForRepaint(repaintContainer)); | |
139 setPreviousPositionFromRepaintContainer(positionFromRepaintContainer(repaint Container)); | |
140 | |
141 // If we are set to do a full repaint that means the RenderView will be | |
142 // invalidated. We can then skip issuing of invalidations for the child | |
143 // renderers as they'll be covered by the RenderView. | |
144 if (view()->doingFullRepaint()) { | |
145 RenderObject::repaintTreeAfterLayout(); | |
dsinclair
2014/05/02 15:19:19
Does this need a LayoutStateDisabler?
fs
2014/05/02 15:36:09
Maybe... Can't be used in it's current form though
dsinclair
2014/05/02 15:40:26
I don't think it has to take a RenderBox. It just
fs
2014/05/02 15:53:52
Yeah, I wasn't sure if that would be frowned upon
| |
146 return; | |
147 } | |
148 | |
149 if (onlyNeededPositionedMovementLayout() && compositingState() != PaintsInto OwnBacking) { | |
150 setShouldDoFullRepaintAfterLayout(true); | |
151 } | |
152 | |
153 const LayoutRect& newRepaintRect = previousRepaintRect(); | |
154 const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRep aintContainer(); | |
155 bool didFullRepaint = repaintAfterLayoutIfNeeded(containerForRepaint(), | |
156 shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaint Container, &newRepaintRect, &newPositionFromRepaintContainer); | |
157 | |
158 if (!didFullRepaint) | |
159 repaintOverflowIfNeeded(); | |
160 | |
161 // Repaint any scrollbars if there is a scrollable area for this renderer. | |
162 if (enclosingLayer()) { | |
163 if (RenderLayerScrollableArea* area = enclosingLayer()->scrollableArea() ) { | |
164 if (area->hasVerticalBarDamage()) | |
165 repaintRectangle(area->verticalBarDamage()); | |
166 if (area->hasHorizontalBarDamage()) | |
167 repaintRectangle(area->horizontalBarDamage()); | |
168 area->resetScrollbarDamage(); | |
169 } | |
170 } | |
171 | |
172 RenderObject::repaintTreeAfterLayout(); | |
dsinclair
2014/05/02 15:19:19
Ditto, layout state disabler?
| |
173 } | |
174 | |
126 } // namespace WebCore | 175 } // namespace WebCore |
OLD | NEW |