lottie/render: hide the layer when matte layer is hidden. 31/188231/2
authorsubhransu mohanty <sub.mohanty@samsung.com>
Mon, 3 Sep 2018 07:39:34 +0000 (16:39 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Mon, 3 Sep 2018 07:47:59 +0000 (07:47 +0000)
in AE matte layers visibility affects the layer below.

Change-Id: I0d1c6e19f78bc3d25ac6ae8a56ec5371a925e300

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

index 03336f2..951f64b 100644 (file)
@@ -159,8 +159,6 @@ VRle LOTMaskItem::rle()
 
 void LOTLayerItem::render(VPainter *painter, const VRle &inheritMask, const VRle &inheritMatte, LOTLayerItem *matteSource)
 {
-    if (!visible()) return;
-
     VRle matteRle;
     if (matteSource) {
         mDrawableList.clear();
@@ -350,8 +348,6 @@ void LOTCompLayerItem::updateStaticProperty()
 
 void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask, const VRle &inheritMatte, LOTLayerItem *matteSource)
 {
-    if (!visible()) return;
-
     VRle matteRle;
     if (matteSource) {
         mDrawableList.clear();
@@ -388,10 +384,12 @@ void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask, const
         }
 
         if (matteLayer) {
-            matteLayer->render(painter, mask, matteRle, layer);
+            if (matteLayer->visible() && layer->visible())
+                matteLayer->render(painter, mask, matteRle, layer);
             matteLayer = nullptr;
         } else {
-            layer->render(painter, mask, matteRle, nullptr);
+            if (layer->visible())
+                layer->render(painter, mask, matteRle, nullptr);
         }
     }
 }
index 1396311..99db81e 100644 (file)
@@ -66,6 +66,7 @@ public:
    virtual void updateStaticProperty();
    virtual void render(VPainter *painter, const VRle &mask, const VRle &inheritMatte, LOTLayerItem *matteSource);
    bool hasMatte() { if (mLayerData->mMatteType == MatteType::None) return false; return true; }
+   bool visible() const;
 
 protected:
    virtual void updateContent() = 0;
@@ -74,7 +75,6 @@ protected:
    inline float combinedAlpha() const {return mCombinedAlpha;}
    inline bool isStatic() const {return mStatic;}
    float opacity(int frameNo) const;
-   bool visible() const;
    inline DirtyFlag flag() const {return mDirtyFlag;}
    VRle maskRle(const VRect &clipRect);
    bool hasMask() const {return !mMasks.empty();}