Put samsung copyright header to all our own source code.
[platform/core/uifw/lottie-player.git] / example / lottieviewtest.cpp
index 59a3cf7..e0c5e2e 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #include "evasapp.h"
 #include "lottieview.h"
 #include<iostream>
@@ -20,6 +36,7 @@ public:
   LottieViewTest(EvasApp *app, bool renderMode) {
       mApp = app;
       mRenderMode = renderMode;
+      ecore_animator_frametime_set(1.0/120.0);
   }
 
   void show(int numberOfImage) {
@@ -30,7 +47,7 @@ public:
     int count = numberOfImage;
     int colums = (int) ceil(sqrt(count));
     int offset = 3;
-    int vw = (mApp->width() - (2 * offset * colums))/colums;
+    int vw = (mApp->width() - (offset * colums))/colums;
     int vh = vw;
     int posx = offset;
     int posy = offset;
@@ -56,9 +73,12 @@ public:
   }
 
   void render() {
+      //auto clock = std::chrono::high_resolution_clock::now();
       for (auto &i : mViews) {
           i->render();
       }
+      //double d = std::chrono::duration<double, std::milli>(std::chrono::high_resolution_clock::now()-clock).count();
+      //printf("total time taken = %f\n", d);
   }
 
 public:
@@ -93,7 +113,7 @@ main(int argc, char **argv)
            renderMode = false;
    }
    LottieViewTest *view = new LottieViewTest(app, renderMode);
-   view->show(50);
+   view->show(250);
 
    app->addExitCb(onExitCb, view);
    app->addRenderPreCb(onRenderPreCb, view);