mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-02 09:06:58 +00:00
lottie/performance: clip out path early during rle generation.
Change-Id: I0e7c8f9b8408a56e9fd197fe53c49b0a87517608
This commit is contained in:
committed by
Hermet Park
parent
556836cdc5
commit
bcfafd8a5b
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user