| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
| 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
| 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> | 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> |
| 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
| 10 * Copyright (C) 2011 University of Szeged | 10 * Copyright (C) 2011 University of Szeged |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 bool RenderSVGShape::shapeDependentFillContains(const FloatPoint& point, const W
indRule fillRule) const | 111 bool RenderSVGShape::shapeDependentFillContains(const FloatPoint& point, const W
indRule fillRule) const |
| 112 { | 112 { |
| 113 return path().contains(point, fillRule); | 113 return path().contains(point, fillRule); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool RenderSVGShape::fillContains(const FloatPoint& point, bool requiresFill, co
nst WindRule fillRule) | 116 bool RenderSVGShape::fillContains(const FloatPoint& point, bool requiresFill, co
nst WindRule fillRule) |
| 117 { | 117 { |
| 118 if (!m_fillBoundingBox.contains(point)) | 118 if (!m_fillBoundingBox.contains(point)) |
| 119 return false; | 119 return false; |
| 120 | 120 |
| 121 StyleColor fallbackColor; | 121 Color fallbackColor; |
| 122 if (requiresFill && !RenderSVGResource::fillPaintingResource(this, style(),
fallbackColor)) | 122 if (requiresFill && !RenderSVGResource::fillPaintingResource(this, style(),
fallbackColor)) |
| 123 return false; | 123 return false; |
| 124 | 124 |
| 125 return shapeDependentFillContains(point, fillRule); | 125 return shapeDependentFillContains(point, fillRule); |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke
) | 128 bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke
) |
| 129 { | 129 { |
| 130 if (!strokeBoundingBox().contains(point)) | 130 if (!strokeBoundingBox().contains(point)) |
| 131 return false; | 131 return false; |
| 132 | 132 |
| 133 StyleColor fallbackColor; | 133 Color fallbackColor; |
| 134 if (requiresStroke && !RenderSVGResource::strokePaintingResource(this, style
(), fallbackColor)) | 134 if (requiresStroke && !RenderSVGResource::strokePaintingResource(this, style
(), fallbackColor)) |
| 135 return false; | 135 return false; |
| 136 | 136 |
| 137 return shapeDependentStrokeContains(point); | 137 return shapeDependentStrokeContains(point); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void RenderSVGShape::layout() | 140 void RenderSVGShape::layout() |
| 141 { | 141 { |
| 142 LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringL
ayout(this) && selfNeedsLayout()); | 142 LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringL
ayout(this) && selfNeedsLayout()); |
| 143 SVGGraphicsElement* element = toSVGGraphicsElement(node()); | 143 SVGGraphicsElement* element = toSVGGraphicsElement(node()); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 207 |
| 208 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
this); | 208 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
this); |
| 209 if (!resources) | 209 if (!resources) |
| 210 return false; | 210 return false; |
| 211 | 211 |
| 212 return resources->markerStart() || resources->markerMid() || resources->mark
erEnd(); | 212 return resources->markerStart() || resources->markerMid() || resources->mark
erEnd(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context) | 215 void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context) |
| 216 { | 216 { |
| 217 StyleColor fallbackColor; | 217 Color fallbackColor; |
| 218 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintin
gResource(this, style, fallbackColor)) { | 218 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintin
gResource(this, style, fallbackColor)) { |
| 219 if (fillPaintingResource->applyResource(this, style, context, ApplyToFil
lMode)) | 219 if (fillPaintingResource->applyResource(this, style, context, ApplyToFil
lMode)) |
| 220 fillPaintingResource->postApplyResource(this, context, ApplyToFillMo
de, 0, this); | 220 fillPaintingResource->postApplyResource(this, context, ApplyToFillMo
de, 0, this); |
| 221 else if (fallbackColor.isValid()) { | 221 else if (fallbackColor.isValid()) { |
| 222 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); | 222 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); |
| 223 fallbackResource->setColor(fallbackColor.color()); | 223 fallbackResource->setColor(fallbackColor); |
| 224 if (fallbackResource->applyResource(this, style, context, ApplyToFil
lMode)) | 224 if (fallbackResource->applyResource(this, style, context, ApplyToFil
lMode)) |
| 225 fallbackResource->postApplyResource(this, context, ApplyToFillMo
de, 0, this); | 225 fallbackResource->postApplyResource(this, context, ApplyToFillMo
de, 0, this); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context) | 230 void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context) |
| 231 { | 231 { |
| 232 StyleColor fallbackColor; | 232 Color fallbackColor; |
| 233 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePai
ntingResource(this, style, fallbackColor)) { | 233 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePai
ntingResource(this, style, fallbackColor)) { |
| 234 if (strokePaintingResource->applyResource(this, style, context, ApplyToS
trokeMode)) | 234 if (strokePaintingResource->applyResource(this, style, context, ApplyToS
trokeMode)) |
| 235 strokePaintingResource->postApplyResource(this, context, ApplyToStro
keMode, 0, this); | 235 strokePaintingResource->postApplyResource(this, context, ApplyToStro
keMode, 0, this); |
| 236 else if (fallbackColor.isValid()) { | 236 else if (fallbackColor.isValid()) { |
| 237 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); | 237 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); |
| 238 fallbackResource->setColor(fallbackColor.color()); | 238 fallbackResource->setColor(fallbackColor); |
| 239 if (fallbackResource->applyResource(this, style, context, ApplyToStr
okeMode)) | 239 if (fallbackResource->applyResource(this, style, context, ApplyToStr
okeMode)) |
| 240 fallbackResource->postApplyResource(this, context, ApplyToStroke
Mode, 0, this); | 240 fallbackResource->postApplyResource(this, context, ApplyToStroke
Mode, 0, this); |
| 241 } | 241 } |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 | 244 |
| 245 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) | 245 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) |
| 246 { | 246 { |
| 247 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); | 247 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); |
| 248 | 248 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 return; | 458 return; |
| 459 | 459 |
| 460 ASSERT(m_path); | 460 ASSERT(m_path); |
| 461 | 461 |
| 462 SVGMarkerData markerData(m_markerPositions); | 462 SVGMarkerData markerData(m_markerPositions); |
| 463 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); | 463 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); |
| 464 markerData.pathIsDone(); | 464 markerData.pathIsDone(); |
| 465 } | 465 } |
| 466 | 466 |
| 467 } | 467 } |
| OLD | NEW |