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

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

Issue 2465983002: Rename "paint invalidation rect" etc. to "visual rect". (Closed)
Patch Set: - Created 4 years, 1 month 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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
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 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
10 * Copyright (C) 2011 University of Szeged 10 * Copyright (C) 2011 University of Szeged
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 void LayoutSVGShape::layout() { 175 void LayoutSVGShape::layout() {
176 LayoutAnalyzer::Scope analyzer(*this); 176 LayoutAnalyzer::Scope analyzer(*this);
177 177
178 // Invalidate all resources of this client if our layout changed. 178 // Invalidate all resources of this client if our layout changed.
179 if (everHadLayout() && selfNeedsLayout()) 179 if (everHadLayout() && selfNeedsLayout())
180 SVGResourcesCache::clientLayoutChanged(this); 180 SVGResourcesCache::clientLayoutChanged(this);
181 181
182 bool updateParentBoundaries = false; 182 bool updateParentBoundaries = false;
183 // updateShapeFromElement() also updates the object & stroke bounds - which 183 // updateShapeFromElement() also updates the object & stroke bounds - which
184 // feeds into the paint invalidation rect - so we need to call it for both 184 // feeds into the visual rect - so we need to call it for both the
185 // the shape-update and the bounds-update flag, since . 185 // shape-update and the bounds-update flag.
186 if (m_needsShapeUpdate || m_needsBoundariesUpdate) { 186 if (m_needsShapeUpdate || m_needsBoundariesUpdate) {
187 updateShapeFromElement(); 187 updateShapeFromElement();
188 m_needsShapeUpdate = false; 188 m_needsShapeUpdate = false;
189 189
190 m_paintInvalidationBoundingBox = strokeBoundingBox(); 190 m_localVisualRect = strokeBoundingBox();
191 SVGLayoutSupport::intersectPaintInvalidationRectWithResources( 191 SVGLayoutSupport::adjustVisualRectWithResources(this, m_localVisualRect);
192 this, m_paintInvalidationBoundingBox);
193 m_needsBoundariesUpdate = false; 192 m_needsBoundariesUpdate = false;
194 193
195 updateParentBoundaries = true; 194 updateParentBoundaries = true;
196 } 195 }
197 196
198 if (m_needsTransformUpdate) { 197 if (m_needsTransformUpdate) {
199 updateLocalTransform(); 198 updateLocalTransform();
200 m_needsTransformUpdate = false; 199 m_needsTransformUpdate = false;
201 updateParentBoundaries = true; 200 updateParentBoundaries = true;
202 } 201 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 void LayoutSVGShape::paint(const PaintInfo& paintInfo, 237 void LayoutSVGShape::paint(const PaintInfo& paintInfo,
239 const LayoutPoint&) const { 238 const LayoutPoint&) const {
240 SVGShapePainter(*this).paint(paintInfo); 239 SVGShapePainter(*this).paint(paintInfo);
241 } 240 }
242 241
243 // This method is called from inside paintOutline() since we call paintOutline() 242 // This method is called from inside paintOutline() since we call paintOutline()
244 // while transformed to our coord system, return local coords 243 // while transformed to our coord system, return local coords
245 void LayoutSVGShape::addOutlineRects(Vector<LayoutRect>& rects, 244 void LayoutSVGShape::addOutlineRects(Vector<LayoutRect>& rects,
246 const LayoutPoint&, 245 const LayoutPoint&,
247 IncludeBlockVisualOverflowOrNot) const { 246 IncludeBlockVisualOverflowOrNot) const {
248 rects.append(LayoutRect(paintInvalidationRectInLocalSVGCoordinates())); 247 rects.append(LayoutRect(visualRectInLocalSVGCoordinates()));
249 } 248 }
250 249
251 bool LayoutSVGShape::nodeAtFloatPoint(HitTestResult& result, 250 bool LayoutSVGShape::nodeAtFloatPoint(HitTestResult& result,
252 const FloatPoint& pointInParent, 251 const FloatPoint& pointInParent,
253 HitTestAction hitTestAction) { 252 HitTestAction hitTestAction) {
254 // We only draw in the foreground phase, so we only hit-test then. 253 // We only draw in the foreground phase, so we only hit-test then.
255 if (hitTestAction != HitTestForeground) 254 if (hitTestAction != HitTestForeground)
256 return false; 255 return false;
257 256
258 FloatPoint localPoint; 257 FloatPoint localPoint;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); 328 return lengthContext.valueForLength(style()->svgStyle().strokeWidth());
330 } 329 }
331 330
332 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const { 331 LayoutSVGShapeRareData& LayoutSVGShape::ensureRareData() const {
333 if (!m_rareData) 332 if (!m_rareData)
334 m_rareData = wrapUnique(new LayoutSVGShapeRareData()); 333 m_rareData = wrapUnique(new LayoutSVGShapeRareData());
335 return *m_rareData.get(); 334 return *m_rareData.get();
336 } 335 }
337 336
338 } // namespace blink 337 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698