Changeset 65889 in webkit
- Timestamp:
- Aug 24, 2010 4:22:12 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65885 r65889 1 2010-08-24 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Markers don't render, when applied to a target using vector-effect="non-scaling-stroke" 6 https://bugs.webkit.org/show_bug.cgi?id=44511 7 8 Add new test verifying that markers can be appplied to objects using vector-effect="non-scaling-stroke". 9 10 * platform/mac/svg/custom/non-scaling-stroke-markers-expected.checksum: Added. 11 * platform/mac/svg/custom/non-scaling-stroke-markers-expected.png: Added. 12 * platform/mac/svg/custom/non-scaling-stroke-markers-expected.txt: Added. 13 * svg/custom/non-scaling-stroke-markers.svg: Added. 14 1 15 2010-08-24 Andreas Kling <andreas.kling@nokia.com> 2 16 -
trunk/WebCore/ChangeLog
r65888 r65889 1 2010-08-24 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Reviewed by Dirk Schulze. 4 5 Markers don't render, when applied to a target using vector-effect="non-scaling-stroke" 6 https://bugs.webkit.org/show_bug.cgi?id=44511 7 8 Make fillAndStrokePath a member function of RenderPath, to avoid having to pass the const Path& and this paramters. 9 Don't leave the GraphicsContext mutated after applying non-scaling-stroke transformation, otherwhise markers will be renderer 10 in the wrong coordinate space, and thus don't show up anymore. 11 12 Test: svg/custom/non-scaling-stroke-markers.svg 13 14 * rendering/RenderPath.cpp: 15 (WebCore::RenderPath::fillAndStrokePath): 16 (WebCore::RenderPath::paint): 17 * rendering/RenderPath.h: 18 1 19 2010-08-24 Adam Barth <abarth@webkit.org> 2 20 -
trunk/WebCore/rendering/RenderPath.cpp
r65681 r65889 128 128 } 129 129 130 static inline void fillAndStrokePath(const Path& path, GraphicsContext* context, RenderPath* object)130 void RenderPath::fillAndStrokePath(GraphicsContext* context) 131 131 { 132 132 context->beginPath(); 133 RenderStyle* style = object->style(); 134 135 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(object, style)) { 136 context->addPath(path); 137 if (fillPaintingResource->applyResource(object, style, context, ApplyToFillMode)) 138 fillPaintingResource->postApplyResource(object, context, ApplyToFillMode); 139 } 140 141 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(object, style)) { 142 if (style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE) { 143 SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node()); 144 AffineTransform transform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate); 145 if (!transform.isInvertible()) 146 return; 147 148 Path transformedPath = path; 149 context->concatCTM(transform.inverse()); 150 transformedPath.transform(transform); 151 context->addPath(transformedPath); 152 } else 153 context->addPath(path); 154 if (strokePaintingResource->applyResource(object, style, context, ApplyToStrokeMode)) 155 strokePaintingResource->postApplyResource(object, context, ApplyToStrokeMode); 156 } 133 RenderStyle* style = this->style(); 134 135 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style)) { 136 context->addPath(m_path); 137 if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode)) 138 fillPaintingResource->postApplyResource(this, context, ApplyToFillMode); 139 } 140 141 RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(this, style); 142 if (!strokePaintingResource) 143 return; 144 145 bool restoreContext = false; 146 if (style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE) { 147 SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node()); 148 AffineTransform nonScalingStrokeTransform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate); 149 if (!nonScalingStrokeTransform.isInvertible()) 150 return; 151 152 Path transformedPath = m_path; 153 transformedPath.transform(nonScalingStrokeTransform); 154 155 context->save(); 156 context->concatCTM(nonScalingStrokeTransform.inverse()); 157 context->addPath(transformedPath); 158 restoreContext = true; 159 } else 160 context->addPath(m_path); 161 162 if (strokePaintingResource->applyResource(this, style, context, ApplyToStrokeMode)) 163 strokePaintingResource->postApplyResource(this, context, ApplyToStrokeMode); 164 165 if (restoreContext) 166 context->restore(); 157 167 } 158 168 … … 181 191 childPaintInfo.context->setShouldAntialias(false); 182 192 183 fillAndStrokePath( m_path, childPaintInfo.context, this);193 fillAndStrokePath(childPaintInfo.context); 184 194 185 195 if (svgStyle->hasMarkers()) -
trunk/WebCore/rendering/RenderPath.h
r64275 r65889 71 71 private: 72 72 virtual AffineTransform localTransform() const { return m_localTransform; } 73 void fillAndStrokePath(GraphicsContext*); 73 74 74 75 bool m_needsBoundariesUpdate : 1;
Note: See TracChangeset
for help on using the changeset viewer.