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

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

Issue 295513003: add 'slow' prefix to RenderObject's firstChild() / lastChild() methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 void SVGRenderSupport::computeContainerBoundingBoxes(const RenderObject* contain er, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strok eBoundingBox, FloatRect& repaintBoundingBox) 129 void SVGRenderSupport::computeContainerBoundingBoxes(const RenderObject* contain er, FloatRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strok eBoundingBox, FloatRect& repaintBoundingBox)
130 { 130 {
131 objectBoundingBox = FloatRect(); 131 objectBoundingBox = FloatRect();
132 objectBoundingBoxValid = false; 132 objectBoundingBoxValid = false;
133 strokeBoundingBox = FloatRect(); 133 strokeBoundingBox = FloatRect();
134 134
135 // When computing the strokeBoundingBox, we use the repaintRects of the cont ainer's children so that the container's stroke includes 135 // When computing the strokeBoundingBox, we use the repaintRects of the cont ainer's children so that the container's stroke includes
136 // the resources applied to the children (such as clips and filters). This a llows filters applied to containers to correctly bound 136 // the resources applied to the children (such as clips and filters). This a llows filters applied to containers to correctly bound
137 // the children, and also improves inlining of SVG content, as the stroke bo und is used in that situation also. 137 // the children, and also improves inlining of SVG content, as the stroke bo und is used in that situation also.
138 for (RenderObject* current = container->firstChild(); current; current = cur rent->nextSibling()) { 138 for (RenderObject* current = container->slowFirstChild(); current; current = current->nextSibling()) {
139 if (current->isSVGHiddenContainer()) 139 if (current->isSVGHiddenContainer())
140 continue; 140 continue;
141 141
142 const AffineTransform& transform = current->localToParentTransform(); 142 const AffineTransform& transform = current->localToParentTransform();
143 updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, curre nt, 143 updateObjectBoundingBox(objectBoundingBox, objectBoundingBoxValid, curre nt,
144 transform.mapRect(current->objectBoundingBox())); 144 transform.mapRect(current->objectBoundingBox()));
145 strokeBoundingBox.unite(transform.mapRect(current->repaintRectInLocalCoo rdinates())); 145 strokeBoundingBox.unite(transform.mapRect(current->repaintRectInLocalCoo rdinates()));
146 } 146 }
147 147
148 repaintBoundingBox = strokeBoundingBox; 148 repaintBoundingBox = strokeBoundingBox;
(...skipping 13 matching lines...) Expand all
162 ASSERT(start->isSVGRoot()); 162 ASSERT(start->isSVGRoot());
163 return toRenderSVGRoot(start); 163 return toRenderSVGRoot(start);
164 } 164 }
165 165
166 static inline void invalidateResourcesOfChildren(RenderObject* start) 166 static inline void invalidateResourcesOfChildren(RenderObject* start)
167 { 167 {
168 ASSERT(!start->needsLayout()); 168 ASSERT(!start->needsLayout());
169 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObj ect(start)) 169 if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObj ect(start))
170 resources->removeClientFromCache(start, false); 170 resources->removeClientFromCache(start, false);
171 171
172 for (RenderObject* child = start->firstChild(); child; child = child->nextSi bling()) 172 for (RenderObject* child = start->slowFirstChild(); child; child = child->ne xtSibling())
173 invalidateResourcesOfChildren(child); 173 invalidateResourcesOfChildren(child);
174 } 174 }
175 175
176 static inline bool layoutSizeOfNearestViewportChanged(const RenderObject* start) 176 static inline bool layoutSizeOfNearestViewportChanged(const RenderObject* start)
177 { 177 {
178 while (start && !start->isSVGRoot() && !start->isSVGViewportContainer()) 178 while (start && !start->isSVGRoot() && !start->isSVGViewportContainer())
179 start = start->parent(); 179 start = start->parent();
180 180
181 ASSERT(start); 181 ASSERT(start);
182 ASSERT(start->isSVGRoot() || start->isSVGViewportContainer()); 182 ASSERT(start->isSVGRoot() || start->isSVGViewportContainer());
(...skipping 15 matching lines...) Expand all
198 198
199 return false; 199 return false;
200 } 200 }
201 201
202 void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout) 202 void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout)
203 { 203 {
204 bool layoutSizeChanged = layoutSizeOfNearestViewportChanged(start); 204 bool layoutSizeChanged = layoutSizeOfNearestViewportChanged(start);
205 bool transformChanged = transformToRootChanged(start); 205 bool transformChanged = transformToRootChanged(start);
206 HashSet<RenderObject*> notlayoutedObjects; 206 HashSet<RenderObject*> notlayoutedObjects;
207 207
208 for (RenderObject* child = start->firstChild(); child; child = child->nextSi bling()) { 208 for (RenderObject* child = start->slowFirstChild(); child; child = child->ne xtSibling()) {
209 bool needsLayout = selfNeedsLayout; 209 bool needsLayout = selfNeedsLayout;
210 bool childEverHadLayout = child->everHadLayout(); 210 bool childEverHadLayout = child->everHadLayout();
211 211
212 if (transformChanged) { 212 if (transformChanged) {
213 // If the transform changed we need to update the text metrics (note : this also happens for layoutSizeChanged=true). 213 // If the transform changed we need to update the text metrics (note : this also happens for layoutSizeChanged=true).
214 if (child->isSVGText()) 214 if (child->isSVGText())
215 toRenderSVGText(child)->setNeedsTextMetricsUpdate(); 215 toRenderSVGText(child)->setNeedsTextMetricsUpdate();
216 needsLayout = true; 216 needsLayout = true;
217 } 217 }
218 218
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 } 391 }
392 392
393 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) 393 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object)
394 { 394 {
395 ASSERT(object->isText()); 395 ASSERT(object->isText());
396 // <br> is marked as text, but is not handled by the SVG rendering code-path . 396 // <br> is marked as text, but is not handled by the SVG rendering code-path .
397 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text(); 397 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text();
398 } 398 }
399 399
400 } 400 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.cpp ('k') | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698