2 #include "lottieview.h"
9 * To check the frame rate with rendermode off run
10 * ECORE_EVAS_FPS_DEBUG=1 ./lottieviewTest --disable-render
12 * To check the frame rate with render backend
13 * ECORE_EVAS_FPS_DEBUG=1 ./lottieviewTest
20 LottieViewTest(EvasApp *app, bool renderMode) {
22 mRenderMode = renderMode;
26 auto resource = EvasApp::jsonFiles(std::string(DEMO_DIR));
28 if (resource.empty()) return;
30 int count = resource.size();
31 int colums = (int) ceil(sqrt(count));
33 int vw = (mApp->width() - (2 * offset * colums))/colums;
37 for(auto filePath : resource) {
39 std::unique_ptr<LottieView> view(new LottieView(mApp->evas(), mRenderMode));
40 view->setFilePath(filePath.c_str());
41 view->setPos(posx, posy);
42 view->setSize(vw, vh);
46 //view->setRepeatMode(LottieView::RepeatMode::Reverse);
49 if ((mApp->width() - posx) < vw) {
51 posy = posy + vh + offset;
53 mViews.push_back(std::move(view));
59 for (auto &i : mViews) {
66 bool mRenderMode = false;
67 std::vector<std::unique_ptr<LottieView>> mViews;
71 onExitCb(void *data, void *extra)
73 LottieViewTest *view = (LottieViewTest *)data;
78 onRenderPreCb(void *data, void *extra)
80 LottieViewTest *view = (LottieViewTest *)data;
85 main(int argc, char **argv)
87 EvasApp *app = new EvasApp(800, 800);
90 bool renderMode = true;
92 if (!strcmp(argv[1],"--disable-render"))
95 LottieViewTest *view = new LottieViewTest(app, renderMode);
98 app->addExitCb(onExitCb, view);
99 app->addRenderPreCb(onRenderPreCb, view);