From: subhransu mohanty Date: Mon, 16 Jul 2018 06:53:54 +0000 (+0900) Subject: lottie/optimization: update the layer item only when it has change. X-Git-Tag: submit/tizen/20180917.042405~248 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0c5621b53d0198f5abb07c6ddb7b506662666f5;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/optimization: update the layer item only when it has change. Change-Id: If62c796f18ebea949fe598f0f5890f09bd8a42b8 --- diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 62e46c6..cd30aa8 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -448,24 +448,18 @@ void LOTLayerItem::update(int frameNo, const VMatrix &parentMatrix, float parent } // 3. update the dirty flag based on the change - if (flag() & DirtyFlagBit::All) { - mCombinedMatrix = m; - mCombinedAlpha = alpha; - } else { - if (!mCombinedMatrix.fuzzyCompare(m)) { - mDirtyFlag |= DirtyFlagBit::Matrix; - mCombinedMatrix = m; - } - if (!vCompare(mCombinedAlpha, alpha)) { - mDirtyFlag |= DirtyFlagBit::Alpha; - mCombinedAlpha = alpha; - } + if (!mCombinedMatrix.fuzzyCompare(m)) { + mDirtyFlag |= DirtyFlagBit::Matrix; + } + if (!vCompare(mCombinedAlpha, alpha)) { + mDirtyFlag |= DirtyFlagBit::Alpha; } + mCombinedMatrix = m; + mCombinedAlpha = alpha; // 4. if no parent property change and layer is static then nothing to do. - //@TODO fix this regression -// if ((flag() & DirtyFlagBit::None) && isStatic()) -// return; + if ((flag() & DirtyFlagBit::None) && isStatic()) + return; //5. update the content of the layer updateContent();