//
// CLASS HEADER
-#include "log-options.h"
+#include "environment-options.h"
namespace Dali
{
namespace Adaptor
{
-LogOptions::LogOptions()
+EnvironmentOptions::EnvironmentOptions()
: mFpsFrequency(0),
mUpdateStatusFrequency(0),
mPerformanceLoggingLevel(0),
{
}
-LogOptions::~LogOptions()
+EnvironmentOptions::~EnvironmentOptions()
{
}
-void LogOptions::SetOptions( const Dali::Integration::Log::LogFunction& logFunction,
+void EnvironmentOptions::SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
unsigned int logFrameRateFrequency,
unsigned int logupdateStatusFrequency,
unsigned int logPerformanceLevel,
mPanGestureLoggingLevel = logPanGestureLevel;
}
-void LogOptions::InstallLogFunction() const
+void EnvironmentOptions::InstallLogFunction() const
{
Dali::Integration::Log::InstallLogFunction( mLogFunction );
}
-void LogOptions::UnInstallLogFunction() const
+void EnvironmentOptions::UnInstallLogFunction() const
{
Dali::Integration::Log::UninstallLogFunction();
}
-unsigned int LogOptions::GetFrameRateLoggingFrequency() const
+unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
{
return mFpsFrequency;
}
-unsigned int LogOptions::GetUpdateStatusLoggingFrequency() const
+unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
{
return mUpdateStatusFrequency;
}
-unsigned int LogOptions::GetPerformanceLoggingLevel() const
+unsigned int EnvironmentOptions::GetPerformanceLoggingLevel() const
{
return mPerformanceLoggingLevel;
}
-unsigned int LogOptions::GetPanGestureLoggingLevel() const
+unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
{
return mPanGestureLoggingLevel;
}
+unsigned int EnvironmentOptions::GetPanGestureSmoothingMode() const
+{
+ return mPanGesturePredictionMode;
+}
+
} // Adaptor
} // Internal
-#ifndef __DALI_INTERNAL_ADAPTOR_LOG_OPTIONS_H__
-#define __DALI_INTERNAL_ADAPTOR_LOG_OPTIONS_H__
+#ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
+#define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
//
// Copyright (c) 2014 Samsung Electronics Co., Ltd.
{
/**
- * Contains log settings and the ability to install a log function.
+ * Contains environment options which define settings and the ability to install a log function.
*/
-class LogOptions
+class EnvironmentOptions
{
public:
/**
* Constructor
*/
- LogOptions();
+ EnvironmentOptions();
/**
* non-virtual destructor, not intended as a base class
*/
- ~LogOptions();
+ ~EnvironmentOptions();
/**
* @param logFunction logging function
* @param logPerformanceLevel performance logging, 0 = disabled, 1+ = enabled
* @param logPanGestureLevel pan-gesture logging, 0 = disabled, 1 = enabled
*/
- void SetOptions( const Dali::Integration::Log::LogFunction& logFunction,
- unsigned int logFrameRateFrequency,
- unsigned int logupdateStatusFrequency,
- unsigned int logPerformanceLevel,
- unsigned int logPanGestureLevel );
+ void SetLogOptions( const Dali::Integration::Log::LogFunction& logFunction,
+ unsigned int logFrameRateFrequency,
+ unsigned int logupdateStatusFrequency,
+ unsigned int logPerformanceLevel,
+ unsigned int logPanGestureLevel );
/**
* Install the log function for the current thread.
*/
unsigned int GetPanGestureLoggingLevel() const;
+ /**
+ * @return pan-gesture smoothing mode ( 0 == no smoothing )
+ */
+ unsigned int GetPanGestureSmoothingMode() const;
+
+ /**
+ * @brief Sets the mode used to smooth pan gesture movement properties calculated on the Update thread
+ *
+ * @param[in] mode The smoothing mode to use
+ */
+ void SetPanGesturePredictionMode(unsigned int mode) { mPanGesturePredictionMode = mode; }
+
private:
unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
unsigned int mPerformanceLoggingLevel; ///< performance log level
unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
+ unsigned int mPanGesturePredictionMode; ///< prediction mode for pan gestures
Dali::Integration::Log::LogFunction mLogFunction;
// Undefined copy constructor.
- LogOptions( const LogOptions& );
+ EnvironmentOptions( const EnvironmentOptions& );
// Undefined assignment operator.
- LogOptions& operator=( const LogOptions& );
+ EnvironmentOptions& operator=( const EnvironmentOptions& );
};
} // Internal
} // Dali
-#endif // __DALI_INTERNAL_ADAPTOR_LOG_OPTIONS_H__
+#endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
#define DALI_ENV_LOG_PAN_GESTURE "DALI_LOG_PAN_GESTURE"
+#define DALI_ENV_PAN_PREDICTION_MODE "DALI_PAN_PREDICTION_MODE"
+
} // namespace Adaptor
} // namespace Internal
$(base_adaptor_src_dir)/update-render-controller.cpp \
$(base_adaptor_src_dir)/vsync-notifier.cpp \
$(base_adaptor_src_dir)/performance-logging/frame-time-stamp.cpp \
- $(base_adaptor_src_dir)/log-options.cpp \
+ $(base_adaptor_src_dir)/environment-options.cpp \
$(base_adaptor_src_dir)/performance-logging/frame-time-stats.cpp \
$(base_adaptor_src_dir)/performance-logging/performance-marker.cpp \
$(base_adaptor_src_dir)/performance-logging/performance-server.cpp \
PerformanceInterface* PerformanceInterfaceFactory::CreateInterface(
AdaptorInternalServices& adaptorServices,
- const LogOptions& logOptions )
+ const EnvironmentOptions& environmentOptions )
{
- return new PerformanceServer( adaptorServices, logOptions );
+ return new PerformanceServer( adaptorServices, environmentOptions );
}
// INTERNAL INCLUDES
#include <base/interfaces/adaptor-internal-services.h>
#include <dali/integration-api/debug.h>
-#include <base/log-options.h>
+#include <base/environment-options.h>
namespace Dali
{
/**
* Create a new concrete implementation of the performance interface.
* @param adaptorServices adaptor internal services
- * @param logOptions log options
+ * @param environmentOptions environment options
* @return pointer to a new performance interface
*/
static PerformanceInterface* CreateInterface( AdaptorInternalServices& adaptorServices,
- const LogOptions& logOptions );
+ const EnvironmentOptions& environmentOptions );
};
#include "performance-server.h"
// INTERNAL INCLUDES
-#include <base/log-options.h>
+#include <base/environment-options.h>
namespace Dali
{
PerformanceServer::PerformanceServer( AdaptorInternalServices& adaptorServices,
- const LogOptions& logOptions)
+ const EnvironmentOptions& environmentOptions)
:mLoggingEnabled( false),
mLogFunctionInstalled( false ),
mLogFrequencyMicroseconds( 0),
mPlatformAbstraction( adaptorServices.GetPlatformAbstractionInterface() ),
- mLogOptions(logOptions),
+ mEnvironmentOptions(environmentOptions),
mKernelTrace( adaptorServices.GetKernelTraceInterface() )
{
- SetLogging( mLogOptions.GetPerformanceLoggingLevel(), mLogOptions.GetFrameRateLoggingFrequency());
+ SetLogging( mEnvironmentOptions.GetPerformanceLoggingLevel(), mEnvironmentOptions.GetFrameRateLoggingFrequency());
}
PerformanceServer::~PerformanceServer()
{
if( mLogFunctionInstalled )
{
- mLogOptions.UnInstallLogFunction();
+ mEnvironmentOptions.UnInstallLogFunction();
}
}
void PerformanceServer::SetLogging( unsigned int level, unsigned int interval)
// if the v-sync thread has already installed one, it won't make any difference.
if(! mLogFunctionInstalled )
{
- mLogOptions.InstallLogFunction();
+ mEnvironmentOptions.InstallLogFunction();
mLogFunctionInstalled = true;
}
namespace Adaptor
{
-class LogOptions;
+class EnvironmentOptions;
/**
* Concrete implementation of performance interface.
* Adaptor classes should never include this file, they
/**
* Constructor
* @param adaptorServices adaptor internal services
- * @param logOptions log options
+ * @param environmentOptions environment options
*/
PerformanceServer( AdaptorInternalServices& adaptorServices,
- const LogOptions& logOptions );
+ const EnvironmentOptions& environmentOptions );
/**
* Destructor
typedef Dali::Vector<PerformanceMarker > MarkerVector;
MarkerVector mMarkers; ///< vector of markers
boost::mutex mDataMutex; ///< mutex
- const LogOptions& mLogOptions; ///< log options
+ const EnvironmentOptions& mEnvironmentOptions; ///< environment options
KernelTraceInterface& mKernelTrace; ///< kernel trace interface
};
#include <dali/integration-api/debug.h>
#include <base/interfaces/adaptor-internal-services.h>
#include <base/update-render-synchronization.h>
-#include <base/log-options.h>
+#include <base/environment-options.h>
namespace Dali
RenderThread::RenderThread( UpdateRenderSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
- const LogOptions& logOptions )
+ const EnvironmentOptions& environmentOptions )
: mUpdateRenderSync( sync ),
mCore( adaptorInterfaces.GetCore() ),
mGLES( adaptorInterfaces.GetGlesInterface() ),
mSurfaceReplacing( false ),
mNewDataAvailable( false ),
mSurfaceReplaceCompleted( false ),
- mLogOptions( logOptions )
+ mEnvironmentOptions( environmentOptions )
{
// set the initial values before render thread starts
mCurrent.surface = adaptorInterfaces.GetRenderSurfaceInterface();
bool RenderThread::Run()
{
// install a function for logging
- mLogOptions.InstallLogFunction();
+ mEnvironmentOptions.InstallLogFunction();
InitializeEgl();
ShutdownEgl();
// install a function for logging
- mLogOptions.UnInstallLogFunction();
+ mEnvironmentOptions.UnInstallLogFunction();
return true;
}
class RenderSurface;
class UpdateRenderSynchronization;
class EglFactoryInterface;
-class LogOptions;
+class EnvironmentOptions;
/**
* The render-thread is responsible for calling Core::Render() after each update.
* Create the render-thread; this will not do anything until Start() is called.
* @param[in] sync update-render synchronization object
* @param[in] adaptorInterfaces base adaptor interface
- * @param[in] logOptions log options
+ * @param[in] environmentOptions environment options
*/
RenderThread( UpdateRenderSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
- const LogOptions& logOptions );
+ const EnvironmentOptions& environmentOptions );
/**
* Virtual Destructor
boost::mutex mSurfaceChangedMutex; ///< mutex to lock during surface replacing
boost::condition_variable mSurfaceChangedNotify; ///< condition to notify main thread that surface has been changed
bool mSurfaceReplaceCompleted;///< true, while render thread is running and needs to wait for pixmap syncs
- const LogOptions& mLogOptions; ///< Log options
+ const EnvironmentOptions& mEnvironmentOptions; ///< Environment options
};
#include <base/update-render-synchronization.h>
#include <base/vsync-notifier.h>
#include <base/interfaces/adaptor-internal-services.h>
-#include <base/log-options.h>
+#include <base/environment-options.h>
namespace Dali
{
UpdateRenderController::UpdateRenderController( AdaptorInternalServices& adaptorInterfaces,
- const LogOptions& logOptions ): mUpdateThread( NULL ),
+ const EnvironmentOptions& environmentOptions ): mUpdateThread( NULL ),
mRenderThread( NULL ),
mVSyncNotifier( NULL ),
mUpdateRenderSync( NULL )
mUpdateRenderSync = new UpdateRenderSynchronization( adaptorInterfaces );
- mUpdateThread = new UpdateThread( *mUpdateRenderSync, adaptorInterfaces, logOptions );
+ mUpdateThread = new UpdateThread( *mUpdateRenderSync, adaptorInterfaces, environmentOptions );
- mRenderThread = new RenderThread( *mUpdateRenderSync, adaptorInterfaces, logOptions );
+ mRenderThread = new RenderThread( *mUpdateRenderSync, adaptorInterfaces, environmentOptions );
- mVSyncNotifier = new VSyncNotifier( *mUpdateRenderSync, adaptorInterfaces, logOptions );
+ mVSyncNotifier = new VSyncNotifier( *mUpdateRenderSync, adaptorInterfaces, environmentOptions );
}
UpdateRenderController::~UpdateRenderController()
class UpdateRenderSynchronization;
class RenderSurface;
class AdaptorInternalServices;
-class LogOptions;
+class EnvironmentOptions;
/**
* Class to control the update and render threads.
/**
* Constructor
*/
- UpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const LogOptions& logOptions );
+ UpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
/**
* Non virtual destructor. Not intended as base class.
#include <dali/integration-api/debug.h>
#include <base/interfaces/adaptor-internal-services.h>
#include <base/update-render-synchronization.h>
-#include <base/log-options.h>
+#include <base/environment-options.h>
namespace Dali
{
UpdateThread::UpdateThread( UpdateRenderSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
- const LogOptions& logOptions )
+ const EnvironmentOptions& environmentOptions )
: mUpdateRenderSync( sync ),
mCore( adaptorInterfaces.GetCore()),
- mFpsTrackingSeconds( logOptions.GetFrameRateLoggingFrequency() ),
+ mFpsTrackingSeconds( environmentOptions.GetFrameRateLoggingFrequency() ),
mElapsedTime( 0.0f ),
mElapsedSeconds( 0u ),
- mStatusLogInterval( logOptions.GetUpdateStatusLoggingFrequency() ),
+ mStatusLogInterval( environmentOptions.GetUpdateStatusLoggingFrequency() ),
mStatusLogCount( 0u ),
mNotificationTrigger( adaptorInterfaces.GetTriggerEventInterface() ),
mThread( NULL ),
- mLogOptions( logOptions )
+ mEnvironmentOptions( environmentOptions )
{
if( mFpsTrackingSeconds > 0 )
{
Integration::UpdateStatus status;
// install a function for logging
- mLogOptions.InstallLogFunction();
+ mEnvironmentOptions.InstallLogFunction();
bool running( true );
}
// uninstall a function for logging
- mLogOptions.UnInstallLogFunction();
+ mEnvironmentOptions.UnInstallLogFunction();
return true;
}
class UpdateRenderSynchronization;
class AdaptorInternalServices;
class TriggerEventInterface;
-class LogOptions;
+class EnvironmentOptions;
/**
* The update-thread is responsible for calling Core::Update(), and
* Create the update-thread; this will not do anything until Start() is called.
* @param[in] sync An object used to synchronize update & render threads.
* @param[in] adaptorInterfaces base adaptor interface
- * @param[in] LogOptions log functions
+ * @param[in] environmentOptions environment options
*/
UpdateThread(UpdateRenderSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
- const LogOptions& logOptions );
+ const EnvironmentOptions& environmentOptions );
/**
* Non-virtual destructor; UpdateThread is not suitable as a base class.
TriggerEventInterface& mNotificationTrigger; ///< Reference to notification event trigger
boost::thread* mThread; ///< The actual update-thread.
- const LogOptions& mLogOptions; ///< Log options
+ const EnvironmentOptions& mEnvironmentOptions; ///< environment options
}; // class UpdateThread
} // namespace Adaptor
#include "vsync-notifier.h"
#include <base/interfaces/adaptor-internal-services.h>
#include <base/update-render-synchronization.h>
-#include <base/log-options.h>
+#include <base/environment-options.h>
namespace Dali
{
VSyncNotifier::VSyncNotifier( UpdateRenderSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
- const LogOptions& logOptions )
+ const EnvironmentOptions& environmentOptions )
: mUpdateRenderSync( sync ),
mCore( adaptorInterfaces.GetCore() ),
mPlatformAbstraction( adaptorInterfaces.GetPlatformAbstractionInterface() ),
mVSyncMonitor( adaptorInterfaces.GetVSyncMonitorInterface() ),
mThread( NULL ),
- mLogOptions( logOptions )
+ mEnvironmentOptions( environmentOptions )
{
}
void VSyncNotifier::Run()
{
// install a function for logging
- mLogOptions.InstallLogFunction();
+ mEnvironmentOptions.InstallLogFunction();
unsigned int frameNumber( 0u ); // frameCount, updated when the thread is paused
unsigned int currentSequenceNumber( 0u ); // platform specific vsync sequence number (increments with each vsync)
}
// uninstall a function for logging
- mLogOptions.UnInstallLogFunction();
+ mEnvironmentOptions.UnInstallLogFunction();
}
class VSyncMonitorInterface;
class UpdateRenderSynchronization;
-class LogOptions;
+class EnvironmentOptions;
class AdaptorInternalServices;
/**
* send notifications until Start() is called.
* @param[in] sync An object used to synchronize update, render and vsync threads.
* @param[in] adaptorInterfaces base adaptor interface
- * @param[in] logOption Log options
+ * @param[in] environmentOptions environment options
*/
VSyncNotifier( UpdateRenderSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
- const LogOptions& logOptions);
+ const EnvironmentOptions& environmentOptions);
/**
* Non-virtual destructor; VSyncNotifier is not suitable as a base class.
Integration::PlatformAbstraction& mPlatformAbstraction; ///< The platform abstraction for retrieving the current time etc.
VSyncMonitorInterface* mVSyncMonitor; ///< VSyncMonitor interface
boost::thread* mThread; ///< The actual thread.
- const LogOptions& mLogOptions; ///< Log options
+ const EnvironmentOptions& mEnvironmentOptions; ///< Environment options
}; // class VSyncNotifier
return adaptor;
}
-void Adaptor::ParseLogOptions()
+void Adaptor::ParseEnvironmentOptions()
{
// get logging options
unsigned int logFrameRateFrequency = GetIntegerEnvironmentVariable( DALI_ENV_FPS_TRACKING, 0 );
unsigned int logPerformanceLevel = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE, 0 );
unsigned int logPanGesture = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PAN_GESTURE, 0 );
+ // all threads here (event, update, and render) will send their logs to SLP Platform's LogMessage handler.
Dali::Integration::Log::LogFunction logFunction(Dali::SlpPlatform::LogMessage);
- mLogOptions.SetOptions( logFunction, logFrameRateFrequency, logupdateStatusFrequency, logPerformanceLevel, logPanGesture );
-
- // all threads here (event, update, and render) will send their logs to SLP Platform's LogMessage handler.
- // Dali::Integration::Log::LogFunction logFunction(Dali::SlpPlatform::LogMessage);
+ mEnvironmentOptions.SetLogOptions( logFunction, logFrameRateFrequency, logupdateStatusFrequency, logPerformanceLevel, logPanGesture );
+ mEnvironmentOptions.SetPanGesturePredictionMode(GetIntegerEnvironmentVariable( DALI_ENV_PAN_PREDICTION_MODE, 1));
- mLogOptions.InstallLogFunction();
+ mEnvironmentOptions.InstallLogFunction();
}
void Adaptor::Initialize()
{
- ParseLogOptions();
+ ParseEnvironmentOptions();
mPlatformAbstraction = new SlpPlatform::SlpPlatformAbstraction;
- if( mLogOptions.GetPerformanceLoggingLevel() > 0 )
+ if( mEnvironmentOptions.GetPerformanceLoggingLevel() > 0 )
{
- mPerformanceInterface = PerformanceInterfaceFactory::CreateInterface( *this, mLogOptions );
+ mPerformanceInterface = PerformanceInterfaceFactory::CreateInterface( *this, mEnvironmentOptions );
}
mCallbackManager = CallbackManager::New();
mVSyncMonitor = new VSyncMonitor;
- mUpdateRenderController = new UpdateRenderController( *this, mLogOptions );
+ mUpdateRenderController = new UpdateRenderController( *this, mEnvironmentOptions );
mDaliFeedbackPlugin = new FeedbackPluginProxy( FeedbackPluginProxy::DEFAULT_OBJECT_NAME );
// Should be called after Core creation
- if( mLogOptions.GetPanGestureLoggingLevel() )
+ if( mEnvironmentOptions.GetPanGestureLoggingLevel() )
{
Integration::EnableProfiling( Dali::Integration::PROFILING_TYPE_PAN_GESTURE );
}
+ Integration::SetPanGesturePredictionMode(mEnvironmentOptions.GetPanGestureSmoothingMode());
}
Adaptor::~Adaptor()
mDragAndDropDetector(),
mDeferredRotationObserver(NULL),
mBaseLayout(baseLayout),
- mLogOptions(),
+ mEnvironmentOptions(),
mPerformanceInterface(NULL)
{
DALI_ASSERT_ALWAYS( gThreadLocalAdaptor.get() == NULL && "Cannot create more than one Adaptor per thread" );
#include <slp-platform-abstraction.h>
#include <base/interfaces/adaptor-internal-services.h>
-#include <base/log-options.h>
+#include <base/environment-options.h>
#include <base/core-event-interface.h>
#include <internal/common/drag-and-drop-detector-impl.h>
#include <internal/common/damage-observer.h>
/**
* Helper to parse log options
*/
- void ParseLogOptions();
+ void ParseEnvironmentOptions();
/**
* Informs core the surface size has changed
DragAndDropDetectorPtr mDragAndDropDetector; ///< The Drag & Drop detector
RotationObserver* mDeferredRotationObserver; ///< deferred Rotation observer needs event handler
DeviceLayout mBaseLayout; ///< The base layout of the application
- LogOptions mLogOptions; ///< log options
+ EnvironmentOptions mEnvironmentOptions; ///< environment options
PerformanceInterface* mPerformanceInterface; ///< Performance interface
KernelTrace mKernelTracer; ///< Kernel tracer
TriggerEventFactory mTriggerEventFactory; ///< Trigger event factory