rlottie: Get size data from the model

This commit is contained in:
sub.mohanty@samsung.com 2019-06-27 21:47:45 +09:00 committed by Subhransu
parent abff77e985
commit 7219aeca64
4 changed files with 3 additions and 7 deletions

View File

@ -39,7 +39,7 @@ class AnimationImpl {
public: public:
void init(const std::shared_ptr<LOTModel> &model); void init(const std::shared_ptr<LOTModel> &model);
bool update(size_t frameNo, const VSize &size); bool update(size_t frameNo, const VSize &size);
VSize size() const { return mCompItem->size(); } VSize size() const { return mModel->size(); }
double duration() const { return mModel->duration(); } double duration() const { return mModel->duration(); }
double frameRate() const { return mModel->frameRate(); } double frameRate() const { return mModel->frameRate(); }
size_t totalFrame() const { return mModel->totalFrame(); } size_t totalFrame() const { return mModel->totalFrame(); }

View File

@ -116,11 +116,6 @@ void LOTCompItem::resize(const VSize &size)
mUpdateViewBox = true; mUpdateViewBox = true;
} }
VSize LOTCompItem::size() const
{
return mViewSize;
}
bool LOTCompItem::update(int frameNo) bool LOTCompItem::update(int frameNo)
{ {
// check if cached frame is same as requested frame. // check if cached frame is same as requested frame.

View File

@ -67,7 +67,7 @@ public:
static std::unique_ptr<LOTLayerItem> createLayerItem(LOTLayerData *layerData); static std::unique_ptr<LOTLayerItem> createLayerItem(LOTLayerData *layerData);
bool update(int frameNo); bool update(int frameNo);
void resize(const VSize &size); void resize(const VSize &size);
VSize size() const; VSize size() const { return mViewSize;}
void buildRenderTree(); void buildRenderTree();
const LOTLayerNode * renderTree()const; const LOTLayerNode * renderTree()const;
bool render(const rlottie::Surface &surface); bool render(const rlottie::Surface &surface);

View File

@ -955,6 +955,7 @@ class LOTModel
{ {
public: public:
bool isStatic() const {return mRoot->isStatic();} bool isStatic() const {return mRoot->isStatic();}
VSize size() const {return mRoot->size();}
double duration() const {return mRoot->duration();} double duration() const {return mRoot->duration();}
size_t totalFrame() const {return mRoot->totalFrame();} size_t totalFrame() const {return mRoot->totalFrame();}
size_t frameDuration() const {return mRoot->frameDuration();} size_t frameDuration() const {return mRoot->frameDuration();}