From: subhransu mohanty Date: Thu, 26 Jul 2018 02:11:28 +0000 (+0900) Subject: lottie/vector: update reserve() api in vpath X-Git-Tag: submit/tizen/20180917.042405~190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6658ae623dca40e3b5939168bf157ff3c8d88ef;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/vector: update reserve() api in vpath Change-Id: Ib43afa96a0c1a7764dd410ea1e7f01019f592d6d --- diff --git a/src/vector/vpath.cpp b/src/vector/vpath.cpp index 639f2d0..cfe64ee 100644 --- a/src/vector/vpath.cpp +++ b/src/vector/vpath.cpp @@ -83,10 +83,10 @@ int VPath::VPathData::segments() const return m_segments + 1; } -void VPath::VPathData::reserve(int num_elm) +void VPath::VPathData::reserve(int pts, int elms) { - m_elements.reserve(num_elm); - m_points.reserve(2 * num_elm); + m_points.reserve(m_points.size() + pts); + m_elements.reserve(m_elements.size() + elms); } static VPointF curvesForArc(const VRectF &, float, float, VPointF *, int *); diff --git a/src/vector/vpath.h b/src/vector/vpath.h index 5b15a94..14a29bd 100644 --- a/src/vector/vpath.h +++ b/src/vector/vpath.h @@ -33,7 +33,7 @@ public: void arcTo(const VRectF &rect, float startAngle, float sweepLength, bool forceMoveTo); void close(); void reset(); - void reserve(int num_elm); + void reserve(int pts, int elms); int segments() const; void addCircle(float cx, float cy, float radius, VPath::Direction dir = Direction::CW); void addOval(const VRectF &rect, VPath::Direction dir = Direction::CW); @@ -57,7 +57,7 @@ private: void cubicTo(const VPointF &c1, const VPointF &c2, const VPointF &e); void close(); void reset(); - void reserve(int num_elm); + void reserve(int, int); void checkNewSegment(); int segments() const; void transform(const VMatrix &m); @@ -108,9 +108,9 @@ inline void VPath::reset() d.write().reset(); } -inline void VPath::reserve(int num_elm) +inline void VPath::reserve(int pts, int elms) { - d.write().reserve(num_elm); + d.write().reserve(pts, elms); } inline int VPath::segments() const