mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 21:41:45 +00:00
remove redundant apis.
Change-Id: Iacc975f28d6a87e9994be49d291ea67037263a82
This commit is contained in:
parent
cbf5a3245e
commit
73f5282428
@ -221,20 +221,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void renderSync(size_t frameNo, Surface surface);
|
void renderSync(size_t frameNo, Surface surface);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Returns list of rendering nodes that that represents the
|
|
||||||
* content of the lottie resource at frame number {frameNo}.
|
|
||||||
*
|
|
||||||
* @param[in] frameNo Content corresponds to the frameno needs to be extracted.
|
|
||||||
* @param[in] width content viewbox width
|
|
||||||
* @param[in] height content viewbox height
|
|
||||||
*
|
|
||||||
* @return render node list.
|
|
||||||
*
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
const std::vector<LOTNode *> &renderList(size_t frameNo, size_t width, size_t height) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns root layer of the composition updated with
|
* @brief Returns root layer of the composition updated with
|
||||||
* content of the lottie resource at frame number {frameNo}.
|
* content of the lottie resource at frame number {frameNo}.
|
||||||
|
|||||||
@ -20,23 +20,6 @@ LOT_EXPORT double lottie_animation_get_duration(const Lottie_Animation *animatio
|
|||||||
LOT_EXPORT size_t lottie_animation_get_totalframe(const Lottie_Animation *animation);
|
LOT_EXPORT size_t lottie_animation_get_totalframe(const Lottie_Animation *animation);
|
||||||
LOT_EXPORT double lottie_animation_get_framerate(const Lottie_Animation *animation);
|
LOT_EXPORT double lottie_animation_get_framerate(const Lottie_Animation *animation);
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Request to update the content of the frame $frame_number in to Animation object.
|
|
||||||
* frame_number, the content of the animation in that frame number
|
|
||||||
* width , width of the viewbox
|
|
||||||
* height , height of the viewbox
|
|
||||||
*
|
|
||||||
* PS : user must call lottie_animation_get_node_count and lottie_animation_get_node
|
|
||||||
* to get the renderlist.
|
|
||||||
*/
|
|
||||||
LOT_EXPORT size_t lottie_animation_prepare_frame(Lottie_Animation *animation,
|
|
||||||
size_t frameNo,
|
|
||||||
size_t w, size_t h);
|
|
||||||
LOT_EXPORT size_t lottie_animation_get_node_count(const Lottie_Animation *animation);
|
|
||||||
LOT_EXPORT const LOTNode* lottie_animation_get_node(Lottie_Animation *animation, size_t idx);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the render tree which contains the snapshot of the animation object at frame $frame_number
|
* Get the render tree which contains the snapshot of the animation object at frame $frame_number
|
||||||
* frame_number, the content of the animation in that frame number
|
* frame_number, the content of the animation in that frame number
|
||||||
|
|||||||
@ -73,32 +73,6 @@ LOT_EXPORT double lottie_animation_get_framerate(const Lottie_Animation_S *anima
|
|||||||
return animation->mAnimation->frameRate();
|
return animation->mAnimation->frameRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
LOT_EXPORT void lottie_animation_prepare_frame(Lottie_Animation_S *animation, size_t frameNo, size_t w, size_t h)
|
|
||||||
{
|
|
||||||
if (!animation) return;
|
|
||||||
|
|
||||||
animation->mFrameNo = frameNo;
|
|
||||||
animation->mWidth = w;
|
|
||||||
animation->mHeight = h;
|
|
||||||
animation->mArraySize = animation->mAnimation->renderList(frameNo, w, h).size();
|
|
||||||
}
|
|
||||||
|
|
||||||
LOT_EXPORT size_t lottie_animation_get_node_count(const Lottie_Animation_S *animation)
|
|
||||||
{
|
|
||||||
if (!animation) return 0;
|
|
||||||
|
|
||||||
return animation->mArraySize;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOT_EXPORT const LOTNode* lottie_animation_get_node(const Lottie_Animation_S *animation, size_t idx)
|
|
||||||
{
|
|
||||||
if (!animation) return nullptr;
|
|
||||||
|
|
||||||
if (idx >= animation->mArraySize) return nullptr;
|
|
||||||
|
|
||||||
return animation->mAnimation->renderList(animation->mFrameNo, animation->mWidth, animation->mHeight)[idx];
|
|
||||||
}
|
|
||||||
|
|
||||||
LOT_EXPORT const LOTLayerNode * lottie_animation_render_tree(Lottie_Animation_S *animation, size_t frameNo, size_t w, size_t h)
|
LOT_EXPORT const LOTLayerNode * lottie_animation_render_tree(Lottie_Animation_S *animation, size_t frameNo, size_t w, size_t h)
|
||||||
{
|
{
|
||||||
if (!animation) return nullptr;
|
if (!animation) return nullptr;
|
||||||
|
|||||||
@ -20,8 +20,6 @@ public:
|
|||||||
size_t frameAtPos(double pos) const {return mModel->frameAtPos(pos);}
|
size_t frameAtPos(double pos) const {return mModel->frameAtPos(pos);}
|
||||||
Surface render(size_t frameNo, const Surface &surface);
|
Surface render(size_t frameNo, const Surface &surface);
|
||||||
|
|
||||||
const std::vector<LOTNode *> &
|
|
||||||
renderList(size_t frameNo, const VSize &size);
|
|
||||||
const LOTLayerNode *
|
const LOTLayerNode *
|
||||||
renderTree(size_t frameNo, const VSize &size);
|
renderTree(size_t frameNo, const VSize &size);
|
||||||
private:
|
private:
|
||||||
@ -31,14 +29,6 @@ private:
|
|||||||
std::atomic<bool> mRenderInProgress;
|
std::atomic<bool> mRenderInProgress;
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::vector<LOTNode *> &AnimationImpl::renderList(size_t frameNo, const VSize &size)
|
|
||||||
{
|
|
||||||
if (update(frameNo, size)) {
|
|
||||||
mCompItem->buildRenderList();
|
|
||||||
}
|
|
||||||
return mCompItem->renderList();
|
|
||||||
}
|
|
||||||
|
|
||||||
const LOTLayerNode *AnimationImpl::renderTree(size_t frameNo, const VSize &size)
|
const LOTLayerNode *AnimationImpl::renderTree(size_t frameNo, const VSize &size)
|
||||||
{
|
{
|
||||||
if (update(frameNo, size)) {
|
if (update(frameNo, size)) {
|
||||||
@ -238,12 +228,6 @@ size_t Animation::frameAtPos(double pos)
|
|||||||
return d->frameAtPos(pos);
|
return d->frameAtPos(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<LOTNode *> &
|
|
||||||
Animation::renderList(size_t frameNo, size_t width, size_t height) const
|
|
||||||
{
|
|
||||||
return d->renderList(frameNo, VSize(width, height));
|
|
||||||
}
|
|
||||||
|
|
||||||
const LOTLayerNode *
|
const LOTLayerNode *
|
||||||
Animation::renderTree(size_t frameNo, size_t width, size_t height) const
|
Animation::renderTree(size_t frameNo, size_t width, size_t height) const
|
||||||
{
|
{
|
||||||
|
|||||||
@ -88,24 +88,6 @@ bool LOTCompItem::update(int frameNo)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LOTCompItem::buildRenderList()
|
|
||||||
{
|
|
||||||
mDrawableList.clear();
|
|
||||||
mRootLayer->renderList(mDrawableList);
|
|
||||||
|
|
||||||
mRenderList.clear();
|
|
||||||
for (auto &i : mDrawableList) {
|
|
||||||
LOTDrawable *lotDrawable = static_cast<LOTDrawable *>(i);
|
|
||||||
lotDrawable->sync();
|
|
||||||
mRenderList.push_back(lotDrawable->mCNode.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::vector<LOTNode *> &LOTCompItem::renderList() const
|
|
||||||
{
|
|
||||||
return mRenderList;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LOTCompItem::buildRenderTree()
|
void LOTCompItem::buildRenderTree()
|
||||||
{
|
{
|
||||||
mRootLayer->buildLayerNode();
|
mRootLayer->buildLayerNode();
|
||||||
|
|||||||
@ -36,8 +36,6 @@ public:
|
|||||||
bool update(int frameNo);
|
bool update(int frameNo);
|
||||||
void resize(const VSize &size);
|
void resize(const VSize &size);
|
||||||
VSize size() const;
|
VSize size() const;
|
||||||
const std::vector<LOTNode *>& renderList()const;
|
|
||||||
void buildRenderList();
|
|
||||||
void buildRenderTree();
|
void buildRenderTree();
|
||||||
const LOTLayerNode * renderTree()const;
|
const LOTLayerNode * renderTree()const;
|
||||||
bool render(const lottie::Surface &surface);
|
bool render(const lottie::Surface &surface);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user