OLD | NEW |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 void SVGGeometryElement::toClipPath(Path& path) const { | 81 void SVGGeometryElement::toClipPath(Path& path) const { |
82 path = asPath(); | 82 path = asPath(); |
83 path.transform(calculateAnimatedLocalTransform()); | 83 path.transform(calculateAnimatedLocalTransform()); |
84 | 84 |
85 ASSERT(layoutObject()); | 85 ASSERT(layoutObject()); |
86 ASSERT(layoutObject()->style()); | 86 ASSERT(layoutObject()->style()); |
87 path.setWindRule(layoutObject()->style()->svgStyle().clipRule()); | 87 path.setWindRule(layoutObject()->style()->svgStyle().clipRule()); |
88 } | 88 } |
89 | 89 |
| 90 float SVGGeometryElement::getTotalLength() { |
| 91 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 92 |
| 93 if (!layoutObject()) |
| 94 return 0; |
| 95 return asPath().length(); |
| 96 } |
| 97 |
| 98 SVGPointTearOff* SVGGeometryElement::getPointAtLength(float length) { |
| 99 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 100 |
| 101 FloatPoint point; |
| 102 if (layoutObject()) |
| 103 point = asPath().pointAtLength(length); |
| 104 return SVGPointTearOff::create(SVGPoint::create(point), 0, |
| 105 PropertyIsNotAnimVal); |
| 106 } |
| 107 |
90 LayoutObject* SVGGeometryElement::createLayoutObject(const ComputedStyle&) { | 108 LayoutObject* SVGGeometryElement::createLayoutObject(const ComputedStyle&) { |
91 // By default, any subclass is expected to do path-based drawing. | 109 // By default, any subclass is expected to do path-based drawing. |
92 return new LayoutSVGPath(this); | 110 return new LayoutSVGPath(this); |
93 } | 111 } |
94 | 112 |
95 } // namespace blink | 113 } // namespace blink |
OLD | NEW |