1 #ifndef __DALI_INTERNAL_ADAPTOR_PERFORMANCE_SERVER_H__
2 #define __DALI_INTERNAL_ADAPTOR_PERFORMANCE_SERVER_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://floralicense.org/license/
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
21 #include <base/interfaces/performance-interface.h>
22 #include <base/performance-logging/frame-time-stats.h>
23 #include <dali/public-api/common/dali-vector.h>
24 #include <dali/integration-api/platform-abstraction.h>
27 #include <boost/thread/mutex.hpp>
40 * Concrete implementation of performance interface.
41 * Adaptor classes should never include this file, they
42 * just need to include the abstract class performance-interface.h
44 class PerformanceServer : public PerformanceInterface
51 * @param platformAbstraction platform abstraction
52 * @param logOptions log options
54 PerformanceServer( Integration::PlatformAbstraction& platformAbstraction,
55 const LogOptions& logOptions );
60 virtual ~PerformanceServer();
63 * @copydoc PerformanceInterface::AddMarker()
65 virtual void AddMarker( PerformanceMarker::MarkerType markerType);
68 * @copydoc PerformanceInterface::SetLogging()
70 virtual void SetLogging( unsigned int level, unsigned int interval);
78 void AddMarkerToLog( PerformanceMarker marker );
83 void LogMarker(const char* name, const FrameTimeStats& frameStats);
92 bool mLoggingEnabled:1; ///< whether logging update / render to a log is enabled
93 bool mLogFunctionInstalled:1; ///< whether the log function is installed
94 unsigned int mLogLevel; ///< log level
96 unsigned int mLogFrequencyMicroseconds; ///< if logging is enabled, what frequency to log out at in micro-seconds
98 FrameTimeStats mUpdateStats; ///< update time statistics
99 FrameTimeStats mRenderStats; ///< render time statistics
100 FrameTimeStats mEventStats; ///< event time statistics
102 Integration::PlatformAbstraction& mPlatformAbstraction; ///< platform abstraction
104 typedef Dali::Vector<PerformanceMarker > MarkerVector;
105 MarkerVector mMarkers; ///< vector of markers
106 boost::mutex mDataMutex; ///< mutex
107 const LogOptions& mLogOptions; ///< log options
112 } // namespace Internal
114 } // namespace Adaptor