From: subhransu mohanty Date: Mon, 20 Aug 2018 07:12:17 +0000 (+0900) Subject: lottie/render: handle the case when resulting mask is null. X-Git-Tag: submit/tizen/20180917.042405~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F187137%2F3;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/render: handle the case when resulting mask is null. Change-Id: Ie78a1465474ec408bff0deafdff509f3b3a199d8 --- diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 39d95bf..7b34854 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -170,18 +170,25 @@ void LOTLayerItem::render(VPainter *painter, const VRle &inheritMask, LOTLayerIt } mDrawableList.clear(); renderList(mDrawableList); - VRle mask = inheritMask; + + VRle mask; if (hasMask()) { - if (mask.isEmpty()) - mask = maskRle(painter->clipBoundingRect()); - else + mask = maskRle(painter->clipBoundingRect()); + if (!inheritMask.isEmpty()) mask = mask & inheritMask; + // if resulting mask is empty then return. + if (mask.isEmpty()) + return; + } else { + mask = inheritMask; } for (auto &i : mDrawableList) { painter->setBrush(i->mBrush); VRle rle = i->rle(); - if (!mask.isEmpty()) rle = i->rle() & mask; + if (!mask.isEmpty()) rle = rle & mask; + + if (rle.isEmpty()) continue; if (!matteRle.isEmpty()) { if (mLayerData->mMatteType == MatteType::AlphaInv) { @@ -348,13 +355,16 @@ void LOTCompLayerItem::render(VPainter *painter, const VRle &inheritMask, LOTLay } } - VRle mask = inheritMask; - + VRle mask; if (hasMask()) { - if (mask.isEmpty()) - mask = maskRle(painter->clipBoundingRect()); - else + mask = maskRle(painter->clipBoundingRect()); + if (!inheritMask.isEmpty()) mask = mask & inheritMask; + // if resulting mask is empty then return. + if (mask.isEmpty()) + return; + } else { + mask = inheritMask; } LOTLayerItem *matteLayer = nullptr;