projects
/
platform
/
core
/
uifw
/
lottie-player.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d5d456
)
lottie/optimization: added reserve() on lottieshapeData to optimize memory allocation
82/185082/1
author
subhransu mohanty
<sub.mohanty@samsung.com>
Thu, 26 Jul 2018 03:46:07 +0000
(12:46 +0900)
committer
subhransu mohanty
<sub.mohanty@samsung.com>
Thu, 26 Jul 2018 03:46:07 +0000
(12:46 +0900)
Change-Id: Ic41d90a4463b54c47d3f39fa72bb09d5ddbc47f0
src/lottie/lottiemodel.h
patch
|
blob
|
history
diff --git
a/src/lottie/lottiemodel.h
b/src/lottie/lottiemodel.h
index
9e37dc1
..
93bcf4b
100644
(file)
--- a/
src/lottie/lottiemodel.h
+++ b/
src/lottie/lottiemodel.h
@@
-103,6
+103,9
@@
inline const LottieColor operator*(float m, const LottieColor &c)
class LottieShapeData
{
public:
+ void reserve(int size) {
+ mPoints.reserve(mPoints.size() + size);
+ }
VPath toPath() const{
if (mPoints.empty()) return VPath();
@@
-221,6
+224,7
@@
public:
return LottieShapeData();
LottieShapeData result;
+ result.reserve(mStartValue.mPoints.size());
for (unsigned int i = 0 ; i < mStartValue.mPoints.size(); i++) {
result.mPoints.push_back(mStartValue.mPoints[i] + progress * (mEndValue.mPoints[i] - mStartValue.mPoints[i]));
}