lottie/raster: remove Const qualifier from VPath parameters 75/185775/1
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 2 Aug 2018 07:59:59 +0000 (16:59 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Thu, 2 Aug 2018 07:59:59 +0000 (16:59 +0900)
The given VPath should be moved by std::move.
The std:move only work as our purpose when it is non-const variable.
And it also fix a crash issue when its path is not changed, but its other properties are changed.

Change-Id: I4135066f99c0eed07e033c368dc4b60e6703ca37

src/lottie/lottieitem.cpp
src/vector/vraster.cpp
src/vector/vraster.h

index 392c112..1696957 100644 (file)
@@ -702,10 +702,11 @@ void LOTPathDataItem::update(int frameNo, const VMatrix &parentMatrix,
         i.drawable->mFlag = VDrawable::DirtyState::None;
         i.paintNodeRef->updateRenderNode(i.pathNodeRef, i.drawable,
                                          i.sameGroup);
-        if (mPathChanged) {
-            i.drawable->mPath = mFinalPath;
+        if (mPathChanged)
             i.drawable->mFlag |= VDrawable::DirtyState::Path;
-        }
+
+        if (i.drawable->mFlag & VDrawable::DirtyState::Path)
+            i.drawable->mPath = mFinalPath;
     }
 }
 
index b327d55..ec71120 100644 (file)
@@ -356,7 +356,7 @@ public:
         return receiver;
     }
 
-    std::future<VRle> strokeRle(const VPath &&path, VRle &&rle, CapStyle cap, JoinStyle join,
+    std::future<VRle> strokeRle(VPath &&path, VRle &&rle, CapStyle cap, JoinStyle join,
                                 float width, float meterLimit)
     {
         RleTask *task = new RleTask();
@@ -370,7 +370,7 @@ public:
         return async(task);
     }
 
-    std::future<VRle> fillRle(const VPath &&path, VRle &&rle, FillRule fillRule)
+    std::future<VRle> fillRle(VPath &&path, VRle &&rle, FillRule fillRule)
     {
         RleTask *task = new RleTask();
         task->path = std::move(path);
@@ -387,7 +387,7 @@ VRaster::VRaster() {}
 
 VRaster::~VRaster() {}
 
-std::future<VRle> VRaster::generateFillInfo(const VPath &&path, VRle &&rle,
+std::future<VRle> VRaster::generateFillInfo(VPath &&path, VRle &&rle,
                                             FillRule     fillRule)
 {
     if (path.isEmpty()) {
@@ -398,7 +398,7 @@ std::future<VRle> VRaster::generateFillInfo(const VPath &&path, VRle &&rle,
     return raster_scheduler.fillRle(std::move(path), std::move(rle), fillRule);
 }
 
-std::future<VRle> VRaster::generateStrokeInfo(const VPath &&path, VRle &&rle, CapStyle cap,
+std::future<VRle> VRaster::generateStrokeInfo(VPath &&path, VRle &&rle, CapStyle cap,
                                               JoinStyle join, float width,
                                               float meterLimit)
 {
index c41a4ae..5b5b1aa 100644 (file)
@@ -22,9 +22,9 @@ public:
     VRaster &operator=(VRaster const &) = delete;
     VRaster &operator=(VRaster &&) = delete;
 
-    std::future<VRle> generateFillInfo(const VPath &&path, VRle &&rle,
+    std::future<VRle> generateFillInfo(VPath &&path, VRle &&rle,
                                        FillRule fillRule = FillRule::Winding);
-    std::future<VRle> generateStrokeInfo(const VPath &&path, VRle &&rle, CapStyle cap,
+    std::future<VRle> generateStrokeInfo(VPath &&path, VRle &&rle, CapStyle cap,
                                          JoinStyle join, float width,
                                          float meterLimit);