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

Side by Side Diff: Source/core/rendering/svg/RenderSVGModelObject.cpp

Issue 260963012: Override repaintTreeAfterLayout for RenderSVGModelObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update TestExpectations. Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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
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/RenderView.h"
36 #include "core/rendering/svg/RenderSVGRoot.h" 37 #include "core/rendering/svg/RenderSVGRoot.h"
37 #include "core/rendering/svg/SVGResourcesCache.h" 38 #include "core/rendering/svg/SVGResourcesCache.h"
38 #include "core/svg/SVGGraphicsElement.h" 39 #include "core/svg/SVGGraphicsElement.h"
39 40
40 namespace WebCore { 41 namespace WebCore {
41 42
42 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node) 43 RenderSVGModelObject::RenderSVGModelObject(SVGElement* node)
43 : RenderObject(node) 44 : RenderObject(node)
44 { 45 {
45 } 46 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return false; 117 return false;
117 } 118 }
118 119
119 // The SVG addFocusRingRects() method adds rects in local coordinates so the def ault absoluteFocusRingQuads 120 // 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. 121 // returns incorrect values for SVG objects. Overriding this method provides acc ess to the absolute bounds.
121 void RenderSVGModelObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads) 122 void RenderSVGModelObject::absoluteFocusRingQuads(Vector<FloatQuad>& quads)
122 { 123 {
123 quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())) ); 124 quads.append(localToAbsoluteQuad(FloatQuad(repaintRectInLocalCoordinates())) );
124 } 125 }
125 126
127 void RenderSVGModelObject::repaintTreeAfterLayout()
128 {
129 // Note: This is a reduced version of RenderBox::repaintTreeAfterLayout().
Julien - ping for review 2014/05/05 16:34:37 This should probably be a FIXME about sharing code
fs 2014/05/05 17:33:06 Added FIXME as well.
130 LayoutStateDisabler layoutStateDisabler(*this);
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();
146 return;
147 }
148
149 if (onlyNeededPositionedMovementLayout() && compositingState() != PaintsInto OwnBacking)
150 setShouldDoFullRepaintAfterLayout(true);
Julien - ping for review 2014/05/05 16:34:37 Can we set positioned movement only flag on SVG re
fs 2014/05/05 17:33:06 Not AFAIK. Dropping these two lines. (Had kept the
151
152 const LayoutRect& newRepaintRect = previousRepaintRect();
153 const LayoutPoint& newPositionFromRepaintContainer = previousPositionFromRep aintContainer();
154 bool didFullRepaint = repaintAfterLayoutIfNeeded(containerForRepaint(),
155 shouldDoFullRepaintAfterLayout(), oldRepaintRect, oldPositionFromRepaint Container, &newRepaintRect, &newPositionFromRepaintContainer);
156
157 if (!didFullRepaint)
158 repaintOverflowIfNeeded();
Julien - ping for review 2014/05/05 16:34:37 Wouldn't this be a no-op for SVG?
fs 2014/05/05 17:33:06 Yes (same as above.) Dropping these two lines too.
159
160 repaintScrollbarsIfNeeded();
161
162 RenderObject::repaintTreeAfterLayout();
163 }
164
126 } // namespace WebCore 165 } // namespace WebCore
OLDNEW
« Source/core/rendering/RenderObject.cpp ('K') | « Source/core/rendering/svg/RenderSVGModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698