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

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

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 8 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
« no previous file with comments | « Source/core/layout/svg/LayoutSVGShape.h ('k') | Source/core/layout/svg/LayoutSVGText.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10 matching lines...) Expand all
21 * 21 *
22 * You should have received a copy of the GNU Library General Public License 22 * You should have received a copy of the GNU Library General Public License
23 * along with this library; see the file COPYING.LIB. If not, write to 23 * along with this library; see the file COPYING.LIB. If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA. 25 * Boston, MA 02110-1301, USA.
26 */ 26 */
27 27
28 #include "config.h" 28 #include "config.h"
29 #include "core/layout/svg/LayoutSVGShape.h" 29 #include "core/layout/svg/LayoutSVGShape.h"
30 30
31 #include "core/layout/HitTestRequest.h" 31 #include "core/layout/HitTestResult.h"
32 #include "core/layout/LayoutAnalyzer.h" 32 #include "core/layout/LayoutAnalyzer.h"
33 #include "core/layout/PointerEventsHitRules.h" 33 #include "core/layout/PointerEventsHitRules.h"
34 #include "core/layout/svg/SVGLayoutSupport.h" 34 #include "core/layout/svg/SVGLayoutSupport.h"
35 #include "core/layout/svg/SVGPathData.h" 35 #include "core/layout/svg/SVGPathData.h"
36 #include "core/layout/svg/SVGResources.h" 36 #include "core/layout/svg/SVGResources.h"
37 #include "core/layout/svg/SVGResourcesCache.h" 37 #include "core/layout/svg/SVGResourcesCache.h"
38 #include "core/paint/SVGShapePainter.h" 38 #include "core/paint/SVGShapePainter.h"
39 #include "core/svg/SVGGraphicsElement.h" 39 #include "core/svg/SVGGraphicsElement.h"
40 #include "core/svg/SVGLengthContext.h" 40 #include "core/svg/SVGLengthContext.h"
41 #include "platform/geometry/FloatPoint.h" 41 #include "platform/geometry/FloatPoint.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 // This method is called from inside paintOutline() since we call paintOutline() 182 // This method is called from inside paintOutline() since we call paintOutline()
183 // while transformed to our coord system, return local coords 183 // while transformed to our coord system, return local coords
184 void LayoutSVGShape::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo int&) const 184 void LayoutSVGShape::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPo int&) const
185 { 185 {
186 LayoutRect rect = LayoutRect(paintInvalidationRectInLocalCoordinates()); 186 LayoutRect rect = LayoutRect(paintInvalidationRectInLocalCoordinates());
187 if (!rect.isEmpty()) 187 if (!rect.isEmpty())
188 rects.append(rect); 188 rects.append(rect);
189 } 189 }
190 190
191 bool LayoutSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu lt& result, const FloatPoint& pointInParent, HitTestAction hitTestAction) 191 bool LayoutSVGShape::nodeAtFloatPoint(HitTestResult& result, const FloatPoint& p ointInParent, HitTestAction hitTestAction)
192 { 192 {
193 // We only draw in the foreground phase, so we only hit-test then. 193 // We only draw in the foreground phase, so we only hit-test then.
194 if (hitTestAction != HitTestForeground) 194 if (hitTestAction != HitTestForeground)
195 return false; 195 return false;
196 196
197 FloatPoint localPoint; 197 FloatPoint localPoint;
198 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localToPar entTransform(), pointInParent, localPoint)) 198 if (!SVGLayoutSupport::transformToUserSpaceAndCheckClipping(this, localToPar entTransform(), pointInParent, localPoint))
199 return false; 199 return false;
200 200
201 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_GEOMETRY_HITTESTIN G, request, style()->pointerEvents()); 201 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_GEOMETRY_HITTESTIN G, result.hitTestRequest(), style()->pointerEvents());
202 if (nodeAtFloatPointInternal(request, localPoint, hitRules)) { 202 if (nodeAtFloatPointInternal(result.hitTestRequest(), localPoint, hitRules)) {
203 updateHitTestResult(result, roundedLayoutPoint(localPoint)); 203 updateHitTestResult(result, roundedLayoutPoint(localPoint));
204 return true; 204 return true;
205 } 205 }
206 206
207 return false; 207 return false;
208 } 208 }
209 209
210 bool LayoutSVGShape::nodeAtFloatPointInternal(const HitTestRequest& request, con st FloatPoint& localPoint, PointerEventsHitRules hitRules) 210 bool LayoutSVGShape::nodeAtFloatPointInternal(const HitTestRequest& request, con st FloatPoint& localPoint, PointerEventsHitRules hitRules)
211 { 211 {
212 bool isVisible = (style()->visibility() == VISIBLE); 212 bool isVisible = (style()->visibility() == VISIBLE);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox); 260 SVGLayoutSupport::intersectPaintInvalidationRectWithResources(this, m_paintI nvalidationBoundingBox);
261 } 261 }
262 262
263 float LayoutSVGShape::strokeWidth() const 263 float LayoutSVGShape::strokeWidth() const
264 { 264 {
265 SVGLengthContext lengthContext(element()); 265 SVGLengthContext lengthContext(element());
266 return lengthContext.valueForLength(style()->svgStyle().strokeWidth()); 266 return lengthContext.valueForLength(style()->svgStyle().strokeWidth());
267 } 267 }
268 268
269 } 269 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGShape.h ('k') | Source/core/layout/svg/LayoutSVGText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698