From e8cb8100e656e5ac851d38ee8ccd95d40a6e7937 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Thu, 2 Aug 2018 16:59:59 +0900 Subject: [PATCH] lottie/raster: remove Const qualifier from VPath parameters 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 | 7 ++++--- src/vector/vraster.cpp | 8 ++++---- src/vector/vraster.h | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 392c112..1696957 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -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; } } diff --git a/src/vector/vraster.cpp b/src/vector/vraster.cpp index b327d55..ec71120 100644 --- a/src/vector/vraster.cpp +++ b/src/vector/vraster.cpp @@ -356,7 +356,7 @@ public: return receiver; } - std::future strokeRle(const VPath &&path, VRle &&rle, CapStyle cap, JoinStyle join, + std::future 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 fillRle(const VPath &&path, VRle &&rle, FillRule fillRule) + std::future 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 VRaster::generateFillInfo(const VPath &&path, VRle &&rle, +std::future VRaster::generateFillInfo(VPath &&path, VRle &&rle, FillRule fillRule) { if (path.isEmpty()) { @@ -398,7 +398,7 @@ std::future VRaster::generateFillInfo(const VPath &&path, VRle &&rle, return raster_scheduler.fillRle(std::move(path), std::move(rle), fillRule); } -std::future VRaster::generateStrokeInfo(const VPath &&path, VRle &&rle, CapStyle cap, +std::future VRaster::generateStrokeInfo(VPath &&path, VRle &&rle, CapStyle cap, JoinStyle join, float width, float meterLimit) { diff --git a/src/vector/vraster.h b/src/vector/vraster.h index c41a4ae..5b5b1aa 100644 --- a/src/vector/vraster.h +++ b/src/vector/vraster.h @@ -22,9 +22,9 @@ public: VRaster &operator=(VRaster const &) = delete; VRaster &operator=(VRaster &&) = delete; - std::future generateFillInfo(const VPath &&path, VRle &&rle, + std::future generateFillInfo(VPath &&path, VRle &&rle, FillRule fillRule = FillRule::Winding); - std::future generateStrokeInfo(const VPath &&path, VRle &&rle, CapStyle cap, + std::future generateStrokeInfo(VPath &&path, VRle &&rle, CapStyle cap, JoinStyle join, float width, float meterLimit); -- 2.34.1