From: subhransu mohanty Date: Mon, 19 Nov 2018 05:41:13 +0000 (+0900) Subject: lottie/performance: clip out path early during rle generation. X-Git-Tag: submit/tizen/20181129.071502~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bcfafd8a5b3c5e71adcdd83bb75e5d5cdb51890e;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/performance: clip out path early during rle generation. Change-Id: I0e7c8f9b8408a56e9fd197fe53c49b0a87517608 --- diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index ee29113..7c9bdc5 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -116,8 +116,9 @@ bool LOTCompItem::render(const lottie::Surface &surface) */ mDrawableList.clear(); mRootLayer->renderList(mDrawableList); + VRect clip(0, 0, surface.width(), surface.height()); for (auto &e : mDrawableList) { - e->preprocess(); + e->preprocess(clip); } VPainter painter(&bitmap); diff --git a/src/vector/vdrawable.cpp b/src/vector/vdrawable.cpp index eda7352..13b0a2d 100644 --- a/src/vector/vdrawable.cpp +++ b/src/vector/vdrawable.cpp @@ -2,7 +2,7 @@ #include "vdasher.h" #include "vraster.h" -void VDrawable::preprocess() +void VDrawable::preprocess(const VRect &clip) { if (mFlag & (DirtyState::Path)) { if (mStroke.enable) { @@ -12,10 +12,10 @@ void VDrawable::preprocess() } mRleTask = VRaster::generateStrokeInfo( std::move(mPath), std::move(mRle), mStroke.cap, mStroke.join, - mStroke.width, mStroke.meterLimit); + mStroke.width, mStroke.meterLimit, clip); } else { mRleTask = VRaster::generateFillInfo( - std::move(mPath), std::move(mRle), mFillRule); + std::move(mPath), std::move(mRle), mFillRule, clip); } mRle = VRle(); mFlag &= ~DirtyFlag(DirtyState::Path); diff --git a/src/vector/vdrawable.h b/src/vector/vdrawable.h index c24bee4..9d157f6 100644 --- a/src/vector/vdrawable.h +++ b/src/vector/vdrawable.h @@ -26,7 +26,7 @@ public: void setStrokeInfo(CapStyle cap, JoinStyle join, float meterLimit, float strokeWidth); void setDashInfo(float *array, uint size); - void preprocess(); + void preprocess(const VRect &clip); VRle rle(); public: