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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 } | 56 } |
57 | 57 |
58 RenderSVGShape::~RenderSVGShape() | 58 RenderSVGShape::~RenderSVGShape() |
59 { | 59 { |
60 } | 60 } |
61 | 61 |
62 void RenderSVGShape::updateShapeFromElement() | 62 void RenderSVGShape::updateShapeFromElement() |
63 { | 63 { |
64 m_path.clear(); | 64 m_path.clear(); |
65 m_path = adoptPtr(new Path); | 65 m_path = adoptPtr(new Path); |
66 ASSERT(RenderSVGShape::isEmpty()); | 66 ASSERT(RenderSVGShape::isShapeEmpty()); |
67 | 67 |
68 updatePathFromGraphicsElement(toSVGGraphicsElement(element()), path()); | 68 updatePathFromGraphicsElement(toSVGGraphicsElement(element()), path()); |
69 processMarkerPositions(); | 69 processMarkerPositions(); |
70 | 70 |
71 m_fillBoundingBox = calculateObjectBoundingBox(); | 71 m_fillBoundingBox = calculateObjectBoundingBox(); |
72 m_strokeBoundingBox = calculateStrokeBoundingBox(); | 72 m_strokeBoundingBox = calculateStrokeBoundingBox(); |
73 } | 73 } |
74 | 74 |
75 bool RenderSVGShape::isEmpty() const | 75 bool RenderSVGShape::isShapeEmpty() const |
76 { | 76 { |
77 return path().isEmpty(); | 77 return path().isEmpty(); |
f(malita)
2014/03/01 14:48:26
Trivial - relocate to header?
pdr.
2014/03/01 20:48:46
Done.
| |
78 } | 78 } |
79 | 79 |
80 void RenderSVGShape::fillShape(GraphicsContext* context) const | 80 void RenderSVGShape::fillShape(GraphicsContext* context) const |
81 { | 81 { |
82 context->fillPath(path()); | 82 context->fillPath(path()); |
83 } | 83 } |
84 | 84 |
85 void RenderSVGShape::strokeShape(GraphicsContext* context) const | 85 void RenderSVGShape::strokeShape(GraphicsContext* context) const |
86 { | 86 { |
87 ASSERT(m_path); | 87 ASSERT(m_path); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 if (fallbackResource->applyResource(this, style, context, ApplyToStr okeMode)) | 236 if (fallbackResource->applyResource(this, style, context, ApplyToStr okeMode)) |
237 fallbackResource->postApplyResource(this, context, ApplyToStroke Mode, 0, this); | 237 fallbackResource->postApplyResource(this, context, ApplyToStroke Mode, 0, this); |
238 } | 238 } |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) | 242 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) |
243 { | 243 { |
244 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); | 244 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); |
245 | 245 |
246 if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || isEmpty()) | 246 if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || isShapeEmpty()) |
247 return; | 247 return; |
248 FloatRect boundingBox = repaintRectInLocalCoordinates(); | 248 FloatRect boundingBox = repaintRectInLocalCoordinates(); |
249 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr ansform, paintInfo)) | 249 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr ansform, paintInfo)) |
250 return; | 250 return; |
251 | 251 |
252 PaintInfo childPaintInfo(paintInfo); | 252 PaintInfo childPaintInfo(paintInfo); |
253 bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == Pain tPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); | 253 bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == Pain tPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); |
254 if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { | 254 if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { |
255 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); | 255 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); |
256 childPaintInfo.applyTransform(m_localTransform); | 256 childPaintInfo.applyTransform(m_localTransform); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 return; | 465 return; |
466 | 466 |
467 ASSERT(m_path); | 467 ASSERT(m_path); |
468 | 468 |
469 SVGMarkerData markerData(m_markerPositions); | 469 SVGMarkerData markerData(m_markerPositions); |
470 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); | 470 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); |
471 markerData.pathIsDone(); | 471 markerData.pathIsDone(); |
472 } | 472 } |
473 | 473 |
474 } | 474 } |
OLD | NEW |