mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-07 23:03:35 +00:00
lottie: refactor VRaster class.
Change-Id: Iadd382d34fcaa67a4cb60b44f22af38051f6f09a
This commit is contained in:
parent
c12a9916a5
commit
6fb25316ee
@ -142,7 +142,7 @@ void LOTMaskItem::update(int frameNo, const VMatrix &parentMatrix,
|
||||
VPath path = mLocalPath;
|
||||
path.transform(parentMatrix);
|
||||
|
||||
mRleTask = VRaster::instance().generateFillInfo(std::move(path), std::move(mRle));
|
||||
mRleTask = VRaster::generateFillInfo(std::move(path), std::move(mRle));
|
||||
mRle = VRle();
|
||||
}
|
||||
|
||||
|
||||
@ -10,11 +10,11 @@ void VDrawable::preprocess()
|
||||
VDasher dasher(mStroke.mDash.data(), mStroke.mDash.size());
|
||||
mPath = dasher.dashed(mPath);
|
||||
}
|
||||
mRleTask = VRaster::instance().generateStrokeInfo(
|
||||
mRleTask = VRaster::generateStrokeInfo(
|
||||
std::move(mPath), std::move(mRle), mStroke.cap, mStroke.join,
|
||||
mStroke.width, mStroke.meterLimit);
|
||||
} else {
|
||||
mRleTask = VRaster::instance().generateFillInfo(
|
||||
mRleTask = VRaster::generateFillInfo(
|
||||
std::move(mPath), std::move(mRle), mFillRule);
|
||||
}
|
||||
mRle = VRle();
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
#include "vmatrix.h"
|
||||
#include "vpath.h"
|
||||
#include "vtaskqueue.h"
|
||||
#include "vrle.h"
|
||||
|
||||
V_BEGIN_NAMESPACE
|
||||
|
||||
@ -383,10 +384,6 @@ public:
|
||||
|
||||
static RleTaskScheduler raster_scheduler;
|
||||
|
||||
VRaster::VRaster() {}
|
||||
|
||||
VRaster::~VRaster() {}
|
||||
|
||||
std::future<VRle> VRaster::generateFillInfo(VPath &&path, VRle &&rle,
|
||||
FillRule fillRule)
|
||||
{
|
||||
|
||||
@ -1,35 +1,23 @@
|
||||
#ifndef VRASTER_H
|
||||
#define VRASTER_H
|
||||
#include <future>
|
||||
#include "vrle.h"
|
||||
#include "vglobal.h"
|
||||
|
||||
V_BEGIN_NAMESPACE
|
||||
|
||||
struct FTOutline;
|
||||
class VPath;
|
||||
class VRle;
|
||||
|
||||
struct VRasterPrivate;
|
||||
class VRaster {
|
||||
public:
|
||||
~VRaster();
|
||||
static VRaster &instance()
|
||||
{
|
||||
static VRaster Singleton;
|
||||
return Singleton;
|
||||
}
|
||||
VRaster(const VRaster &other) = delete;
|
||||
VRaster(VRaster &&) = delete;
|
||||
VRaster &operator=(VRaster const &) = delete;
|
||||
VRaster &operator=(VRaster &&) = delete;
|
||||
struct VRaster {
|
||||
|
||||
std::future<VRle> generateFillInfo(VPath &&path, VRle &&rle,
|
||||
FillRule fillRule = FillRule::Winding);
|
||||
std::future<VRle> generateStrokeInfo(VPath &&path, VRle &&rle, CapStyle cap,
|
||||
JoinStyle join, float width,
|
||||
float meterLimit);
|
||||
static std::future<VRle>
|
||||
generateFillInfo(VPath &&path, VRle &&rle,
|
||||
FillRule fillRule = FillRule::Winding);
|
||||
|
||||
private:
|
||||
VRaster();
|
||||
static std::future<VRle>
|
||||
generateStrokeInfo(VPath &&path, VRle &&rle,
|
||||
CapStyle cap, JoinStyle join,
|
||||
float width, float meterLimit);
|
||||
};
|
||||
|
||||
V_END_NAMESPACE
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user