| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 { | 106 { |
| 107 return path().contains(point, fillRule); | 107 return path().contains(point, fillRule); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool RenderSVGShape::fillContains(const FloatPoint& point, bool requiresFill, co
nst WindRule fillRule) | 110 bool RenderSVGShape::fillContains(const FloatPoint& point, bool requiresFill, co
nst WindRule fillRule) |
| 111 { | 111 { |
| 112 if (!m_fillBoundingBox.contains(point)) | 112 if (!m_fillBoundingBox.contains(point)) |
| 113 return false; | 113 return false; |
| 114 | 114 |
| 115 bool hasFallback; | 115 bool hasFallback; |
| 116 if (requiresFill && !RenderSVGResource::fillPaintingResource(this, style(),
hasFallback)) | 116 if (requiresFill && !RenderSVGResource::requestPaintingResource(ApplyToFillM
ode, this, style(), hasFallback)) |
| 117 return false; | 117 return false; |
| 118 | 118 |
| 119 return shapeDependentFillContains(point, fillRule); | 119 return shapeDependentFillContains(point, fillRule); |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke
) | 122 bool RenderSVGShape::strokeContains(const FloatPoint& point, bool requiresStroke
) |
| 123 { | 123 { |
| 124 if (!strokeBoundingBox().contains(point)) | 124 if (!strokeBoundingBox().contains(point)) |
| 125 return false; | 125 return false; |
| 126 | 126 |
| 127 bool hasFallback; | 127 bool hasFallback; |
| 128 if (requiresStroke && !RenderSVGResource::strokePaintingResource(this, style
(), hasFallback)) | 128 if (requiresStroke && !RenderSVGResource::requestPaintingResource(ApplyToStr
okeMode, this, style(), hasFallback)) |
| 129 return false; | 129 return false; |
| 130 | 130 |
| 131 return shapeDependentStrokeContains(point); | 131 return shapeDependentStrokeContains(point); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void RenderSVGShape::layout() | 134 void RenderSVGShape::layout() |
| 135 { | 135 { |
| 136 bool updateCachedBoundariesInParents = false; | 136 bool updateCachedBoundariesInParents = false; |
| 137 | 137 |
| 138 if (m_needsShapeUpdate || m_needsBoundariesUpdate) { | 138 if (m_needsShapeUpdate || m_needsBoundariesUpdate) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
this); | 196 SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(
this); |
| 197 if (!resources) | 197 if (!resources) |
| 198 return false; | 198 return false; |
| 199 | 199 |
| 200 return resources->markerStart() || resources->markerMid() || resources->mark
erEnd(); | 200 return resources->markerStart() || resources->markerMid() || resources->mark
erEnd(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context) | 203 void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context) |
| 204 { | 204 { |
| 205 bool hasFallback; | 205 bool hasFallback; |
| 206 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintin
gResource(this, style, hasFallback)) { | 206 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::requestPain
tingResource(ApplyToFillMode, this, style, hasFallback)) { |
| 207 if (fillPaintingResource->applyResource(this, style, context, ApplyToFil
lMode)) { | 207 if (fillPaintingResource->applyResource(this, style, context, ApplyToFil
lMode)) { |
| 208 fillShape(context); | 208 fillShape(context); |
| 209 fillPaintingResource->postApplyResource(this, context); | 209 fillPaintingResource->postApplyResource(this, context); |
| 210 } else if (hasFallback) { | 210 } else if (hasFallback) { |
| 211 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); | 211 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); |
| 212 if (fallbackResource->applyResource(this, style, context, ApplyToFil
lMode)) { | 212 if (fallbackResource->applyResource(this, style, context, ApplyToFil
lMode)) { |
| 213 fillShape(context); | 213 fillShape(context); |
| 214 fallbackResource->postApplyResource(this, context); | 214 fallbackResource->postApplyResource(this, context); |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context) | 220 void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context) |
| 221 { | 221 { |
| 222 bool hasFallback; | 222 bool hasFallback; |
| 223 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePai
ntingResource(this, style, hasFallback)) { | 223 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::requestPa
intingResource(ApplyToStrokeMode, this, style, hasFallback)) { |
| 224 if (strokePaintingResource->applyResource(this, style, context, ApplyToS
trokeMode)) { | 224 if (strokePaintingResource->applyResource(this, style, context, ApplyToS
trokeMode)) { |
| 225 strokeShape(context); | 225 strokeShape(context); |
| 226 strokePaintingResource->postApplyResource(this, context); | 226 strokePaintingResource->postApplyResource(this, context); |
| 227 } else if (hasFallback) { | 227 } else if (hasFallback) { |
| 228 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); | 228 RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::s
haredSolidPaintingResource(); |
| 229 if (fallbackResource->applyResource(this, style, context, ApplyToStr
okeMode)) { | 229 if (fallbackResource->applyResource(this, style, context, ApplyToStr
okeMode)) { |
| 230 strokeShape(context); | 230 strokeShape(context); |
| 231 fallbackResource->postApplyResource(this, context); | 231 fallbackResource->postApplyResource(this, context); |
| 232 } | 232 } |
| 233 } | 233 } |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 ASSERT(resources); | 462 ASSERT(resources); |
| 463 | 463 |
| 464 RenderSVGResourceMarker* markerStart = resources->markerStart(); | 464 RenderSVGResourceMarker* markerStart = resources->markerStart(); |
| 465 | 465 |
| 466 SVGMarkerData markerData(m_markerPositions, markerStart ? markerStart->orien
tType() == SVGMarkerOrientAutoStartReverse : false); | 466 SVGMarkerData markerData(m_markerPositions, markerStart ? markerStart->orien
tType() == SVGMarkerOrientAutoStartReverse : false); |
| 467 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); | 467 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); |
| 468 markerData.pathIsDone(); | 468 markerData.pathIsDone(); |
| 469 } | 469 } |
| 470 | 470 |
| 471 } | 471 } |
| OLD | NEW |