summaryrefslogtreecommitdiff
path: root/Source/WebCore/svg/SVGPathByteStreamBuilder.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebCore/svg/SVGPathByteStreamBuilder.cpp
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/svg/SVGPathByteStreamBuilder.cpp')
-rw-r--r--Source/WebCore/svg/SVGPathByteStreamBuilder.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/Source/WebCore/svg/SVGPathByteStreamBuilder.cpp b/Source/WebCore/svg/SVGPathByteStreamBuilder.cpp
index cf939f074..d195c2875 100644
--- a/Source/WebCore/svg/SVGPathByteStreamBuilder.cpp
+++ b/Source/WebCore/svg/SVGPathByteStreamBuilder.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -18,53 +19,44 @@
*/
#include "config.h"
-
-#if ENABLE(SVG)
#include "SVGPathByteStreamBuilder.h"
-#include "SVGPathParser.h"
#include "SVGPathSeg.h"
#include "SVGPathStringSource.h"
-#include <wtf/OwnPtr.h>
namespace WebCore {
-SVGPathByteStreamBuilder::SVGPathByteStreamBuilder()
- : m_byteStream(0)
+SVGPathByteStreamBuilder::SVGPathByteStreamBuilder(SVGPathByteStream& byteStream)
+ : m_byteStream(byteStream)
{
}
void SVGPathByteStreamBuilder::moveTo(const FloatPoint& targetPoint, bool, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegMoveToRel : PathSegMoveToAbs);
writeFloatPoint(targetPoint);
}
void SVGPathByteStreamBuilder::lineTo(const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegLineToRel : PathSegLineToAbs);
writeFloatPoint(targetPoint);
}
void SVGPathByteStreamBuilder::lineToHorizontal(float x, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegLineToHorizontalRel : PathSegLineToHorizontalAbs);
writeFloat(x);
}
void SVGPathByteStreamBuilder::lineToVertical(float y, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegLineToVerticalRel : PathSegLineToVerticalAbs);
writeFloat(y);
}
void SVGPathByteStreamBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegCurveToCubicRel : PathSegCurveToCubicAbs);
writeFloatPoint(point1);
writeFloatPoint(point2);
@@ -73,7 +65,6 @@ void SVGPathByteStreamBuilder::curveToCubic(const FloatPoint& point1, const Floa
void SVGPathByteStreamBuilder::curveToCubicSmooth(const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegCurveToCubicSmoothRel : PathSegCurveToCubicSmoothAbs);
writeFloatPoint(point2);
writeFloatPoint(targetPoint);
@@ -81,7 +72,6 @@ void SVGPathByteStreamBuilder::curveToCubicSmooth(const FloatPoint& point2, cons
void SVGPathByteStreamBuilder::curveToQuadratic(const FloatPoint& point1, const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegCurveToQuadraticRel : PathSegCurveToQuadraticAbs);
writeFloatPoint(point1);
writeFloatPoint(targetPoint);
@@ -89,14 +79,12 @@ void SVGPathByteStreamBuilder::curveToQuadratic(const FloatPoint& point1, const
void SVGPathByteStreamBuilder::curveToQuadraticSmooth(const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegCurveToQuadraticSmoothRel : PathSegCurveToQuadraticSmoothAbs);
writeFloatPoint(targetPoint);
}
void SVGPathByteStreamBuilder::arcTo(float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, const FloatPoint& targetPoint, PathCoordinateMode mode)
{
- ASSERT(m_byteStream);
writeSegmentType(mode == RelativeCoordinates ? PathSegArcRel : PathSegArcAbs);
writeFloat(r1);
writeFloat(r2);
@@ -108,10 +96,7 @@ void SVGPathByteStreamBuilder::arcTo(float r1, float r2, float angle, bool large
void SVGPathByteStreamBuilder::closePath()
{
- ASSERT(m_byteStream);
writeSegmentType(PathSegClosePath);
}
} // namespace WebCore
-
-#endif // ENABLE(SVG)