lottieitem : Fix layer alpha transparency issue.
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 11 Jun 2019 08:25:16 +0000 (17:25 +0900)
committerHermet Park <hermetpark@gmail.com>
Wed, 19 Jun 2019 04:35:52 +0000 (13:35 +0900)
When a layer has transparency, we need to send it to layer node.
So I add mAlpha member to the LOTLayerItem.

inc/rlottiecommon.h
src/lottie/lottieitem.cpp

index 5d81159..4391d7b 100644 (file)
@@ -225,6 +225,7 @@ typedef struct LOTLayerNode {
 
     LOTMatteType mMatte;
     int          mVisible;
+    int          mAlpha;
 
 } LOTLayerNode;
 
index 2e2d6b1..d549fbd 100644 (file)
@@ -244,11 +244,14 @@ void LOTLayerItem::buildLayerNode()
         mLayerCNode->mNodeList.size = 0;
         mLayerCNode->mMatte = MatteNone;
         mLayerCNode->mVisible = 0;
+        mLayerCNode->mAlpha = 255;
         mLayerCNode->mClipPath.ptPtr = nullptr;
         mLayerCNode->mClipPath.elmPtr = nullptr;
         mLayerCNode->mClipPath.ptCount = 0;
         mLayerCNode->mClipPath.elmCount = 0;
     }
+    if (complexContent())
+       mLayerCNode->mAlpha = combinedAlpha() * 255;
     mLayerCNode->mVisible = visible();
     // update matte
     if (hasMatte()) {