[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
zimmermann at webkit.org
zimmermann at webkit.org
Wed Dec 22 12:28:22 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 89b063794fe9554985aad64bdadc81e13790eb78
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 24 11:22:12 2010 +0000
2010-08-24 Nikolas Zimmermann <nzimmermann at rim.com>
Reviewed by Dirk Schulze.
Markers don't render, when applied to a target using vector-effect="non-scaling-stroke"
https://bugs.webkit.org/show_bug.cgi?id=44511
Make fillAndStrokePath a member function of RenderPath, to avoid having to pass the const Path& and this paramters.
Don't leave the GraphicsContext mutated after applying non-scaling-stroke transformation, otherwhise markers will be renderer
in the wrong coordinate space, and thus don't show up anymore.
Test: svg/custom/non-scaling-stroke-markers.svg
* rendering/RenderPath.cpp:
(WebCore::RenderPath::fillAndStrokePath):
(WebCore::RenderPath::paint):
* rendering/RenderPath.h:
2010-08-24 Nikolas Zimmermann <nzimmermann at rim.com>
Reviewed by Dirk Schulze.
Markers don't render, when applied to a target using vector-effect="non-scaling-stroke"
https://bugs.webkit.org/show_bug.cgi?id=44511
Add new test verifying that markers can be appplied to objects using vector-effect="non-scaling-stroke".
* platform/mac/svg/custom/non-scaling-stroke-markers-expected.checksum: Added.
* platform/mac/svg/custom/non-scaling-stroke-markers-expected.png: Added.
* platform/mac/svg/custom/non-scaling-stroke-markers-expected.txt: Added.
* svg/custom/non-scaling-stroke-markers.svg: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 59f42dc..81f6e20 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-08-24 Nikolas Zimmermann <nzimmermann at rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Markers don't render, when applied to a target using vector-effect="non-scaling-stroke"
+ https://bugs.webkit.org/show_bug.cgi?id=44511
+
+ Add new test verifying that markers can be appplied to objects using vector-effect="non-scaling-stroke".
+
+ * platform/mac/svg/custom/non-scaling-stroke-markers-expected.checksum: Added.
+ * platform/mac/svg/custom/non-scaling-stroke-markers-expected.png: Added.
+ * platform/mac/svg/custom/non-scaling-stroke-markers-expected.txt: Added.
+ * svg/custom/non-scaling-stroke-markers.svg: Added.
+
2010-08-24 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Tor Arne Vestbø.
diff --git a/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.checksum b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.checksum
new file mode 100644
index 0000000..205d3f1
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.checksum
@@ -0,0 +1 @@
+91f2196a2ee4012d3d7db7e499bf9d5e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.png b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.png
new file mode 100644
index 0000000..eca0216
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.txt b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.txt
new file mode 100644
index 0000000..1cbc33c
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/non-scaling-stroke-markers-expected.txt
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderSVGRoot {svg} at (160,234) size 432x258
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderSVGResourceMarker {marker} [id="arrow1"] [markerUnits=userSpaceOnUse] [ref at (5,5)] [angle=90.00]
+ RenderPath {path} at (100,0) size 12x12 [fill={[type=SOLID] [color=#0000FF]}] [data="M5.00,0.00 L10.00,10.00 L0.00,10.00 Z"]
+ RenderSVGResourceMarker {marker} [id="arrow2"] [markerUnits=strokeWidth] [ref at (5,5)] [angle=90.00]
+ RenderPath {path} at (100,0) size 12x12 [fill={[type=SOLID] [color=#0000FF]}] [data="M5.00,0.00 L10.00,10.00 L0.00,10.00 Z"]
+ RenderPath {line} at (160,234) size 426x12 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [fill={[type=SOLID] [color=#000000]}] [end marker=arrow1] [data="M10.00,40.00 L80.00,40.00"]
+ RenderPath {line} at (160,468) size 432x24 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [fill={[type=SOLID] [color=#000000]}] [end marker=arrow2] [data="M10.00,80.00 L80.00,80.00"]
diff --git a/LayoutTests/svg/custom/non-scaling-stroke-markers.svg b/LayoutTests/svg/custom/non-scaling-stroke-markers.svg
new file mode 100644
index 0000000..6d22b3d
--- /dev/null
+++ b/LayoutTests/svg/custom/non-scaling-stroke-markers.svg
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
+<defs>
+<marker id="arrow1" viewBox="0 0 10 10" orient="90" refX="5" refY="5" markerWidth="2" markerHeight="2" markerUnits="userSpaceOnUse" overflow="visible">
+ <path d="M 5 0 L 10 10 L 0 10 Z" fill="blue" stroke="none"/>
+</marker>
+
+<marker id="arrow2" viewBox="0 0 10 10" orient="90" refX="5" refY="5" markerWidth="2" markerHeight="2" markerUnits="strokeWidth" overflow="visible">
+ <path d="M 5 0 L 10 10 L 0 10 Z" fill="blue" stroke="none"/>
+</marker>
+</defs>
+
+<line x1="10" x2="80" y1="40" y2="40" stroke="green" stroke-width="2px" marker-end="url(#arrow1)" vector-effect="non-scaling-stroke"/>
+<line x1="10" x2="80" y1="80" y2="80" stroke="green" stroke-width="2px" marker-end="url(#arrow2)" vector-effect="non-scaling-stroke"/>
+</svg>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a7952b4..c19755f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-24 Nikolas Zimmermann <nzimmermann at rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Markers don't render, when applied to a target using vector-effect="non-scaling-stroke"
+ https://bugs.webkit.org/show_bug.cgi?id=44511
+
+ Make fillAndStrokePath a member function of RenderPath, to avoid having to pass the const Path& and this paramters.
+ Don't leave the GraphicsContext mutated after applying non-scaling-stroke transformation, otherwhise markers will be renderer
+ in the wrong coordinate space, and thus don't show up anymore.
+
+ Test: svg/custom/non-scaling-stroke-markers.svg
+
+ * rendering/RenderPath.cpp:
+ (WebCore::RenderPath::fillAndStrokePath):
+ (WebCore::RenderPath::paint):
+ * rendering/RenderPath.h:
+
2010-08-24 Adam Barth <abarth at webkit.org>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/rendering/RenderPath.cpp b/WebCore/rendering/RenderPath.cpp
index b9ae6b0..86a12c8 100644
--- a/WebCore/rendering/RenderPath.cpp
+++ b/WebCore/rendering/RenderPath.cpp
@@ -127,33 +127,43 @@ void RenderPath::layout()
setNeedsLayout(false);
}
-static inline void fillAndStrokePath(const Path& path, GraphicsContext* context, RenderPath* object)
+void RenderPath::fillAndStrokePath(GraphicsContext* context)
{
context->beginPath();
- RenderStyle* style = object->style();
+ RenderStyle* style = this->style();
- if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(object, style)) {
- context->addPath(path);
- if (fillPaintingResource->applyResource(object, style, context, ApplyToFillMode))
- fillPaintingResource->postApplyResource(object, context, ApplyToFillMode);
+ if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style)) {
+ context->addPath(m_path);
+ if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode))
+ fillPaintingResource->postApplyResource(this, context, ApplyToFillMode);
}
- if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(object, style)) {
- if (style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE) {
- SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node());
- AffineTransform transform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate);
- if (!transform.isInvertible())
- return;
-
- Path transformedPath = path;
- context->concatCTM(transform.inverse());
- transformedPath.transform(transform);
- context->addPath(transformedPath);
- } else
- context->addPath(path);
- if (strokePaintingResource->applyResource(object, style, context, ApplyToStrokeMode))
- strokePaintingResource->postApplyResource(object, context, ApplyToStrokeMode);
- }
+ 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)
@@ -180,7 +190,7 @@ void RenderPath::paint(PaintInfo& paintInfo, int, int)
if (svgStyle->shapeRendering() == SR_CRISPEDGES)
childPaintInfo.context->setShouldAntialias(false);
- fillAndStrokePath(m_path, childPaintInfo.context, this);
+ fillAndStrokePath(childPaintInfo.context);
if (svgStyle->hasMarkers())
m_markerLayoutInfo.drawMarkers(childPaintInfo);
diff --git a/WebCore/rendering/RenderPath.h b/WebCore/rendering/RenderPath.h
index 57900ad..1bdac07 100644
--- a/WebCore/rendering/RenderPath.h
+++ b/WebCore/rendering/RenderPath.h
@@ -70,6 +70,7 @@ private:
private:
virtual AffineTransform localTransform() const { return m_localTransform; }
+ void fillAndStrokePath(GraphicsContext*);
bool m_needsBoundariesUpdate : 1;
bool m_needsPathUpdate : 1;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list