From: subhransu mohanty Date: Thu, 19 Jul 2018 06:50:48 +0000 (+0900) Subject: lottie/example: update the example to do stress test. X-Git-Tag: submit/tizen/20180917.042405~219 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F184607%2F1;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/example: update the example to do stress test. Change-Id: I701fa71d0a05be453c26c252e57ab1ce3b110b0d --- diff --git a/example/lottieviewtest.cpp b/example/lottieviewtest.cpp index 7af573e..59a3cf7 100644 --- a/example/lottieviewtest.cpp +++ b/example/lottieviewtest.cpp @@ -22,37 +22,37 @@ public: mRenderMode = renderMode; } - void show() { + void show(int numberOfImage) { auto resource = EvasApp::jsonFiles(std::string(DEMO_DIR)); if (resource.empty()) return; - int count = resource.size(); + int count = numberOfImage; int colums = (int) ceil(sqrt(count)); int offset = 3; int vw = (mApp->width() - (2 * offset * colums))/colums; int vh = vw; int posx = offset; int posy = offset; - for(auto filePath : resource) { - + int resourceSize = resource.size(); + for (int i = 0 ; i < numberOfImage; i++) { + int index = i % resourceSize; std::unique_ptr view(new LottieView(mApp->evas(), mRenderMode)); - view->setFilePath(filePath.c_str()); - view->setPos(posx, posy); - view->setSize(vw, vh); - view->show(); - view->play(); - view->loop(true); - //view->setRepeatMode(LottieView::RepeatMode::Reverse); - - posx += vw+offset; - if ((mApp->width() - posx) < vw) { + view->setFilePath(resource[index].c_str()); + view->setPos(posx, posy); + view->setSize(vw, vh); + view->show(); + view->play(); + view->loop(true); + //view->setRepeatMode(LottieView::RepeatMode::Reverse); + + posx += vw+offset; + if ((mApp->width() - posx) < vw) { posx = offset; posy = posy + vh + offset; - } - mViews.push_back(std::move(view)); + } + mViews.push_back(std::move(view)); } - } void render() { @@ -93,7 +93,7 @@ main(int argc, char **argv) renderMode = false; } LottieViewTest *view = new LottieViewTest(app, renderMode); - view->show(); + view->show(50); app->addExitCb(onExitCb, view); app->addRenderPreCb(onRenderPreCb, view);