From 318151a35d10b3d022736ffdb02e116a055a7b08 Mon Sep 17 00:00:00 2001 From: Youngbok Shin Date: Tue, 21 Aug 2018 18:56:06 +0900 Subject: [PATCH] lottie: remove the combined alpha value and method from path item Alpha(opacity) values are not applied to path items. Fill, Stroke and etc will handle opacity. Change-Id: I8e05989e7f85797a00508c7ca151b1805d44f454 --- src/lottie/lottieitem.cpp | 14 ++++---------- src/lottie/lottieitem.h | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 77f8544..1960242 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -648,12 +648,11 @@ void LOTPathDataItem::addTrimOperation(std::vector &list) } void LOTPathDataItem::update(int frameNo, const VMatrix &parentMatrix, - float parentAlpha, const DirtyFlag &flag) + float, const DirtyFlag &flag) { VPath tempPath; mPathChanged = false; - mCombinedAlpha = parentAlpha; // 1. update the local path if needed if (!(mInit && mStaticPath) && hasChanged(frameNo)) { @@ -825,10 +824,8 @@ void LOTFillItem::updateRenderNode(LOTPathDataItem *pathNode, VDrawable *drawable, bool sameParent) { VColor color = mColor; - if (sameParent) - color.setAlpha(color.a * pathNode->combinedAlpha()); - else - color.setAlpha(color.a * parentAlpha() * pathNode->combinedAlpha()); + + color.setAlpha(color.a * parentAlpha()); VBrush brush(color); drawable->setBrush(brush); drawable->setFillRule(mFillRule); @@ -889,11 +886,8 @@ void LOTStrokeItem::updateRenderNode(LOTPathDataItem *pathNode, VDrawable *drawable, bool sameParent) { VColor color = mColor; - if (sameParent) - color.setAlpha(color.a * pathNode->combinedAlpha()); - else - color.setAlpha(color.a * parentAlpha() * pathNode->combinedAlpha()); + color.setAlpha(color.a * parentAlpha()); VBrush brush(color); drawable->setBrush(brush); float scale = getScale(mParentMatrix); diff --git a/src/lottie/lottieitem.h b/src/lottie/lottieitem.h index 5271cdd..90630a8 100644 --- a/src/lottie/lottieitem.h +++ b/src/lottie/lottieitem.h @@ -208,7 +208,6 @@ public: void update(int frameNo, const VMatrix &parentMatrix, float parentAlpha, const DirtyFlag &flag) final; VPath path() const; void addTrimOperation(std::vector &list); - inline float combinedAlpha() const{ return mCombinedAlpha;} void renderList(std::vector &list) final; private: std::vector mTrimNodeRefs; @@ -219,7 +218,6 @@ private: VPath mLocalPath; VPath mFinalPath; bool mPathChanged; - float mCombinedAlpha; protected: virtual void updatePath(VPath& path, int frameNo) = 0; virtual bool hasChanged(int frameNo) = 0; -- 2.7.4