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

Side by Side Diff: Source/core/svg/SVGGeometryElement.cpp

Issue 1154853007: Move toClipPath to SVGGeometryElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Draft 14 Created 5 years, 6 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/svg/SVGGeometryElement.h ('k') | Source/core/svg/SVGGraphicsElement.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) 2013 Samsung Electronics. All rights reserved. 2 * Copyright (C) 2013 Samsung Electronics. 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // FIXME: Eventually we should support isPointInStroke for display:none elem ents. 66 // FIXME: Eventually we should support isPointInStroke for display:none elem ents.
67 if (!layoutObject() || !layoutObject()->isSVGShape()) 67 if (!layoutObject() || !layoutObject()->isSVGShape())
68 return false; 68 return false;
69 69
70 HitTestRequest request(HitTestRequest::ReadOnly); 70 HitTestRequest request(HitTestRequest::ReadOnly);
71 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_GEOMETRY_HITTESTIN G, request, layoutObject()->style()->pointerEvents()); 71 PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_GEOMETRY_HITTESTIN G, request, layoutObject()->style()->pointerEvents());
72 hitRules.canHitFill = false; 72 hitRules.canHitFill = false;
73 return toLayoutSVGShape(layoutObject())->nodeAtFloatPointInternal(request, p oint->target()->value(), hitRules); 73 return toLayoutSVGShape(layoutObject())->nodeAtFloatPointInternal(request, p oint->target()->value(), hitRules);
74 } 74 }
75 75
76 void SVGGeometryElement::toClipPath(Path& path) 76 void SVGGeometryElement::toClipPath(Path& path) const
77 { 77 {
78 path = asPath(); 78 path = asPath();
79 path.transform(calculateAnimatedLocalTransform()); 79 path.transform(calculateAnimatedLocalTransform());
80 80
81 ASSERT(layoutObject()); 81 ASSERT(layoutObject());
82 ASSERT(layoutObject()->style()); 82 ASSERT(layoutObject()->style());
83 path.setWindRule(layoutObject()->style()->svgStyle().clipRule()); 83 path.setWindRule(layoutObject()->style()->svgStyle().clipRule());
84 } 84 }
85 85
86 LayoutObject* SVGGeometryElement::createLayoutObject(const ComputedStyle&) 86 LayoutObject* SVGGeometryElement::createLayoutObject(const ComputedStyle&)
87 { 87 {
88 // By default, any subclass is expected to do path-based drawing. 88 // By default, any subclass is expected to do path-based drawing.
89 return new LayoutSVGPath(this); 89 return new LayoutSVGPath(this);
90 } 90 }
91 91
92 } 92 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGeometryElement.h ('k') | Source/core/svg/SVGGraphicsElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698