[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreas.kling at nokia.com
andreas.kling at nokia.com
Wed Dec 22 14:21:44 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ecf4956be79ebf81d2c7b1d18bd8c039e24a04ef
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 7 07:33:33 2010 +0000
2010-10-07 Andreas Kling <kling at webkit.org>
Reviewed by Nikolas Zimmermann.
Rename (and move) RenderPath to svg/RenderSVGPath
https://bugs.webkit.org/show_bug.cgi?id=47053
Also renamed RenderObject::isRenderPath() to isSVGPath()
* Android.mk:
* CMakeLists.txt:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.order:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderObject.h:
(WebCore::RenderObject::isSVGPath):
* rendering/RenderPath.cpp: Removed.
* rendering/RenderPath.h: Removed.
* rendering/RenderSVGHiddenContainer.cpp:
* rendering/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
(WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
(WebCore::RenderSVGResourceClipper::hitTestClipContent):
* rendering/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
* rendering/RenderSVGResourceSolidColor.cpp:
(WebCore::RenderSVGResourceSolidColor::postApplyResource):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* rendering/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::layoutChildren):
* rendering/SVGRenderTreeAsText.cpp:
(WebCore::writeStyle):
(WebCore::operator<<):
(WebCore::write):
* rendering/SVGRenderTreeAsText.h:
* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff):
* rendering/svg/RenderSVGPath.cpp: Copied from WebCore/rendering/RenderPath.cpp.
(WebCore::RenderSVGPath::RenderSVGPath):
(WebCore::RenderSVGPath::fillContains):
(WebCore::RenderSVGPath::strokeContains):
(WebCore::RenderSVGPath::layout):
(WebCore::RenderSVGPath::fillAndStrokePath):
(WebCore::RenderSVGPath::paint):
(WebCore::RenderSVGPath::addFocusRingRects):
(WebCore::RenderSVGPath::nodeAtFloatPoint):
(WebCore::RenderSVGPath::calculateMarkerBoundsIfNeeded):
(WebCore::RenderSVGPath::updateCachedBoundaries):
* rendering/svg/RenderSVGPath.h: Copied from WebCore/rendering/RenderPath.h.
(WebCore::RenderSVGPath::isSVGPath):
(WebCore::RenderSVGPath::renderName):
(WebCore::toRenderSVGPath):
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::svgAttributeChanged):
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::svgAttributeChanged):
* svg/SVGGradientElement.cpp:
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::svgAttributeChanged):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::svgAttributeChanged):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::svgAttributeChanged):
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::svgAttributeChanged):
* svg/SVGStyledLocatableElement.cpp:
* svg/SVGStyledTransformableElement.cpp:
(WebCore::SVGStyledTransformableElement::createRenderer):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 4246787..7af2148 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -681,7 +681,6 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/RenderObject.cpp \
rendering/RenderObjectChildList.cpp \
rendering/RenderPart.cpp \
- rendering/RenderPath.cpp \
rendering/RenderReplaced.cpp \
rendering/RenderReplica.cpp \
@@ -711,6 +710,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/RenderSVGViewportContainer.cpp \
rendering/svg/RenderSVGInline.cpp \
rendering/svg/RenderSVGInlineText.cpp \
+ rendering/svg/RenderSVGPath.cpp \
rendering/svg/RenderSVGTSpan.cpp \
rendering/svg/RenderSVGText.cpp \
rendering/svg/RenderSVGTextPath.cpp \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 5e52e8e..8b4f0f6 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -1693,7 +1693,6 @@ IF (ENABLE_SVG)
css/SVGCSSStyleSelector.cpp
rendering/PointerEventsHitRules.cpp
rendering/RenderForeignObject.cpp
- rendering/RenderPath.cpp
rendering/RenderSVGBlock.cpp
rendering/RenderSVGContainer.cpp
rendering/RenderSVGGradientStop.cpp
@@ -1728,6 +1727,7 @@ IF (ENABLE_SVG)
rendering/style/SVGRenderStyleDefs.cpp
rendering/svg/RenderSVGInline.cpp
rendering/svg/RenderSVGInlineText.cpp
+ rendering/svg/RenderSVGPath.cpp
rendering/svg/RenderSVGTSpan.cpp
rendering/svg/RenderSVGText.cpp
rendering/svg/RenderSVGTextPath.cpp
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 0b365ad..15836e1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,76 @@
+2010-10-07 Andreas Kling <kling at webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Rename (and move) RenderPath to svg/RenderSVGPath
+ https://bugs.webkit.org/show_bug.cgi?id=47053
+
+ Also renamed RenderObject::isRenderPath() to isSVGPath()
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.order:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isSVGPath):
+ * rendering/RenderPath.cpp: Removed.
+ * rendering/RenderPath.h: Removed.
+ * rendering/RenderSVGHiddenContainer.cpp:
+ * rendering/RenderSVGResourceClipper.cpp:
+ (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
+ (WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect):
+ (WebCore::RenderSVGResourceClipper::hitTestClipContent):
+ * rendering/RenderSVGResourceContainer.cpp:
+ (WebCore::RenderSVGResourceContainer::transformOnNonScalingStroke):
+ * rendering/RenderSVGResourceSolidColor.cpp:
+ (WebCore::RenderSVGResourceSolidColor::postApplyResource):
+ * rendering/RenderTreeAsText.cpp:
+ (WebCore::write):
+ * rendering/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::layoutChildren):
+ * rendering/SVGRenderTreeAsText.cpp:
+ (WebCore::writeStyle):
+ (WebCore::operator<<):
+ (WebCore::write):
+ * rendering/SVGRenderTreeAsText.h:
+ * rendering/style/SVGRenderStyle.cpp:
+ (WebCore::SVGRenderStyle::diff):
+ * rendering/svg/RenderSVGPath.cpp: Copied from WebCore/rendering/RenderPath.cpp.
+ (WebCore::RenderSVGPath::RenderSVGPath):
+ (WebCore::RenderSVGPath::fillContains):
+ (WebCore::RenderSVGPath::strokeContains):
+ (WebCore::RenderSVGPath::layout):
+ (WebCore::RenderSVGPath::fillAndStrokePath):
+ (WebCore::RenderSVGPath::paint):
+ (WebCore::RenderSVGPath::addFocusRingRects):
+ (WebCore::RenderSVGPath::nodeAtFloatPoint):
+ (WebCore::RenderSVGPath::calculateMarkerBoundsIfNeeded):
+ (WebCore::RenderSVGPath::updateCachedBoundaries):
+ * rendering/svg/RenderSVGPath.h: Copied from WebCore/rendering/RenderPath.h.
+ (WebCore::RenderSVGPath::isSVGPath):
+ (WebCore::RenderSVGPath::renderName):
+ (WebCore::toRenderSVGPath):
+ * svg/SVGCircleElement.cpp:
+ (WebCore::SVGCircleElement::svgAttributeChanged):
+ * svg/SVGEllipseElement.cpp:
+ (WebCore::SVGEllipseElement::svgAttributeChanged):
+ * svg/SVGGradientElement.cpp:
+ * svg/SVGLineElement.cpp:
+ (WebCore::SVGLineElement::svgAttributeChanged):
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::svgAttributeChanged):
+ * svg/SVGPolyElement.cpp:
+ (WebCore::SVGPolyElement::svgAttributeChanged):
+ * svg/SVGRectElement.cpp:
+ (WebCore::SVGRectElement::svgAttributeChanged):
+ * svg/SVGStyledLocatableElement.cpp:
+ * svg/SVGStyledTransformableElement.cpp:
+ (WebCore::SVGStyledTransformableElement::createRenderer):
+
2010-10-06 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 133217a..4f614c8 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -2627,8 +2627,6 @@ webcore_sources += \
WebCore/rendering/RenderOverflow.h \
WebCore/rendering/RenderPart.cpp \
WebCore/rendering/RenderPart.h \
- WebCore/rendering/RenderPath.cpp \
- WebCore/rendering/RenderPath.h \
WebCore/rendering/RenderProgress.cpp \
WebCore/rendering/RenderProgress.h \
WebCore/rendering/RenderReplaced.cpp \
@@ -2814,6 +2812,8 @@ webcore_sources += \
WebCore/rendering/svg/RenderSVGInline.h \
WebCore/rendering/svg/RenderSVGInlineText.cpp \
WebCore/rendering/svg/RenderSVGInlineText.h \
+ WebCore/rendering/svg/RenderSVGPath.cpp \
+ WebCore/rendering/svg/RenderSVGPath.h \
WebCore/rendering/svg/RenderSVGTSpan.cpp \
WebCore/rendering/svg/RenderSVGTSpan.h \
WebCore/rendering/svg/RenderSVGText.cpp \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index b23e5e0..fe6642a 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3474,6 +3474,8 @@
'rendering/svg/RenderSVGInline.h',
'rendering/svg/RenderSVGInlineText.cpp',
'rendering/svg/RenderSVGInlineText.h',
+ 'rendering/svg/RenderSVGPath.cpp',
+ 'rendering/svg/RenderSVGPath.h',
'rendering/svg/RenderSVGTSpan.cpp',
'rendering/svg/RenderSVGTSpan.h',
'rendering/svg/RenderSVGText.cpp',
@@ -3615,8 +3617,6 @@
'rendering/RenderObjectChildList.h',
'rendering/RenderPart.cpp',
'rendering/RenderPart.h',
- 'rendering/RenderPath.cpp',
- 'rendering/RenderPath.h',
'rendering/RenderProgress.cpp',
'rendering/RenderProgress.h',
'rendering/RenderReplaced.cpp',
diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order
index 4124777..7eb980c 100644
--- a/WebCore/WebCore.order
+++ b/WebCore/WebCore.order
@@ -15911,7 +15911,7 @@ __ZN7WebCore10TextStreamlsEPKc
__ZN7WebCorelsERNS_10TextStreamERKNS_7IntRectE
__ZN7WebCore10TextStreamlsEi
__ZN7WebCore5writeERNS_10TextStreamERKNS_12RenderObjectEij
-__ZNK7WebCore12RenderObject12isRenderPathEv
+__ZNK7WebCore12RenderObject9isSVGPathEv
__ZNK7WebCore12RenderObject17isSVGGradientStopEv
__ZNK7WebCore12RenderObject22isSVGResourceContainerEv
__ZNK7WebCore12RenderObject10isSVGImageEv
@@ -16699,13 +16699,13 @@ __ZNK7WebCore10SVGElement25childShouldCreateRendererEPNS_4NodeE
__ZNK7WebCore14SVGRectElement7isValidEv
__ZN7WebCore16SVGStyledElement16rendererIsNeededEPNS_11RenderStyleE
__ZN7WebCore29SVGStyledTransformableElement14createRendererEPNS_11RenderArenaEPNS_11RenderStyleE
-__ZN7WebCore10RenderPathC1EPNS_29SVGStyledTransformableElementE
-__ZN7WebCore10RenderPathC2EPNS_29SVGStyledTransformableElementE
+__ZN7WebCore13RenderSVGPathC1EPNS_29SVGStyledTransformableElementE
+__ZN7WebCore13RenderSVGPathC2EPNS_29SVGStyledTransformableElementE
__ZN7WebCore20RenderSVGModelObjectC2EPNS_16SVGStyledElementE
__ZN7WebCore19SVGMarkerLayoutInfoC1Ev
__ZN7WebCore19SVGMarkerLayoutInfoC2Ev
-__ZN7WebCore10RenderPath15styleWillChangeENS_15StyleDifferenceEPKNS_11RenderStyleE
-__ZN7WebCore10RenderPath24setNeedsBoundariesUpdateEv
+__ZN7WebCore13RenderSVGPath15styleWillChangeENS_15StyleDifferenceEPKNS_11RenderStyleE
+__ZN7WebCore13RenderSVGPath24setNeedsBoundariesUpdateEv
__ZN7WebCore13RenderSVGRoot15virtualChildrenEv
__ZNK7WebCore13RenderSVGRoot9isSVGRootEv
__ZN7WebCore10SVGElement15eventParentNodeEv
@@ -16749,7 +16749,7 @@ __ZN7WebCore24getRenderSVGResourceByIdINS_23RenderSVGResourceFilterEEEPT_PNS_8Do
__ZN7WebCore24getRenderSVGResourceByIdINS_23RenderSVGResourceMarkerEEEPT_PNS_8DocumentERKNS_12AtomicStringE
__ZN7WebCore29SVGStyledTransformableElement16isKnownAttributeERKNS_13QualifiedNameE
__ZN7WebCore16SVGStyledElement16isKnownAttributeERKNS_13QualifiedNameE
-__ZN7WebCore10RenderPath23setNeedsTransformUpdateEv
+__ZN7WebCore13RenderSVGPath23setNeedsTransformUpdateEv
__ZN7WebCoreL15textConstructorERKNS_13QualifiedNameEPNS_8DocumentEb
__ZN7WebCore14SVGTextElementC1ERKNS_13QualifiedNameEPNS_8DocumentE
__ZN7WebCore25SVGTextPositioningElementC2ERKNS_13QualifiedNameEPNS_8DocumentE
@@ -16810,7 +16810,7 @@ __ZNK7WebCore13SVGSVGElement12currentScaleEv
__ZNK7WebCore13RenderSVGRoot18calcReplacedHeightEv
__ZN7WebCore13RenderSVGRoot12calcViewportEv
__ZN7WebCore13SVGRenderBase14layoutChildrenEPNS_12RenderObjectEb
-__ZN7WebCore10RenderPath6layoutEv
+__ZN7WebCore13RenderSVGPath6layoutEv
__ZNK7WebCore14SVGRectElement10toPathDataEv
__ZNK7WebCore29SVGStyledTransformableElement22animatedLocalTransformEv
__ZNK7WebCore16SVGTransformList11concatenateEv
@@ -16819,7 +16819,7 @@ __ZN7WebCore12SVGTransformC2Ev
__ZNK7WebCore12SVGTransform6matrixEv
__ZN7WebCore12SVGTransformD1Ev
__ZN7WebCore12SVGTransformD2Ev
-__ZN7WebCore10RenderPath22updateCachedBoundariesEv
+__ZN7WebCore13RenderSVGPath22updateCachedBoundariesEv
__ZNK7WebCore13SVGRenderBase28filterBoundingBoxForRendererEPKNS_12RenderObjectE
__ZNK7WebCore13SVGRenderBase29clipperBoundingBoxForRendererEPKNS_12RenderObjectE
__ZNK7WebCore13SVGRenderBase28maskerBoundingBoxForRendererEPKNS_12RenderObjectE
@@ -16932,14 +16932,14 @@ __ZN7WebCore15AffineTransform14translateRightEdd
__ZN7WebCore25applyTransformToPaintInfoERNS_12RenderObject9PaintInfoERKNS_15AffineTransformE
__ZNK7WebCore13RenderSVGRoot29repaintRectInLocalCoordinatesEv
__ZN7WebCore13SVGRenderBase27computeContainerBoundingBoxEPKNS_12RenderObjectEb
-__ZNK7WebCore10RenderPath29repaintRectInLocalCoordinatesEv
-__ZNK7WebCore10RenderPath22localToParentTransformEv
+__ZNK7WebCore13RenderSVGPath29repaintRectInLocalCoordinatesEv
+__ZNK7WebCore13RenderSVGPath22localToParentTransformEv
__ZNK7WebCore13RenderSVGText29repaintRectInLocalCoordinatesEv
__ZNK7WebCore13RenderSVGText17strokeBoundingBoxEv
__ZNK7WebCore13RenderSVGText17objectBoundingBoxEv
__ZNK7WebCore13RenderSVGText22localToParentTransformEv
__ZN7WebCore9RenderBox5paintERNS_12RenderObject9PaintInfoEii
-__ZN7WebCore10RenderPath5paintERNS_12RenderObject9PaintInfoEii
+__ZN7WebCore13RenderSVGPath5paintERNS_12RenderObject9PaintInfoEii
__ZN7WebCore13RenderSVGText5paintERNS_12RenderObject9PaintInfoEii
__ZN7WebCore13SVGRenderBase25prepareToRenderSVGContentEPNS_12RenderObjectERNS1_9PaintInfoERKNS_9FloatRectERPNS_23RenderSVGResou
__ZN7WebCore17RenderSVGResource20fillPaintingResourceEPKNS_12RenderObjectEPKNS_11RenderStyleE
@@ -16960,7 +16960,7 @@ __ZN7WebCore13SVGSVGElement26documentWillBecomeInactiveEv
__ZN7WebCore13SVGSVGElement15pauseAnimationsEv
__ZN7WebCore17SMILTimeContainer5pauseEv
__ZN7WebCore20RenderSVGModelObject7destroyEv
-__ZN7WebCore10RenderPathD0Ev
+__ZN7WebCore13RenderSVGPathD0Ev
__ZN7WebCore19SVGMarkerLayoutInfoD1Ev
__ZN7WebCore19SVGMarkerLayoutInfoD2Ev
__ZN7WebCore19RenderSVGInlineText7destroyEv
@@ -18629,7 +18629,7 @@ __ZNK7WebCore13RenderSVGText19mapLocalToContainerEPNS_20RenderBoxModelObjectEbbR
__ZNK7WebCore14SVGLineElement17hasRelativeValuesEv
__ZN7WebCore9FrameView15contentsResizedEv
__ZNK7WebCore17EmptyChromeClient19contentsSizeChangedEPNS_5FrameERKNS_7IntSizeE
-__ZNK7WebCore10RenderPath17objectBoundingBoxEv
+__ZNK7WebCore13RenderSVGPath17objectBoundingBoxEv
__ZN7WebCore5TimerINS_17SMILTimeContainerEE5firedEv
__ZN7WebCore17SMILTimeContainer10timerFiredEPNS_5TimerIS0_EE
__ZN7WebCore14SVGSMILElement19resolveNextIntervalEv
@@ -24894,10 +24894,10 @@ __ZNK7WebCore13RenderSVGRoot14localTransformEv
__ZN7WebCoreL17writeIfNotDefaultIfEEvRNS_10TextStreamEPKcT_S5_
__ZN7WebCoreL15writeIfNotEmptyERNS_10TextStreamEPKcRKNS_6StringE
__ZN7WebCoreL13writeChildrenERNS_10TextStreamERKNS_12RenderObjectEi
-__ZNK7WebCore10RenderPath12isRenderPathEv
-__ZN7WebCore5writeERNS_10TextStreamERKNS_10RenderPathEi
-__ZNK7WebCore10RenderPath10renderNameEv
-__ZNK7WebCore10RenderPath14localTransformEv
+__ZNK7WebCore13RenderSVGPath9isSVGPathEv
+__ZN7WebCore5writeERNS_10TextStreamERKNS_13RenderSVGPathEi
+__ZNK7WebCore13RenderSVGPath10renderNameEv
+__ZNK7WebCore13RenderSVGPath14localTransformEv
__ZN7WebCorelsERNS_10TextStreamERNS_19TextStreamSeparatorE
__ZN7WebCoreL24writeSVGPaintingResourceERNS_10TextStreamEPNS_17RenderSVGResourceE
__ZNK7WebCore27RenderSVGResourceSolidColor12resourceTypeEv
@@ -26820,7 +26820,7 @@ __ZNK3WTF7HashMapIN7WebCore12AtomicStringENS_6RefPtrINS1_12FilterEffectEEENS1_16
__ZN7WebCore7FEBlend6createEPNS_12FilterEffectES2_NS_13BlendModeTypeE
__ZN7WebCore7FEBlendC1EPNS_12FilterEffectES2_NS_13BlendModeTypeE
__ZN7WebCore7FEBlendC2EPNS_12FilterEffectES2_NS_13BlendModeTypeE
-__ZNK7WebCore10RenderPath17strokeBoundingBoxEv
+__ZNK7WebCore13RenderSVGPath17strokeBoundingBoxEv
__ZN7WebCore23RenderSVGResourceFilter22fitsInMaximumImageSizeERKNS_9FloatSizeERS1_
__ZN7WebCore9SVGFilter6createERKNS_9FloatRectES3_b
__ZN7WebCore9SVGFilterC1ERKNS_9FloatRectES3_b
@@ -27309,7 +27309,7 @@ __ZN7WebCore26StyleInheritedResourceDataC2ERKS0_
__ZNK7WebCore26StyleInheritedResourceDataeqERKS0_
__ZN7WebCore23RenderSVGResourceMarker6layoutEv
__ZN7WebCore23RenderSVGResourceMarker12calcViewportEv
-__ZN7WebCore10RenderPath29calculateMarkerBoundsIfNeededEv
+__ZN7WebCore13RenderSVGPath29calculateMarkerBoundsIfNeededEv
__ZNK7WebCore14SVGPathElement15supportsMarkersEv
__ZThn88_NK7WebCore23RenderSVGResourceMarker12resourceTypeEv
__ZNK7WebCore23RenderSVGResourceMarker12resourceTypeEv
@@ -27558,10 +27558,10 @@ __ZN7WebCore21JSSVGAnimationElement18getOwnPropertySlotEPN3JSC9ExecStateERKNS1_1
__ZNK7WebCore19JSSVGAnimateElement9classInfoEv
__ZN7WebCore13RenderSVGRoot11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultEiiiiNS_13HitTestActionE
__ZNK7WebCore15AffineTransform8mapPointERKNS_8IntPointE
-__ZN7WebCore10RenderPath16nodeAtFloatPointERKNS_14HitTestRequestERNS_13HitTestResultERKNS_10FloatPointENS_13HitTestActionE
+__ZN7WebCore13RenderSVGPath16nodeAtFloatPointERKNS_14HitTestRequestERNS_13HitTestResultERKNS_10FloatPointENS_13HitTestActionE
__ZN7WebCore21PointerEventsHitRulesC1ENS0_11EHitTestingENS_14EPointerEventsE
__ZN7WebCore21PointerEventsHitRulesC2ENS0_11EHitTestingENS_14EPointerEventsE
-__ZNK7WebCore10RenderPath12fillContainsERKNS_10FloatPointEb
+__ZNK7WebCore13RenderSVGPath12fillContainsERKNS_10FloatPointEb
__ZNK7WebCore16SVGStyledElement5titleEv
__ZN7WebCore12RenderObject16positionForPointERKNS_8IntPointE
__ZN7WebCore26jsSVGAnimatedLengthAnimValEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
@@ -27825,7 +27825,7 @@ __ZN7WebCore24JSSVGAnimatedEnumerationD1Ev
__ZN7WebCore24JSSVGAnimatedEnumerationD2Ev
__ZN7WebCore26SVGAnimatedPropertyTearOffIiED0Ev
__ZN7WebCore26RenderSVGViewportContainer25pointIsInsideViewportClipERKNS_10FloatPointE
-__ZNK7WebCore10RenderPath14strokeContainsERKNS_10FloatPointEb
+__ZNK7WebCore13RenderSVGPath14strokeContainsERKNS_10FloatPointEb
__ZNK7WebCore4Path14strokeContainsEPNS_18StrokeStyleApplierERKNS_10FloatPointE
__ZNK7WebCore13SVGUseElement28instanceForShadowTreeElementEPNS_4NodeE
__ZNK7WebCore13SVGUseElement28instanceForShadowTreeElementEPNS_4NodeEPNS_18SVGElementInstanceE
@@ -27942,7 +27942,7 @@ __ZN7WebCore38jsSVGColorPrototypeFunctionSetRGBColorEPN3JSC9ExecStateEPNS0_8JSOb
__ZN7WebCore8SVGPaintC1ERKNS_6StringERKNS_5ColorE
__ZN7WebCore8SVGPaintC2ERKNS_6StringERKNS_5ColorE
__ZN7WebCore14SVGPathElement19synchronizePropertyERKNS_13QualifiedNameE
-__ZN7WebCore10RenderPath17addFocusRingRectsERN3WTF6VectorINS_7IntRectELm0EEEii
+__ZN7WebCore13RenderSVGPath17addFocusRingRectsERN3WTF6VectorINS_7IntRectELm0EEEii
__ZN7WebCore18RenderSVGContainer17addFocusRingRectsERN3WTF6VectorINS_7IntRectELm0EEEii
__ZN7WebCore14RenderSVGImage17addFocusRingRectsERN3WTF6VectorINS_7IntRectELm0EEEii
__ZN7WebCoreL23fontfacenameConstructorERKNS_13QualifiedNameEPNS_8DocumentEb
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index 37d7a46..bf5b216 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2216,7 +2216,6 @@ HEADERS += \
rendering/RenderObjectChildList.h \
rendering/RenderObject.h \
rendering/RenderPart.h \
- rendering/RenderPath.h \
rendering/RenderProgress.h \
rendering/RenderReplaced.h \
rendering/RenderReplica.h \
@@ -2296,6 +2295,7 @@ HEADERS += \
rendering/style/SVGRenderStyle.h \
rendering/svg/RenderSVGInline.h \
rendering/svg/RenderSVGInlineText.h \
+ rendering/svg/RenderSVGPath.h \
rendering/svg/RenderSVGTSpan.h \
rendering/svg/RenderSVGText.h \
rendering/svg/RenderSVGTextPath.h \
@@ -3320,6 +3320,7 @@ contains(DEFINES, ENABLE_SVG=1) {
rendering/style/SVGRenderStyleDefs.cpp \
rendering/svg/RenderSVGInline.cpp \
rendering/svg/RenderSVGInlineText.cpp \
+ rendering/svg/RenderSVGPath.cpp \
rendering/svg/RenderSVGTSpan.cpp \
rendering/svg/RenderSVGText.cpp \
rendering/svg/RenderSVGTextPath.cpp \
@@ -3489,7 +3490,6 @@ contains(DEFINES, ENABLE_SVG=1) {
svg/graphics/filters/SVGFilterBuilder.cpp \
svg/graphics/SVGImage.cpp \
rendering/RenderForeignObject.cpp \
- rendering/RenderPath.cpp \
rendering/RenderSVGBlock.cpp \
rendering/RenderSVGContainer.cpp \
rendering/RenderSVGGradientStop.cpp \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 74d63da..007dba6 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -30731,14 +30731,6 @@
>
</File>
<File
- RelativePath="..\rendering\RenderPath.cpp"
- >
- </File>
- <File
- RelativePath="..\rendering\RenderPath.h"
- >
- </File>
- <File
RelativePath="..\rendering\RenderProgress.cpp"
>
</File>
@@ -33068,6 +33060,14 @@
>
</File>
<File
+ RelativePath="..\rendering\svg\RenderSVGPath.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\svg\RenderSVGPath.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\svg\RenderSVGText.cpp"
>
<FileConfiguration
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 15c23ed..c7dd686 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1866,8 +1866,6 @@
853CA9D90AEEC5E9002372DC /* RenderSVGImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 853CA9CD0AEEC5E9002372DC /* RenderSVGImage.h */; };
853CA9EC0AEEC63C002372DC /* RenderForeignObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 853CA9EA0AEEC63C002372DC /* RenderForeignObject.cpp */; };
853CA9ED0AEEC63C002372DC /* RenderForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 853CA9EB0AEEC63C002372DC /* RenderForeignObject.h */; };
- 853CA9F00AEEC657002372DC /* RenderPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 853CA9EE0AEEC657002372DC /* RenderPath.cpp */; };
- 853CA9F10AEEC657002372DC /* RenderPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 853CA9EF0AEEC657002372DC /* RenderPath.h */; };
854074FC0AD6C22E00620C57 /* DOMSVGNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 854074F90AD6C22E00620C57 /* DOMSVGNumber.h */; };
854074FD0AD6C22E00620C57 /* DOMSVGPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 854074FA0AD6C22E00620C57 /* DOMSVGPoint.h */; };
854074FE0AD6C22E00620C57 /* DOMSVGRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 854074FB0AD6C22E00620C57 /* DOMSVGRect.h */; };
@@ -3887,6 +3885,8 @@
ABDDFE7A0A5C6E7000A3E11D /* RenderMenuList.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */; };
ABFE7E120D32FAF60066F4D2 /* MediaControlElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ABFE7E100D32FAF50066F4D2 /* MediaControlElements.cpp */; };
ABFE7E130D32FAF60066F4D2 /* MediaControlElements.h in Headers */ = {isa = PBXBuildFile; fileRef = ABFE7E110D32FAF50066F4D2 /* MediaControlElements.h */; };
+ ADDF1AD61257CD9A0003A759 /* RenderSVGPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADDF1AD41257CD9A0003A759 /* RenderSVGPath.cpp */; };
+ ADDF1AD71257CD9A0003A759 /* RenderSVGPath.h in Headers */ = {isa = PBXBuildFile; fileRef = ADDF1AD51257CD9A0003A759 /* RenderSVGPath.h */; };
B0149E7D11A4B21500196A7B /* AsyncImageResizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B0149E7911A4B21500196A7B /* AsyncImageResizer.cpp */; };
B0149E7E11A4B21500196A7B /* AsyncImageResizer.h in Headers */ = {isa = PBXBuildFile; fileRef = B0149E7A11A4B21500196A7B /* AsyncImageResizer.h */; };
B0149E7F11A4B21500196A7B /* ImageResizerThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B0149E7B11A4B21500196A7B /* ImageResizerThread.cpp */; };
@@ -7961,8 +7961,6 @@
853CA9CD0AEEC5E9002372DC /* RenderSVGImage.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderSVGImage.h; sourceTree = "<group>"; };
853CA9EA0AEEC63C002372DC /* RenderForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderForeignObject.cpp; sourceTree = "<group>"; };
853CA9EB0AEEC63C002372DC /* RenderForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderForeignObject.h; sourceTree = "<group>"; };
- 853CA9EE0AEEC657002372DC /* RenderPath.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPath.cpp; sourceTree = "<group>"; };
- 853CA9EF0AEEC657002372DC /* RenderPath.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderPath.h; sourceTree = "<group>"; };
854074F90AD6C22E00620C57 /* DOMSVGNumber.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGNumber.h; sourceTree = "<group>"; };
854074FA0AD6C22E00620C57 /* DOMSVGPoint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGPoint.h; sourceTree = "<group>"; };
854074FB0AD6C22E00620C57 /* DOMSVGRect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGRect.h; sourceTree = "<group>"; };
@@ -9673,6 +9671,8 @@
ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderMenuList.h; sourceTree = "<group>"; };
ABFE7E100D32FAF50066F4D2 /* MediaControlElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlElements.cpp; sourceTree = "<group>"; };
ABFE7E110D32FAF50066F4D2 /* MediaControlElements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControlElements.h; sourceTree = "<group>"; };
+ ADDF1AD41257CD9A0003A759 /* RenderSVGPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGPath.cpp; sourceTree = "<group>"; };
+ ADDF1AD51257CD9A0003A759 /* RenderSVGPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGPath.h; sourceTree = "<group>"; };
B0149E7911A4B21500196A7B /* AsyncImageResizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncImageResizer.cpp; sourceTree = "<group>"; };
B0149E7A11A4B21500196A7B /* AsyncImageResizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncImageResizer.h; sourceTree = "<group>"; };
B0149E7B11A4B21500196A7B /* ImageResizerThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageResizerThread.cpp; sourceTree = "<group>"; };
@@ -11714,6 +11714,8 @@
088C2F7412390080003D65CE /* svg */ = {
isa = PBXGroup;
children = (
+ ADDF1AD41257CD9A0003A759 /* RenderSVGPath.cpp */,
+ ADDF1AD51257CD9A0003A759 /* RenderSVGPath.h */,
0854B0021255E4E600B9CDD0 /* RenderSVGInline.cpp */,
0854B0031255E4E600B9CDD0 /* RenderSVGInline.h */,
0854B0041255E4E600B9CDD0 /* RenderSVGInlineText.cpp */,
@@ -17760,8 +17762,6 @@
BCFA930710333193007B25D1 /* RenderOverflow.h */,
A871DEC80A1530C700B12A68 /* RenderPart.cpp */,
A871DECF0A1530C700B12A68 /* RenderPart.h */,
- 853CA9EE0AEEC657002372DC /* RenderPath.cpp */,
- 853CA9EF0AEEC657002372DC /* RenderPath.h */,
A43BF59A1149292800C643CA /* RenderProgress.cpp */,
A43BF59B1149292800C643CA /* RenderProgress.h */,
A871DFDE0A15376B00B12A68 /* RenderReplaced.cpp */,
@@ -20377,7 +20377,6 @@
BC2CC8DF0F32881000A9DF26 /* RenderObjectChildList.h in Headers */,
BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */,
A871DED70A1530C700B12A68 /* RenderPart.h in Headers */,
- 853CA9F10AEEC657002372DC /* RenderPath.h in Headers */,
A43BF59D1149292800C643CA /* RenderProgress.h in Headers */,
A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */,
BCA846D70DC67A350026C309 /* RenderReplica.h in Headers */,
@@ -21054,6 +21053,7 @@
081668D4125603BF006F25DE /* SVGTextChunkBuilder.h in Headers */,
081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */,
1AF8E11A1256592600230FF7 /* ProxyServer.h in Headers */,
+ ADDF1AD71257CD9A0003A759 /* RenderSVGPath.h in Headers */,
934907E4125BBBC8007F23A0 /* GraphicsContextCG.h in Headers */,
893C48011248BD3A002B3D86 /* DirectoryEntrySync.h in Headers */,
893C48031248BD3A002B3D86 /* DirectoryReaderSync.h in Headers */,
@@ -22999,7 +22999,6 @@
BCEA487F097D93020094C9E4 /* RenderObject.cpp in Sources */,
BC60EFB70F33A0E700812A93 /* RenderObjectChildList.cpp in Sources */,
A871DED00A1530C700B12A68 /* RenderPart.cpp in Sources */,
- 853CA9F00AEEC657002372DC /* RenderPath.cpp in Sources */,
A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
A871DFE20A15376B00B12A68 /* RenderReplaced.cpp in Sources */,
BCA846D60DC67A350026C309 /* RenderReplica.cpp in Sources */,
@@ -23601,6 +23600,7 @@
081668D9125603D5006F25DE /* SVGTextLayoutEngine.cpp in Sources */,
1AF8E13312565A4400230FF7 /* ProxyServer.cpp in Sources */,
1AF8E1C3125673E000230FF7 /* ProxyServerCFNet.cpp in Sources */,
+ ADDF1AD61257CD9A0003A759 /* RenderSVGPath.cpp in Sources */,
893C48001248BD3A002B3D86 /* DirectoryEntrySync.cpp in Sources */,
893C48021248BD3A002B3D86 /* DirectoryReaderSync.cpp in Sources */,
893C48041248BD3A002B3D86 /* DOMFileSystemBase.cpp in Sources */,
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index b2d2af1..90dba85 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -314,7 +314,7 @@ public:
virtual bool isSVGContainer() const { return false; }
virtual bool isSVGGradientStop() const { return false; }
virtual bool isSVGHiddenContainer() const { return false; }
- virtual bool isRenderPath() const { return false; }
+ virtual bool isSVGPath() const { return false; }
virtual bool isSVGText() const { return false; }
virtual bool isSVGTextPath() const { return false; }
virtual bool isSVGInline() const { return false; }
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
deleted file mode 100644
index cbe1900..0000000
--- a/WebCore/rendering/RenderPath.cpp
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005, 2008 Rob Buis <buis at kde.org>
- 2005, 2007 Eric Seidel <eric at webkit.org>
- 2009 Google, Inc.
- 2009 Dirk Schulze <krit at webkit.org>
- Copyright (C) Research In Motion Limited 2010. All rights reserved.
- 2009 Jeff Schiller <codedread at gmail.com>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "RenderPath.h"
-
-#include "FloatPoint.h"
-#include "FloatQuad.h"
-#include "GraphicsContext.h"
-#include "HitTestRequest.h"
-#include "PointerEventsHitRules.h"
-#include "RenderSVGContainer.h"
-#include "RenderSVGResourceMarker.h"
-#include "SVGRenderSupport.h"
-#include "SVGResources.h"
-#include "SVGStyledTransformableElement.h"
-#include "SVGTransformList.h"
-#include "SVGURIReference.h"
-#include "StrokeStyleApplier.h"
-#include <wtf/MathExtras.h>
-
-namespace WebCore {
-
-class BoundingRectStrokeStyleApplier : public StrokeStyleApplier {
-public:
- BoundingRectStrokeStyleApplier(const RenderObject* object, RenderStyle* style)
- : m_object(object)
- , m_style(style)
- {
- ASSERT(style);
- ASSERT(object);
- }
-
- void strokeStyle(GraphicsContext* gc)
- {
- SVGRenderSupport::applyStrokeStyleToContext(gc, m_style, m_object);
- }
-
-private:
- const RenderObject* m_object;
- RenderStyle* m_style;
-};
-
-RenderPath::RenderPath(SVGStyledTransformableElement* node)
- : RenderSVGModelObject(node)
- , m_needsBoundariesUpdate(false) // default is false, the cached rects are empty from the beginning
- , m_needsPathUpdate(true) // default is true, so we grab a Path object once from SVGStyledTransformableElement
- , m_needsTransformUpdate(true) // default is true, so we grab a AffineTransform object once from SVGStyledTransformableElement
-{
-}
-
-bool RenderPath::fillContains(const FloatPoint& point, bool requiresFill, WindRule fillRule)
-{
- if (!m_fillBoundingBox.contains(point))
- return false;
-
- if (requiresFill && !RenderSVGResource::fillPaintingResource(this, style()))
- return false;
-
- return m_path.contains(point, fillRule);
-}
-
-bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke)
-{
- if (!m_strokeAndMarkerBoundingBox.contains(point))
- return false;
-
- if (requiresStroke && !RenderSVGResource::strokePaintingResource(this, style()))
- return false;
-
- BoundingRectStrokeStyleApplier strokeStyle(this, style());
- return m_path.strokeContains(&strokeStyle, point);
-}
-
-void RenderPath::layout()
-{
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
- SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
-
- bool updateCachedBoundariesInParents = false;
-
- bool needsPathUpdate = m_needsPathUpdate;
- if (needsPathUpdate) {
- m_path = element->toPathData();
- m_needsPathUpdate = false;
- updateCachedBoundariesInParents = true;
- }
-
- if (m_needsTransformUpdate) {
- m_localTransform = element->animatedLocalTransform();
- m_needsTransformUpdate = false;
- updateCachedBoundariesInParents = true;
- }
-
- if (m_needsBoundariesUpdate)
- updateCachedBoundariesInParents = true;
-
- // Invalidate all resources of this client if our layout changed.
- if (m_everHadLayout && selfNeedsLayout())
- SVGResourcesCache::clientLayoutChanged(this);
-
- // At this point LayoutRepainter already grabbed the old bounds,
- // recalculate them now so repaintAfterLayout() uses the new bounds.
- if (needsPathUpdate || m_needsBoundariesUpdate) {
- updateCachedBoundaries();
- m_needsBoundariesUpdate = false;
- }
-
- // If our bounds changed, notify the parents.
- if (updateCachedBoundariesInParents)
- RenderSVGModelObject::setNeedsBoundariesUpdate();
-
- repainter.repaintAfterLayout();
- setNeedsLayout(false);
-}
-
-void RenderPath::fillAndStrokePath(GraphicsContext* context)
-{
- context->beginPath();
- RenderStyle* style = this->style();
-
- if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style)) {
- context->addPath(m_path);
- if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode))
- fillPaintingResource->postApplyResource(this, context, ApplyToFillMode);
- }
-
- RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(this, style);
- if (!strokePaintingResource)
- return;
-
- bool restoreContext = false;
- if (style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE) {
- SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
- AffineTransform nonScalingStrokeTransform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate);
- if (!nonScalingStrokeTransform.isInvertible())
- return;
-
- Path transformedPath = m_path;
- transformedPath.transform(nonScalingStrokeTransform);
-
- context->save();
- context->concatCTM(nonScalingStrokeTransform.inverse());
- context->addPath(transformedPath);
- restoreContext = true;
- } else
- context->addPath(m_path);
-
- if (strokePaintingResource->applyResource(this, style, context, ApplyToStrokeMode))
- strokePaintingResource->postApplyResource(this, context, ApplyToStrokeMode);
-
- if (restoreContext)
- context->restore();
-}
-
-void RenderPath::paint(PaintInfo& paintInfo, int, int)
-{
- if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty())
- return;
-
- FloatRect boundingBox = repaintRectInLocalCoordinates();
- if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo))
- return;
-
- PaintInfo childPaintInfo(paintInfo);
- bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
- if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
- childPaintInfo.context->save();
- childPaintInfo.applyTransform(m_localTransform);
-
- if (childPaintInfo.phase == PaintPhaseForeground) {
- PaintInfo savedInfo(childPaintInfo);
-
- if (SVGRenderSupport::prepareToRenderSVGContent(this, childPaintInfo)) {
- const SVGRenderStyle* svgStyle = style()->svgStyle();
- if (svgStyle->shapeRendering() == SR_CRISPEDGES)
- childPaintInfo.context->setShouldAntialias(false);
-
- fillAndStrokePath(childPaintInfo.context);
-
- if (svgStyle->hasMarkers())
- m_markerLayoutInfo.drawMarkers(childPaintInfo);
- }
-
- SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context);
- }
-
- if (drawsOutline)
- paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
- static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()));
-
- childPaintInfo.context->restore();
- }
-}
-
-// This method is called from inside paintOutline() since we call paintOutline()
-// while transformed to our coord system, return local coords
-void RenderPath::addFocusRingRects(Vector<IntRect>& rects, int, int)
-{
- IntRect rect = enclosingIntRect(repaintRectInLocalCoordinates());
- if (!rect.isEmpty())
- rects.append(rect);
-}
-
-bool RenderPath::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
-{
- // We only draw in the forground phase, so we only hit-test then.
- if (hitTestAction != HitTestForeground)
- return false;
-
- FloatPoint localPoint = m_localTransform.inverse().mapPoint(pointInParent);
-
- if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
- return false;
-
- PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, request, style()->pointerEvents());
- bool isVisible = (style()->visibility() == VISIBLE);
- if (isVisible || !hitRules.requireVisible) {
- const SVGRenderStyle* svgStyle = style()->svgStyle();
- WindRule fillRule = svgStyle->fillRule();
- if (request.svgClipContent())
- fillRule = svgStyle->clipRule();
- if ((hitRules.canHitStroke && (svgStyle->hasStroke() || !hitRules.requireStroke) && strokeContains(localPoint, hitRules.requireStroke))
- || (hitRules.canHitFill && (svgStyle->hasFill() || !hitRules.requireFill) && fillContains(localPoint, hitRules.requireFill, fillRule))) {
- updateHitTestResult(result, roundedIntPoint(localPoint));
- return true;
- }
- }
- return false;
-}
-
-FloatRect RenderPath::calculateMarkerBoundsIfNeeded()
-{
- SVGElement* svgElement = static_cast<SVGElement*>(node());
- ASSERT(svgElement && svgElement->document());
- if (!svgElement->isStyled())
- return FloatRect();
-
- SVGStyledElement* styledElement = static_cast<SVGStyledElement*>(svgElement);
- if (!styledElement->supportsMarkers())
- return FloatRect();
-
- const SVGRenderStyle* svgStyle = style()->svgStyle();
- ASSERT(svgStyle->hasMarkers());
-
- SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
- if (!resources)
- return FloatRect();
-
- RenderSVGResourceMarker* markerStart = resources->markerStart();
- RenderSVGResourceMarker* markerMid = resources->markerMid();
- RenderSVGResourceMarker* markerEnd = resources->markerEnd();
- if (!markerStart && !markerMid && !markerEnd)
- return FloatRect();
-
- return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, svgStyle->strokeWidth().value(svgElement), m_path);
-}
-
-void RenderPath::updateCachedBoundaries()
-{
- if (m_path.isEmpty()) {
- m_fillBoundingBox = FloatRect();
- m_strokeAndMarkerBoundingBox = FloatRect();
- m_repaintBoundingBox = FloatRect();
- return;
- }
-
- // Cache _unclipped_ fill bounding box, used for calculations in resources
- m_fillBoundingBox = m_path.boundingRect();
-
- // Cache _unclipped_ stroke bounding box, used for calculations in resources (includes marker boundaries)
- m_strokeAndMarkerBoundingBox = m_fillBoundingBox;
-
- const SVGRenderStyle* svgStyle = style()->svgStyle();
- if (svgStyle->hasStroke()) {
- BoundingRectStrokeStyleApplier strokeStyle(this, style());
- m_strokeAndMarkerBoundingBox.unite(m_path.strokeBoundingRect(&strokeStyle));
- }
-
- if (svgStyle->hasMarkers()) {
- FloatRect markerBounds = calculateMarkerBoundsIfNeeded();
- if (!markerBounds.isEmpty())
- m_strokeAndMarkerBoundingBox.unite(markerBounds);
- }
-
- // Cache smallest possible repaint rectangle
- m_repaintBoundingBox = m_strokeAndMarkerBoundingBox;
- SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingBox);
-}
-
-}
-
-#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/RenderPath.h b/WebCore/rendering/RenderPath.h
deleted file mode 100644
index 1d35a01..0000000
--- a/WebCore/rendering/RenderPath.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann at kde.org>
- 2004, 2005 Rob Buis <buis at kde.org>
- 2005 Eric Seidel <eric at webkit.org>
- 2006 Apple Computer, Inc
- 2009 Google, Inc.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- aint with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#ifndef RenderPath_h
-#define RenderPath_h
-
-#if ENABLE(SVG)
-#include "AffineTransform.h"
-#include "FloatRect.h"
-#include "RenderSVGModelObject.h"
-#include "SVGMarkerLayoutInfo.h"
-
-namespace WebCore {
-
-class FloatPoint;
-class RenderSVGContainer;
-class SVGStyledTransformableElement;
-
-class RenderPath : public RenderSVGModelObject {
-public:
- RenderPath(SVGStyledTransformableElement*);
-
- const Path& path() const { return m_path; }
- void setNeedsPathUpdate() { m_needsPathUpdate = true; }
- virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
- virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
-
-private:
- // Hit-detection seperated for the fill and the stroke
- bool fillContains(const FloatPoint&, bool requiresFill = true, WindRule fillRule = RULE_NONZERO);
- bool strokeContains(const FloatPoint&, bool requiresStroke = true);
-
- virtual FloatRect objectBoundingBox() const { return m_fillBoundingBox; }
- virtual FloatRect strokeBoundingBox() const { return m_strokeAndMarkerBoundingBox; }
- virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
- virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
-
- virtual bool isRenderPath() const { return true; }
- virtual const char* renderName() const { return "RenderPath"; }
-
- virtual void layout();
- virtual void paint(PaintInfo&, int parentX, int parentY);
- virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
-
- virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
-
- FloatRect calculateMarkerBoundsIfNeeded();
- void updateCachedBoundaries();
-
-private:
- virtual AffineTransform localTransform() const { return m_localTransform; }
- void fillAndStrokePath(GraphicsContext*);
-
- bool m_needsBoundariesUpdate : 1;
- bool m_needsPathUpdate : 1;
- bool m_needsTransformUpdate : 1;
-
- mutable Path m_path;
- FloatRect m_fillBoundingBox;
- FloatRect m_strokeAndMarkerBoundingBox;
- FloatRect m_repaintBoundingBox;
- SVGMarkerLayoutInfo m_markerLayoutInfo;
- AffineTransform m_localTransform;
-};
-
-inline RenderPath* toRenderPath(RenderObject* object)
-{
- ASSERT(!object || object->isRenderPath());
- return static_cast<RenderPath*>(object);
-}
-
-inline const RenderPath* toRenderPath(const RenderObject* object)
-{
- ASSERT(!object || object->isRenderPath());
- return static_cast<const RenderPath*>(object);
-}
-
-// This will catch anyone doing an unnecessary cast.
-void toRenderPath(const RenderPath*);
-
-}
-
-#endif // ENABLE(SVG)
-#endif
diff --git a/WebCore/rendering/RenderSVGHiddenContainer.cpp b/WebCore/rendering/RenderSVGHiddenContainer.cpp
index ee1d214..fb14ffe 100644
--- a/WebCore/rendering/RenderSVGHiddenContainer.cpp
+++ b/WebCore/rendering/RenderSVGHiddenContainer.cpp
@@ -25,7 +25,7 @@
#if ENABLE(SVG)
#include "RenderSVGHiddenContainer.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "SVGStyledElement.h"
namespace WebCore {
diff --git a/WebCore/rendering/RenderSVGResourceClipper.cpp b/WebCore/rendering/RenderSVGResourceClipper.cpp
index ef44a79..a09afb2 100644
--- a/WebCore/rendering/RenderSVGResourceClipper.cpp
+++ b/WebCore/rendering/RenderSVGResourceClipper.cpp
@@ -247,7 +247,7 @@ bool RenderSVGResourceClipper::drawContentIntoMaskImage(ClipperData* clipperData
}
// Only shapes, paths and texts are allowed for clipping.
- if (!renderer->isRenderPath() && !renderer->isSVGText())
+ if (!renderer->isSVGPath() && !renderer->isSVGText())
continue;
// Save the old RenderStyle of the current object for restoring after drawing
@@ -289,7 +289,7 @@ void RenderSVGResourceClipper::calculateClipContentRepaintRect()
RenderObject* renderer = childNode->renderer();
if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyled() || !renderer)
continue;
- if (!renderer->isRenderPath() && !renderer->isSVGText() && !renderer->isSVGShadowTreeRootContainer())
+ if (!renderer->isSVGPath() && !renderer->isSVGText() && !renderer->isSVGShadowTreeRootContainer())
continue;
RenderStyle* style = renderer->style();
if (!style || style->display() == NONE || style->visibility() != VISIBLE)
@@ -315,7 +315,7 @@ bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundin
RenderObject* renderer = childNode->renderer();
if (!childNode->isSVGElement() || !static_cast<SVGElement*>(childNode)->isStyled() || !renderer)
continue;
- if (!renderer->isRenderPath() && !renderer->isSVGText() && !renderer->isSVGShadowTreeRootContainer())
+ if (!renderer->isSVGPath() && !renderer->isSVGText() && !renderer->isSVGShadowTreeRootContainer())
continue;
IntPoint hitPoint;
HitTestResult result(hitPoint);
diff --git a/WebCore/rendering/RenderSVGResourceContainer.cpp b/WebCore/rendering/RenderSVGResourceContainer.cpp
index 41ab91f..fb30efd 100644
--- a/WebCore/rendering/RenderSVGResourceContainer.cpp
+++ b/WebCore/rendering/RenderSVGResourceContainer.cpp
@@ -179,7 +179,7 @@ void RenderSVGResourceContainer::registerResource()
// FIXME: This does not belong here.
AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderObject* object, const AffineTransform& resourceTransform)
{
- if (!object->isRenderPath())
+ if (!object->isSVGPath())
return resourceTransform;
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node());
diff --git a/WebCore/rendering/RenderSVGResourceSolidColor.cpp b/WebCore/rendering/RenderSVGResourceSolidColor.cpp
index fb07c21..e8e1824 100644
--- a/WebCore/rendering/RenderSVGResourceSolidColor.cpp
+++ b/WebCore/rendering/RenderSVGResourceSolidColor.cpp
@@ -90,7 +90,7 @@ void RenderSVGResourceSolidColor::postApplyResource(RenderObject*, GraphicsConte
#if PLATFORM(SKIA)
// FIXME: Move this into the GraphicsContext
// WebKit implicitly expects us to reset the path.
- // For example in fillAndStrokePath() of RenderPath.cpp the path is
+ // For example in fillAndStrokePath() of RenderSVGPath.cpp the path is
// added back to the context after filling. This is because internally it
// calls CGContextFillPath() which closes the path.
context->beginPath();
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index 6d42f5f..ec36b7e 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -50,11 +50,11 @@
#include <wtf/Vector.h>
#if ENABLE(SVG)
-#include "RenderPath.h"
#include "RenderSVGContainer.h"
#include "RenderSVGGradientStop.h"
#include "RenderSVGImage.h"
#include "RenderSVGInlineText.h"
+#include "RenderSVGPath.h"
#include "RenderSVGRoot.h"
#include "RenderSVGText.h"
#include "SVGRenderTreeAsText.h"
@@ -453,8 +453,8 @@ static void writeTextRun(TextStream& ts, const RenderText& o, const InlineTextBo
void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavior behavior)
{
#if ENABLE(SVG)
- if (o.isRenderPath()) {
- write(ts, *toRenderPath(&o), indent);
+ if (o.isSVGPath()) {
+ write(ts, *toRenderSVGPath(&o), indent);
return;
}
if (o.isSVGGradientStop()) {
diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp
index f29d4b9..608cf4d 100644
--- a/WebCore/rendering/SVGRenderSupport.cpp
+++ b/WebCore/rendering/SVGRenderSupport.cpp
@@ -32,7 +32,7 @@
#include "ImageBuffer.h"
#include "NodeRenderStyle.h"
#include "RenderLayer.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
#include "RenderSVGResourceClipper.h"
#include "RenderSVGResourceFilter.h"
@@ -220,9 +220,9 @@ void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout)
// When selfNeedsLayout is false and the layout size changed, we have to check whether this child uses relative lengths
if (SVGElement* element = child->node()->isSVGElement() ? static_cast<SVGElement*>(child->node()) : 0) {
if (element->isStyled() && static_cast<SVGStyledElement*>(element)->hasRelativeLengths()) {
- // When the layout size changed and when using relative values tell the RenderPath to update its Path object
- if (child->isRenderPath())
- toRenderPath(child)->setNeedsPathUpdate();
+ // When the layout size changed and when using relative values tell the RenderSVGPath to update its Path object
+ if (child->isSVGPath())
+ toRenderSVGPath(child)->setNeedsPathUpdate();
needsLayout = true;
}
diff --git a/WebCore/rendering/SVGRenderTreeAsText.cpp b/WebCore/rendering/SVGRenderTreeAsText.cpp
index 3db87e8..9afc80c 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.cpp
+++ b/WebCore/rendering/SVGRenderTreeAsText.cpp
@@ -40,11 +40,11 @@
#include "PatternAttributes.h"
#include "RadialGradientAttributes.h"
#include "RenderImage.h"
-#include "RenderPath.h"
#include "RenderSVGContainer.h"
#include "RenderSVGGradientStop.h"
#include "RenderSVGImage.h"
#include "RenderSVGInlineText.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResourceClipper.h"
#include "RenderSVGResourceFilter.h"
#include "RenderSVGResourceGradient.h"
@@ -314,12 +314,12 @@ static void writeStyle(TextStream& ts, const RenderObject& object)
writeNameValuePair(ts, "transform", object.localTransform());
writeIfNotDefault(ts, "image rendering", svgStyle->imageRendering(), SVGRenderStyle::initialImageRendering());
writeIfNotDefault(ts, "opacity", style->opacity(), RenderStyle::initialOpacity());
- if (object.isRenderPath()) {
- const RenderPath& path = static_cast<const RenderPath&>(object);
+ if (object.isSVGPath()) {
+ const RenderSVGPath& path = static_cast<const RenderSVGPath&>(object);
ASSERT(path.node());
ASSERT(path.node()->isSVGElement());
- if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(const_cast<RenderPath*>(&path), path.style())) {
+ if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(const_cast<RenderSVGPath*>(&path), path.style())) {
TextStreamSeparator s(" ");
ts << " [stroke={" << s;
writeSVGPaintingResource(ts, strokePaintingResource);
@@ -346,7 +346,7 @@ static void writeStyle(TextStream& ts, const RenderObject& object)
ts << "}]";
}
- if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(const_cast<RenderPath*>(&path), path.style())) {
+ if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(const_cast<RenderSVGPath*>(&path), path.style())) {
TextStreamSeparator s(" ");
ts << " [fill={" << s;
writeSVGPaintingResource(ts, fillPaintingResource);
@@ -370,7 +370,7 @@ static TextStream& writePositionAndStyle(TextStream& ts, const RenderObject& obj
return ts;
}
-static TextStream& operator<<(TextStream& ts, const RenderPath& path)
+static TextStream& operator<<(TextStream& ts, const RenderSVGPath& path)
{
writePositionAndStyle(ts, path);
writeNameAndQuotedValue(ts, "data", path.path().debugString());
@@ -626,7 +626,7 @@ void writeSVGImage(TextStream& ts, const RenderSVGImage& image, int indent)
writeResources(ts, image, indent);
}
-void write(TextStream& ts, const RenderPath& path, int indent)
+void write(TextStream& ts, const RenderSVGPath& path, int indent)
{
writeStandardPrefix(ts, path, indent);
ts << path << "\n";
diff --git a/WebCore/rendering/SVGRenderTreeAsText.h b/WebCore/rendering/SVGRenderTreeAsText.h
index e279cfe..4e9ba5d 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.h
+++ b/WebCore/rendering/SVGRenderTreeAsText.h
@@ -39,16 +39,16 @@ namespace WebCore {
class RenderBlock;
class RenderImage;
class RenderObject;
- class RenderPath;
class RenderSVGGradientStop;
class RenderSVGImage;
+ class RenderSVGPath;
class RenderSVGRoot;
class RenderText;
class AffineTransform;
class SVGUnitTypes;
// functions used by the main RenderTreeAsText code
-void write(TextStream&, const RenderPath&, int indent);
+void write(TextStream&, const RenderSVGPath&, int indent);
void write(TextStream&, const RenderSVGRoot&, int indent);
void writeSVGGradientStop(TextStream&, const RenderSVGGradientStop&, int indent);
void writeSVGResourceContainer(TextStream&, const RenderObject&, int indent);
diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp
index 7d1ad3b..28f80f2 100644
--- a/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -138,7 +138,7 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
if (resources != other->resources)
return StyleDifferenceLayout;
- // If markers change, we need a relayout, as marker boundaries are cached in RenderPath.
+ // If markers change, we need a relayout, as marker boundaries are cached in RenderSVGPath.
if (inheritedResources != other->inheritedResources)
return StyleDifferenceLayout;
@@ -190,7 +190,7 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
return StyleDifferenceRepaint;
}
- // If fill changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderPath contains.
+ // If fill changes, we just need to repaint. Fill boundaries are not influenced by this, only by the Path, that RenderSVGPath contains.
if (fill != other->fill)
return StyleDifferenceRepaint;
diff --git a/WebCore/rendering/svg/RenderSVGPath.cpp b/WebCore/rendering/svg/RenderSVGPath.cpp
new file mode 100644
index 0000000..907b60c
--- /dev/null
+++ b/WebCore/rendering/svg/RenderSVGPath.cpp
@@ -0,0 +1,317 @@
+/*
+ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ 2004, 2005, 2008 Rob Buis <buis at kde.org>
+ 2005, 2007 Eric Seidel <eric at webkit.org>
+ 2009 Google, Inc.
+ 2009 Dirk Schulze <krit at webkit.org>
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ 2009 Jeff Schiller <codedread at gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ aint with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+
+#if ENABLE(SVG)
+#include "RenderSVGPath.h"
+
+#include "FloatPoint.h"
+#include "FloatQuad.h"
+#include "GraphicsContext.h"
+#include "HitTestRequest.h"
+#include "PointerEventsHitRules.h"
+#include "RenderSVGContainer.h"
+#include "RenderSVGResourceMarker.h"
+#include "SVGRenderSupport.h"
+#include "SVGResources.h"
+#include "SVGStyledTransformableElement.h"
+#include "SVGTransformList.h"
+#include "SVGURIReference.h"
+#include "StrokeStyleApplier.h"
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+class BoundingRectStrokeStyleApplier : public StrokeStyleApplier {
+public:
+ BoundingRectStrokeStyleApplier(const RenderObject* object, RenderStyle* style)
+ : m_object(object)
+ , m_style(style)
+ {
+ ASSERT(style);
+ ASSERT(object);
+ }
+
+ void strokeStyle(GraphicsContext* gc)
+ {
+ SVGRenderSupport::applyStrokeStyleToContext(gc, m_style, m_object);
+ }
+
+private:
+ const RenderObject* m_object;
+ RenderStyle* m_style;
+};
+
+RenderSVGPath::RenderSVGPath(SVGStyledTransformableElement* node)
+ : RenderSVGModelObject(node)
+ , m_needsBoundariesUpdate(false) // default is false, the cached rects are empty from the beginning
+ , m_needsPathUpdate(true) // default is true, so we grab a Path object once from SVGStyledTransformableElement
+ , m_needsTransformUpdate(true) // default is true, so we grab a AffineTransform object once from SVGStyledTransformableElement
+{
+}
+
+bool RenderSVGPath::fillContains(const FloatPoint& point, bool requiresFill, WindRule fillRule)
+{
+ if (!m_fillBoundingBox.contains(point))
+ return false;
+
+ if (requiresFill && !RenderSVGResource::fillPaintingResource(this, style()))
+ return false;
+
+ return m_path.contains(point, fillRule);
+}
+
+bool RenderSVGPath::strokeContains(const FloatPoint& point, bool requiresStroke)
+{
+ if (!m_strokeAndMarkerBoundingBox.contains(point))
+ return false;
+
+ if (requiresStroke && !RenderSVGResource::strokePaintingResource(this, style()))
+ return false;
+
+ BoundingRectStrokeStyleApplier strokeStyle(this, style());
+ return m_path.strokeContains(&strokeStyle, point);
+}
+
+void RenderSVGPath::layout()
+{
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
+ SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
+
+ bool updateCachedBoundariesInParents = false;
+
+ bool needsPathUpdate = m_needsPathUpdate;
+ if (needsPathUpdate) {
+ m_path = element->toPathData();
+ m_needsPathUpdate = false;
+ updateCachedBoundariesInParents = true;
+ }
+
+ if (m_needsTransformUpdate) {
+ m_localTransform = element->animatedLocalTransform();
+ m_needsTransformUpdate = false;
+ updateCachedBoundariesInParents = true;
+ }
+
+ if (m_needsBoundariesUpdate)
+ updateCachedBoundariesInParents = true;
+
+ // Invalidate all resources of this client if our layout changed.
+ if (m_everHadLayout && selfNeedsLayout())
+ SVGResourcesCache::clientLayoutChanged(this);
+
+ // At this point LayoutRepainter already grabbed the old bounds,
+ // recalculate them now so repaintAfterLayout() uses the new bounds.
+ if (needsPathUpdate || m_needsBoundariesUpdate) {
+ updateCachedBoundaries();
+ m_needsBoundariesUpdate = false;
+ }
+
+ // If our bounds changed, notify the parents.
+ if (updateCachedBoundariesInParents)
+ RenderSVGModelObject::setNeedsBoundariesUpdate();
+
+ repainter.repaintAfterLayout();
+ setNeedsLayout(false);
+}
+
+void RenderSVGPath::fillAndStrokePath(GraphicsContext* context)
+{
+ context->beginPath();
+ RenderStyle* style = this->style();
+
+ if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style)) {
+ context->addPath(m_path);
+ if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode))
+ fillPaintingResource->postApplyResource(this, context, ApplyToFillMode);
+ }
+
+ RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(this, style);
+ if (!strokePaintingResource)
+ return;
+
+ bool restoreContext = false;
+ if (style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE) {
+ SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
+ AffineTransform nonScalingStrokeTransform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate);
+ if (!nonScalingStrokeTransform.isInvertible())
+ return;
+
+ Path transformedPath = m_path;
+ transformedPath.transform(nonScalingStrokeTransform);
+
+ context->save();
+ context->concatCTM(nonScalingStrokeTransform.inverse());
+ context->addPath(transformedPath);
+ restoreContext = true;
+ } else
+ context->addPath(m_path);
+
+ if (strokePaintingResource->applyResource(this, style, context, ApplyToStrokeMode))
+ strokePaintingResource->postApplyResource(this, context, ApplyToStrokeMode);
+
+ if (restoreContext)
+ context->restore();
+}
+
+void RenderSVGPath::paint(PaintInfo& paintInfo, int, int)
+{
+ if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || m_path.isEmpty())
+ return;
+
+ FloatRect boundingBox = repaintRectInLocalCoordinates();
+ if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo))
+ return;
+
+ PaintInfo childPaintInfo(paintInfo);
+ bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
+ if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
+ childPaintInfo.context->save();
+ childPaintInfo.applyTransform(m_localTransform);
+
+ if (childPaintInfo.phase == PaintPhaseForeground) {
+ PaintInfo savedInfo(childPaintInfo);
+
+ if (SVGRenderSupport::prepareToRenderSVGContent(this, childPaintInfo)) {
+ const SVGRenderStyle* svgStyle = style()->svgStyle();
+ if (svgStyle->shapeRendering() == SR_CRISPEDGES)
+ childPaintInfo.context->setShouldAntialias(false);
+
+ fillAndStrokePath(childPaintInfo.context);
+
+ if (svgStyle->hasMarkers())
+ m_markerLayoutInfo.drawMarkers(childPaintInfo);
+ }
+
+ SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context);
+ }
+
+ if (drawsOutline)
+ paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
+ static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()));
+
+ childPaintInfo.context->restore();
+ }
+}
+
+// This method is called from inside paintOutline() since we call paintOutline()
+// while transformed to our coord system, return local coords
+void RenderSVGPath::addFocusRingRects(Vector<IntRect>& rects, int, int)
+{
+ IntRect rect = enclosingIntRect(repaintRectInLocalCoordinates());
+ if (!rect.isEmpty())
+ rects.append(rect);
+}
+
+bool RenderSVGPath::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
+{
+ // We only draw in the forground phase, so we only hit-test then.
+ if (hitTestAction != HitTestForeground)
+ return false;
+
+ FloatPoint localPoint = m_localTransform.inverse().mapPoint(pointInParent);
+
+ if (!SVGRenderSupport::pointInClippingArea(this, localPoint))
+ return false;
+
+ PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_PATH_HITTESTING, request, style()->pointerEvents());
+ bool isVisible = (style()->visibility() == VISIBLE);
+ if (isVisible || !hitRules.requireVisible) {
+ const SVGRenderStyle* svgStyle = style()->svgStyle();
+ WindRule fillRule = svgStyle->fillRule();
+ if (request.svgClipContent())
+ fillRule = svgStyle->clipRule();
+ if ((hitRules.canHitStroke && (svgStyle->hasStroke() || !hitRules.requireStroke) && strokeContains(localPoint, hitRules.requireStroke))
+ || (hitRules.canHitFill && (svgStyle->hasFill() || !hitRules.requireFill) && fillContains(localPoint, hitRules.requireFill, fillRule))) {
+ updateHitTestResult(result, roundedIntPoint(localPoint));
+ return true;
+ }
+ }
+ return false;
+}
+
+FloatRect RenderSVGPath::calculateMarkerBoundsIfNeeded()
+{
+ SVGElement* svgElement = static_cast<SVGElement*>(node());
+ ASSERT(svgElement && svgElement->document());
+ if (!svgElement->isStyled())
+ return FloatRect();
+
+ SVGStyledElement* styledElement = static_cast<SVGStyledElement*>(svgElement);
+ if (!styledElement->supportsMarkers())
+ return FloatRect();
+
+ const SVGRenderStyle* svgStyle = style()->svgStyle();
+ ASSERT(svgStyle->hasMarkers());
+
+ SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this);
+ if (!resources)
+ return FloatRect();
+
+ RenderSVGResourceMarker* markerStart = resources->markerStart();
+ RenderSVGResourceMarker* markerMid = resources->markerMid();
+ RenderSVGResourceMarker* markerEnd = resources->markerEnd();
+ if (!markerStart && !markerMid && !markerEnd)
+ return FloatRect();
+
+ return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, svgStyle->strokeWidth().value(svgElement), m_path);
+}
+
+void RenderSVGPath::updateCachedBoundaries()
+{
+ if (m_path.isEmpty()) {
+ m_fillBoundingBox = FloatRect();
+ m_strokeAndMarkerBoundingBox = FloatRect();
+ m_repaintBoundingBox = FloatRect();
+ return;
+ }
+
+ // Cache _unclipped_ fill bounding box, used for calculations in resources
+ m_fillBoundingBox = m_path.boundingRect();
+
+ // Cache _unclipped_ stroke bounding box, used for calculations in resources (includes marker boundaries)
+ m_strokeAndMarkerBoundingBox = m_fillBoundingBox;
+
+ const SVGRenderStyle* svgStyle = style()->svgStyle();
+ if (svgStyle->hasStroke()) {
+ BoundingRectStrokeStyleApplier strokeStyle(this, style());
+ m_strokeAndMarkerBoundingBox.unite(m_path.strokeBoundingRect(&strokeStyle));
+ }
+
+ if (svgStyle->hasMarkers()) {
+ FloatRect markerBounds = calculateMarkerBoundsIfNeeded();
+ if (!markerBounds.isEmpty())
+ m_strokeAndMarkerBoundingBox.unite(markerBounds);
+ }
+
+ // Cache smallest possible repaint rectangle
+ m_repaintBoundingBox = m_strokeAndMarkerBoundingBox;
+ SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingBox);
+}
+
+}
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/svg/RenderSVGPath.h b/WebCore/rendering/svg/RenderSVGPath.h
new file mode 100644
index 0000000..cc06df6
--- /dev/null
+++ b/WebCore/rendering/svg/RenderSVGPath.h
@@ -0,0 +1,104 @@
+/*
+ Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann at kde.org>
+ 2004, 2005 Rob Buis <buis at kde.org>
+ 2005 Eric Seidel <eric at webkit.org>
+ 2006 Apple Computer, Inc
+ 2009 Google, Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ aint with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RenderSVGPath_h
+#define RenderSVGPath_h
+
+#if ENABLE(SVG)
+#include "AffineTransform.h"
+#include "FloatRect.h"
+#include "RenderSVGModelObject.h"
+#include "SVGMarkerLayoutInfo.h"
+
+namespace WebCore {
+
+class FloatPoint;
+class RenderSVGContainer;
+class SVGStyledTransformableElement;
+
+class RenderSVGPath : public RenderSVGModelObject {
+public:
+ RenderSVGPath(SVGStyledTransformableElement*);
+
+ const Path& path() const { return m_path; }
+ void setNeedsPathUpdate() { m_needsPathUpdate = true; }
+ virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
+ virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
+
+private:
+ // Hit-detection seperated for the fill and the stroke
+ bool fillContains(const FloatPoint&, bool requiresFill = true, WindRule fillRule = RULE_NONZERO);
+ bool strokeContains(const FloatPoint&, bool requiresStroke = true);
+
+ virtual FloatRect objectBoundingBox() const { return m_fillBoundingBox; }
+ virtual FloatRect strokeBoundingBox() const { return m_strokeAndMarkerBoundingBox; }
+ virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
+ virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
+
+ virtual bool isSVGPath() const { return true; }
+ virtual const char* renderName() const { return "RenderSVGPath"; }
+
+ virtual void layout();
+ virtual void paint(PaintInfo&, int parentX, int parentY);
+ virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
+
+ virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
+
+ FloatRect calculateMarkerBoundsIfNeeded();
+ void updateCachedBoundaries();
+
+private:
+ virtual AffineTransform localTransform() const { return m_localTransform; }
+ void fillAndStrokePath(GraphicsContext*);
+
+ bool m_needsBoundariesUpdate : 1;
+ bool m_needsPathUpdate : 1;
+ bool m_needsTransformUpdate : 1;
+
+ mutable Path m_path;
+ FloatRect m_fillBoundingBox;
+ FloatRect m_strokeAndMarkerBoundingBox;
+ FloatRect m_repaintBoundingBox;
+ SVGMarkerLayoutInfo m_markerLayoutInfo;
+ AffineTransform m_localTransform;
+};
+
+inline RenderSVGPath* toRenderSVGPath(RenderObject* object)
+{
+ ASSERT(!object || object->isSVGPath());
+ return static_cast<RenderSVGPath*>(object);
+}
+
+inline const RenderSVGPath* toRenderSVGPath(const RenderObject* object)
+{
+ ASSERT(!object || object->isSVGPath());
+ return static_cast<const RenderSVGPath*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toRenderSVGPath(const RenderSVGPath*);
+
+}
+
+#endif // ENABLE(SVG)
+#endif
diff --git a/WebCore/svg/SVGCircleElement.cpp b/WebCore/svg/SVGCircleElement.cpp
index b5a5184..4ed4efe 100644
--- a/WebCore/svg/SVGCircleElement.cpp
+++ b/WebCore/svg/SVGCircleElement.cpp
@@ -25,7 +25,7 @@
#include "Attribute.h"
#include "FloatPoint.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -77,7 +77,7 @@ void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+ RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
if (!renderer)
return;
diff --git a/WebCore/svg/SVGEllipseElement.cpp b/WebCore/svg/SVGEllipseElement.cpp
index 5e18910..16743ed 100644
--- a/WebCore/svg/SVGEllipseElement.cpp
+++ b/WebCore/svg/SVGEllipseElement.cpp
@@ -25,7 +25,7 @@
#include "Attribute.h"
#include "FloatPoint.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -83,7 +83,7 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+ RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
if (!renderer)
return;
diff --git a/WebCore/svg/SVGGradientElement.cpp b/WebCore/svg/SVGGradientElement.cpp
index 523e4df..ca61088 100644
--- a/WebCore/svg/SVGGradientElement.cpp
+++ b/WebCore/svg/SVGGradientElement.cpp
@@ -26,7 +26,7 @@
#include "Attribute.h"
#include "CSSStyleSelector.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGHiddenContainer.h"
#include "RenderSVGResourceLinearGradient.h"
#include "RenderSVGResourceRadialGradient.h"
diff --git a/WebCore/svg/SVGLineElement.cpp b/WebCore/svg/SVGLineElement.cpp
index bd15890..229dfa9 100644
--- a/WebCore/svg/SVGLineElement.cpp
+++ b/WebCore/svg/SVGLineElement.cpp
@@ -25,7 +25,7 @@
#include "Attribute.h"
#include "FloatPoint.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -79,7 +79,7 @@ void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+ RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
if (!renderer)
return;
diff --git a/WebCore/svg/SVGPathElement.cpp b/WebCore/svg/SVGPathElement.cpp
index 3ed85a3..d1fc11b 100644
--- a/WebCore/svg/SVGPathElement.cpp
+++ b/WebCore/svg/SVGPathElement.cpp
@@ -24,7 +24,7 @@
#include "SVGPathElement.h"
#include "Attribute.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
#include "SVGNames.h"
#include "SVGPathParserFactory.h"
@@ -197,7 +197,7 @@ void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
{
SVGStyledTransformableElement::svgAttributeChanged(attrName);
- RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+ RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
if (!renderer)
return;
diff --git a/WebCore/svg/SVGPolyElement.cpp b/WebCore/svg/SVGPolyElement.cpp
index da8aba4..6e935f1 100644
--- a/WebCore/svg/SVGPolyElement.cpp
+++ b/WebCore/svg/SVGPolyElement.cpp
@@ -26,7 +26,7 @@
#include "Attribute.h"
#include "Document.h"
#include "FloatPoint.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
#include "SVGNames.h"
#include "SVGParserUtilities.h"
@@ -81,7 +81,7 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName)
if (attrName == SVGNames::pointsAttr)
invalidateSVGAttributes();
- RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+ RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
if (!renderer)
return;
diff --git a/WebCore/svg/SVGRectElement.cpp b/WebCore/svg/SVGRectElement.cpp
index 43ba888..9b6830e 100644
--- a/WebCore/svg/SVGRectElement.cpp
+++ b/WebCore/svg/SVGRectElement.cpp
@@ -24,7 +24,7 @@
#include "SVGRectElement.h"
#include "Attribute.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "RenderSVGResource.h"
#include "SVGLength.h"
#include "SVGNames.h"
@@ -94,7 +94,7 @@ void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName)
if (isLengthAttribute)
updateRelativeLengthsInformation();
- RenderPath* renderer = static_cast<RenderPath*>(this->renderer());
+ RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer());
if (!renderer)
return;
diff --git a/WebCore/svg/SVGStyledLocatableElement.cpp b/WebCore/svg/SVGStyledLocatableElement.cpp
index d22e708..f29121b 100644
--- a/WebCore/svg/SVGStyledLocatableElement.cpp
+++ b/WebCore/svg/SVGStyledLocatableElement.cpp
@@ -24,7 +24,6 @@
#include "SVGStyledLocatableElement.h"
#include "AffineTransform.h"
-#include "RenderPath.h"
#include "SVGElement.h"
#include "SVGSVGElement.h"
diff --git a/WebCore/svg/SVGStyledTransformableElement.cpp b/WebCore/svg/SVGStyledTransformableElement.cpp
index af10ed7..b90887a 100644
--- a/WebCore/svg/SVGStyledTransformableElement.cpp
+++ b/WebCore/svg/SVGStyledTransformableElement.cpp
@@ -25,7 +25,7 @@
#include "AffineTransform.h"
#include "Attr.h"
-#include "RenderPath.h"
+#include "RenderSVGPath.h"
#include "SVGDocument.h"
#include "SVGStyledElement.h"
#include "SVGTransformList.h"
@@ -104,7 +104,7 @@ FloatRect SVGStyledTransformableElement::getBBox(StyleUpdateStrategy styleUpdate
RenderObject* SVGStyledTransformableElement::createRenderer(RenderArena* arena, RenderStyle*)
{
// By default, any subclass is expected to do path-based drawing
- return new (arena) RenderPath(this);
+ return new (arena) RenderSVGPath(this);
}
Path SVGStyledTransformableElement::toClipPath() const
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list