Added DALI_WIDGET_REFRESH_RATE and cleaned up build flags 85/199185/3
authorJiyun Yang <ji.yang@samsung.com>
Thu, 7 Feb 2019 04:45:28 +0000 (13:45 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Fri, 8 Feb 2019 04:53:28 +0000 (13:53 +0900)
* DALI_WIDGET_REFRESH_RATE is an environment variable which is
  used to control WidgetApplication's render refresh rate.
* Removed unused legacy build flags: USE_APPFW_EFL_BASE, WIDGET_SUPPOERTED

Change-Id: I26039524850561076bf08a657b9bab7aae579484
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
build/tizen/adaptor/Makefile.am
build/tizen/adaptor/configure.ac
dali/internal/system/common/environment-variables.h
dali/internal/system/tizen-wayland/widget-application-impl-tizen.cpp
dali/internal/system/tizen-wayland/widget-application-impl-tizen.h
dali/internal/system/tizen-wayland/widget-controller-tizen.h

index 2996179..24570db 100644 (file)
@@ -499,34 +499,26 @@ LIBDALI_ADAPTOR_LA_CXXFLAGS += $(CAPI_APPFW_APPLICATION_CFLAGS) \
                                $(CAPI_SYSTEM_SYSTEM_SETTINGS_CFLAGS) \
                                $(CAPI_SYSTEM_INFO_CFLAGS) \
                                $(TTS_CFLAGS) \
-                               $(SENSOR_CFLAGS)
-
-LIBDALI_ADAPTOR_LA_LIBADD += $(CAPI_APPFW_APPLICATION_LIBS) \
-                             $(CAPI_SYSTEM_SYSTEM_SETTINGS_LIBS) \
-                             $(CAPI_SYSTEM_INFO_LIBS) \
-                             $(TTS_LIBS) \
-                             $(SENSOR_LIBS)
-if USE_APPFW_EFL_BASE
-LIBDALI_ADAPTOR_LA_CXXFLAGS += $(ELEMENTARY_CFLAGS)
-
-LIBDALI_ADAPTOR_LA_LIBADD += $(ELEMENTARY_LIBS)
-
-else
-LIBDALI_ADAPTOR_LA_CXXFLAGS += $(BUNDLE_CFLAGS) \
+                               $(SENSOR_CFLAGS) \
+                               $(BUNDLE_CFLAGS) \
                                $(CAPI_APPFW_COMMON_CFLAGS) \
                                $(CAPI_APPFW_CONTROL_CFLAGS) \
                                $(CAPI_APPFW_WIDGET_BASE_CFLAGS) \
                                $(ECORE_IMF_CFLAGS) \
-                               $(FRIBIDI_CFLAGS) \
-                               -DWIDGET_SUPPOERTED
+                               $(FRIBIDI_CFLAGS)
 
-LIBDALI_ADAPTOR_LA_LIBADD += $(BUNDLE_LIBS) \
+LIBDALI_ADAPTOR_LA_LIBADD += $(CAPI_APPFW_APPLICATION_LIBS) \
+                             $(CAPI_SYSTEM_SYSTEM_SETTINGS_LIBS) \
+                             $(CAPI_SYSTEM_INFO_LIBS) \
+                             $(TTS_LIBS) \
+                             $(SENSOR_LIBS) \
+                             $(BUNDLE_LIBS) \
                              $(CAPI_APPFW_COMMON_LIBS) \
                              $(CAPI_APPFW_CONTROL_LIBS) \
                              $(CAPI_APPFW_WIDGET_BASE_LIBS) \
                              $(ECORE_IMF_LIBS) \
                              $(FRIBIDI_LIBS)
-endif
+
 else
 LIBDALI_ADAPTOR_LA_CXXFLAGS += $(ELEMENTARY_CFLAGS)
 
index 11a6816..ea05c8b 100644 (file)
@@ -208,7 +208,6 @@ AM_CONDITIONAL([UBUNTU_PROFILE], [test x$enable_profile = xUBUNTU])
 AM_CONDITIONAL([WAYLAND], [test x$enable_wayland = xyes])
 AM_CONDITIONAL([ECORE_WAYLAND2], [test x$enable_ecore_wayland2 = xyes])
 AM_CONDITIONAL([USE_APPFW], [test x$enable_appfw = xyes])
-AM_CONDITIONAL([USE_APPFW_EFL_BASE], [test x$enable_tizen_major_version = x3])
 AM_CONDITIONAL([ENABLE_CXX03_ABI], [test x$enable_cxx03_abi = xyes])
 AM_CONDITIONAL([ENABLE_RENAME_SO], [test x$enable_rename_so = xyes])
 
index 029b984..500dfa9 100644 (file)
@@ -102,6 +102,8 @@ namespace Adaptor
 
 #define DALI_WATCH_REFRESH_RATE "DALI_WATCH_REFRESH_RATE"
 
+#define DALI_WIDGET_REFRESH_RATE "DALI_WIDGET_REFRESH_RATE"
+
 #define DALI_ENV_MULTI_SAMPLING_LEVEL "DALI_MULTI_SAMPLING_LEVEL"
 
 #define DALI_ENV_MAX_TEXTURE_SIZE "DALI_MAX_TEXTURE_SIZE"
index 7c12ef9..b9354c6 100644 (file)
 // INTERNAL INCLUDE
 #include <dali/public-api/adaptor-framework/widget.h>
 #include <dali/public-api/adaptor-framework/widget-impl.h>
+#include <dali/internal/system/common/environment-variables.h>
 #include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
 
-#ifdef WIDGET_SUPPOERTED
+// EXTERNAL INCLUDES
 #include <bundle.h>
 #include <widget_base.h>
-#endif
 
 namespace Dali
 {
@@ -34,7 +34,6 @@ namespace Dali
 namespace Internal
 {
 
-#ifdef WIDGET_SUPPOERTED
 namespace
 {
 
@@ -192,15 +191,18 @@ int OnInstanceUpdate(widget_base_instance_h instanceHandle, bundle *content, int
   return 0;
 }
 
-} // anonymous namespace
+unsigned int GetEnvWidgetRenderRefreshRate()
+{
+  const char* envVariable = std::getenv( DALI_WIDGET_REFRESH_RATE );
 
-#endif
+  return envVariable ? std::atoi( envVariable ) : 1u; // Default 60 fps
+}
+
+} // anonymous namespace
 
 namespace Adaptor
 {
 
-#ifdef WIDGET_SUPPOERTED
-
 WidgetApplicationPtr WidgetApplicationTizen::New(
   int* argc,
   char **argv[],
@@ -282,7 +284,12 @@ void WidgetApplicationTizen::DeleteWidget( widget_base_instance_h widgetBaseInst
   }
 }
 
-#endif
+void WidgetApplicationTizen::OnInit()
+{
+  WidgetApplication::OnInit();
+
+  Dali::Adaptor::Get().SetRenderRefreshRate( GetEnvWidgetRenderRefreshRate() );
+}
 
 // factory function, must be implemented
 namespace WidgetApplicationFactory
@@ -295,11 +302,7 @@ namespace WidgetApplicationFactory
  */
 Dali::Internal::Adaptor::WidgetApplicationPtr Create( int* argc, char **argv[], const std::string& stylesheet )
 {
-#ifdef WIDGET_SUPPOERTED
   return WidgetApplicationTizen::New( argc, argv, stylesheet );
-#else
-  return nullptr;
-#endif
 }
 
 } // namespace Factory
index 96eaab6..9e94388 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#ifdef WIDGET_SUPPOERTED
 #include <widget_base.h>
-#endif
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/application-impl.h>
 #include <dali/internal/system/common/widget-application-impl.h>
 
-#ifndef WIDGET_SUPPOERTED
-typedef void* widget_base_instance_h;
-#endif
-
 namespace Dali
 {
 class Widget;
@@ -63,6 +57,10 @@ public:
   static WidgetApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet );
 
 public:
+  /**
+   * @copydoc Dali::Internal::Adaptor::Application::OnInit()
+   */
+  virtual void OnInit();
 
   /**
    * @copydoc Dali::WidgetApplication::RegisterWidgetCreator()
index b692a9f..c9a58d4 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/signals/connection-tracker.h>
+#include <widget_base.h>
 
 // INTERNAL INCLUDES
-#ifdef WIDGET_SUPPOERTED
-#include <widget_base.h>
-#endif
 #include <dali/public-api/adaptor-framework/widget-impl.h>
 #include <dali/internal/system/common/widget-controller.h>
 
@@ -44,10 +42,6 @@ class WidgetImplTizen : public Widget::Impl
 {
 public:
 
-#ifndef WIDGET_SUPPOERTED
-  typedef void* widget_base_instance_h;
-#endif
-
   /**
    * Constructor
    */