rlottie: reenabled optimization when paint item has no content accepted/tizen/unified/20191206.121256 submit/tizen/20191201.211113 submit/tizen/20191202.210542 submit/tizen/20191203.210336 submit/tizen/20191204.213652 submit/tizen/20191205.205324
authorsubhransu mohanty <sub.mohanty@samsung.com>
Fri, 29 Nov 2019 08:10:19 +0000 (17:10 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 1 Dec 2019 21:00:58 +0000 (06:00 +0900)
src/lottie/lottieitem.cpp

index 292d26c..ee0743e 100644 (file)
@@ -1175,16 +1175,20 @@ void LOTPaintDataItem::updateRenderNode()
 
 void LOTPaintDataItem::renderList(std::vector<VDrawable *> &list)
 {
-    //@TODO This optimization breaks when the layer
-    // is used as Matte. Find out the reason for this
-    // regression then reenable it.
-    //if (!mContentToRender) return;
-
     if (mRenderNodeUpdate) {
         updateRenderNode();
         mRenderNodeUpdate = false;
     }
-    list.push_back(&mDrawable);
+
+    // Q: Why we even update the final path if we don't have content
+    // to render ?
+    // Ans: We update the render nodes because we will loose the
+    // dirty path information at end of this frame.
+    // so if we return early without updating the final path.
+    // in the subsequent frame when we have content to render but
+    // we may not able to update our final path properly as we
+    // don't know what paths got changed in between.
+    if (mContentToRender) list.push_back(&mDrawable);
 }
 
 void LOTPaintDataItem::addPathItems(std::vector<LOTPathDataItem *> &list,