Remove unnecessary calls to RenderSVGShape::createShape()
authorpdr@google.com <pdr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 22:36:48 +0000 (22:36 +0000)
committerpdr@google.com <pdr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Apr 2012 22:36:48 +0000 (22:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83598

Reviewed by Rob Buis.

RenderSVGShape::strokeContains contains calls to fall back to path stroke hit detection
in several cases (dashed strokes, for example). One of these cases, a check for isStyled,
is not needed and is always true for Ellipses, Circles, and Rects (all styled elements).
This change removes the check for isStyled.

No new tests as this only affects performance, not test results.

* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::strokeContains):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113781 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/svg/RenderSVGShape.cpp

index b1a338a..db56b81 100644 (file)
@@ -1,3 +1,20 @@
+2012-04-10  Philip Rogers  <pdr@google.com>
+
+        Remove unnecessary calls to RenderSVGShape::createShape()
+        https://bugs.webkit.org/show_bug.cgi?id=83598
+
+        Reviewed by Rob Buis.
+
+        RenderSVGShape::strokeContains contains calls to fall back to path stroke hit detection
+        in several cases (dashed strokes, for example). One of these cases, a check for isStyled,
+        is not needed and is always true for Ellipses, Circles, and Rects (all styled elements).
+        This change removes the check for isStyled.
+
+        No new tests as this only affects performance, not test results.
+
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::strokeContains):
+
 2012-04-10  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/10912486> CanvasRenderingContext2D does not expose its backing store resolution
index 61d969d..1c130bd 100755 (executable)
@@ -152,7 +152,7 @@ bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke
     }
 
     if (!svgStyle->strokeDashArray().isEmpty() || svgStyle->strokeMiterLimit() != svgStyle->initialStrokeMiterLimit()
-        || svgStyle->joinStyle() != svgStyle->initialJoinStyle() || svgStyle->capStyle() != svgStyle->initialCapStyle() || static_cast<SVGElement*>(node())->isStyled()) {
+        || svgStyle->joinStyle() != svgStyle->initialJoinStyle() || svgStyle->capStyle() != svgStyle->initialCapStyle()) {
         if (!m_path)
             RenderSVGShape::createShape();
         return RenderSVGShape::shapeDependentStrokeContains(point);