lottie: remove the combined alpha value and method from path item 67/187267/3
authorYoungbok Shin <youngb.shin@samsung.com>
Tue, 21 Aug 2018 09:56:06 +0000 (18:56 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Thu, 23 Aug 2018 00:27:37 +0000 (00:27 +0000)
Alpha(opacity) values are not applied to path items.
Fill, Stroke and etc will handle opacity.

Change-Id: I8e05989e7f85797a00508c7ca151b1805d44f454

src/lottie/lottieitem.cpp
src/lottie/lottieitem.h

index 77f8544..1960242 100644 (file)
@@ -648,12 +648,11 @@ void LOTPathDataItem::addTrimOperation(std::vector<LOTTrimItem *> &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);
index 5271cdd..90630a8 100644 (file)
@@ -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<LOTTrimItem *> &list);
-   inline float combinedAlpha() const{ return mCombinedAlpha;}
    void renderList(std::vector<VDrawable *> &list) final;
 private:
    std::vector<LOTTrimItem *>              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;