| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2002, 2003 The Karbon Developers | 2 * Copyright (C) 2002, 2003 The Karbon Developers |
| 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
| 4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> |
| 5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
| 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "core/svg/SVGPathData.h" | 26 #include "core/svg/SVGPathData.h" |
| 27 #include "platform/graphics/Path.h" | 27 #include "platform/graphics/Path.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 void SVGPathBuilder::emitSegment(const PathSegmentData& segment) | 31 void SVGPathBuilder::emitSegment(const PathSegmentData& segment) |
| 32 { | 32 { |
| 33 switch (segment.command) { | 33 switch (segment.command) { |
| 34 case PathSegMoveToAbs: | 34 case PathSegMoveToAbs: |
| 35 if (m_closed && !m_path.isEmpty()) | |
| 36 m_path.closeSubpath(); | |
| 37 m_path.moveTo(segment.targetPoint); | 35 m_path.moveTo(segment.targetPoint); |
| 38 m_closed = false; | |
| 39 break; | 36 break; |
| 40 case PathSegLineToAbs: | 37 case PathSegLineToAbs: |
| 41 m_path.addLineTo(segment.targetPoint); | 38 m_path.addLineTo(segment.targetPoint); |
| 42 break; | 39 break; |
| 43 case PathSegClosePath: | 40 case PathSegClosePath: |
| 44 m_path.closeSubpath(); | 41 m_path.closeSubpath(); |
| 45 m_closed = true; | |
| 46 break; | 42 break; |
| 47 case PathSegCurveToCubicAbs: | 43 case PathSegCurveToCubicAbs: |
| 48 m_path.addBezierCurveTo(segment.point1, segment.point2, segment.targetPo
int); | 44 m_path.addBezierCurveTo(segment.point1, segment.point2, segment.targetPo
int); |
| 49 break; | 45 break; |
| 50 default: | 46 default: |
| 51 ASSERT_NOT_REACHED(); | 47 ASSERT_NOT_REACHED(); |
| 52 } | 48 } |
| 53 } | 49 } |
| 54 | 50 |
| 55 } | 51 } |
| OLD | NEW |