1 #ifndef __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
2 #define __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/integration-api/debug.h>
25 #include <base/threading-mode.h>
35 * This class provides the environment options which define settings as well as
36 * the ability to install a log function.
39 class EnvironmentOptions
50 * non-virtual destructor, not intended as a base class
52 ~EnvironmentOptions();
55 * @param logFunction logging function
57 void SetLogFunction( const Dali::Integration::Log::LogFunction& logFunction );
60 * Install the log function for the current thread.
62 void InstallLogFunction() const;
65 * Un-install the log function for the current thread.
67 void UnInstallLogFunction() const;
70 * @return whether network control is enabled or not ( 0 = off, 1 = on )
72 unsigned int GetNetworkControlMode() const;
75 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
77 unsigned int GetFrameRateLoggingFrequency() const;
80 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
82 unsigned int GetUpdateStatusLoggingFrequency() const;
85 * @return object profiler status interval ( 0 == off )
87 unsigned int GetObjectProfilerInterval() const;
90 * @return performance statistics log level ( 0 == off )
92 unsigned int GetPerformanceStatsLoggingOptions() const;
95 * @return performance statistics log frequency in seconds
97 unsigned int GetPerformanceStatsLoggingFrequency() const;
100 * @return performance time stamp output ( 0 == off)
102 unsigned int GetPerformanceTimeStampOutput() const;
105 * @return pan-gesture logging level ( 0 == off )
107 unsigned int GetPanGestureLoggingLevel() const;
110 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
112 int GetPanGesturePredictionMode() const;
115 * @return pan-gesture prediction amount
117 int GetPanGesturePredictionAmount() const;
120 * @return maximum pan-gesture prediction amount
122 int GetPanGestureMaximumPredictionAmount() const;
125 * @return minimum pan-gesture prediction amount
127 int GetPanGestureMinimumPredictionAmount() const;
130 * @brief Gets the prediction amount to adjust when the pan velocity is changed.
132 * If the pan velocity is accelerating, the prediction amount will be increased
133 * by the specified amount until it reaches the upper bound. If the pan velocity
134 * is decelerating, the prediction amount will be decreased by the specified
135 * amount until it reaches the lower bound.
137 * @return pan-gesture prediction amount adjustment
139 int GetPanGesturePredictionAmountAdjustment() const;
142 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
144 int GetPanGestureSmoothingMode() const;
147 * @return pan-gesture smoothing amount
149 float GetPanGestureSmoothingAmount() const;
152 * @return pan-gesture use actual times is true if real gesture and frame times are to be used.
154 int GetPanGestureUseActualTimes() const;
157 * @return pan-gesture interpolation time range is the time range (ms) of past points to use (with weights) when interpolating.
159 int GetPanGestureInterpolationTimeRange() const;
162 * @return pan-gesture scalar only prediction, when enabled, ignores acceleration.
164 int GetPanGestureScalarOnlyPredictionEnabled() const;
167 * @return pan-gesture two point prediction combines two interpolated points to get more steady acceleration and velocity values.
169 int GetPanGestureTwoPointPredictionEnabled() const;
172 * @return pan-gesture two point interpolate past time is the time delta (ms) in the past to interpolate the second point.
174 int GetPanGestureTwoPointInterpolatePastTime() const;
177 * @return pan-gesture two point velocity bias is the ratio of first and second points to use for velocity.
178 * 0.0f = 100% of first point. 1.0f = 100% of second point.
180 float GetPanGestureTwoPointVelocityBias() const;
183 * @return pan-gesture two point acceleration bias is the ratio of first and second points to use for acceleration.
184 * 0.0f = 100% of first point. 1.0f = 100% of second point.
186 float GetPanGestureTwoPointAccelerationBias() const;
189 * @return pan-gesture multitap smoothing range is the range in time (ms) of points in the history to smooth the final output against.
191 int GetPanGestureMultitapSmoothingRange() const;
194 * @return The minimum distance before a pan can be started (-1 means it's not set)
196 int GetMinimumPanDistance() const;
199 * @return The minimum events before a pan can be started (-1 means it's not set)
201 int GetMinimumPanEvents() const;
204 * @return The width of the window
206 unsigned int GetWindowWidth() const;
209 * @return The height of the window
211 unsigned int GetWindowHeight() const;
214 * @brief Get the graphics status time
216 int GetGlesCallTime() const;
219 * @brief Get whether or not to accumulate gles call statistics
221 bool GetGlesCallAccumulate() const;
224 * @return true if performance server is required
226 bool PerformanceServerRequired() const;
229 * @return Gets the window name.
231 const std::string& GetWindowName() const;
234 * @return Gets the window class.
236 const std::string& GetWindowClassName() const;
239 * @return The thread mode that DALi should use.
241 ThreadingMode::Type GetThreadingMode() const;
244 * @return The render refresh rate.
246 unsigned int GetRenderRefreshRate() const;
251 * Parses the environment options.
252 * Called from the constructor
254 void ParseEnvironmentOptions();
258 std::string mWindowName; ///< name of the window
259 std::string mWindowClassName; ///< name of the class the window belongs to
260 unsigned int mNetworkControl; ///< whether network control is enabled
261 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
262 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
263 unsigned int mObjectProfilerInterval; ///< how often object counts are logged out in seconds
264 unsigned int mPerformanceStatsLevel; ///< performance statistics logging bitmask
265 unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
266 unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
267 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
268 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
269 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
270 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
271 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
272 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
273 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
274 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
275 int mPanGestureUseActualTimes; ///< Disable to optionally override actual times if they make results worse.
276 int mPanGestureInterpolationTimeRange; ///< Time into past history (ms) to use points to interpolate the first point.
277 int mPanGestureScalarOnlyPredictionEnabled; ///< If enabled, prediction is done using velocity alone (no integration or acceleration).
278 int mPanGestureTwoPointPredictionEnabled; ///< If enabled, a second interpolated point is predicted and combined with the first to get more stable values.
279 int mPanGestureTwoPointInterpolatePastTime; ///< The target time in the past to generate the second interpolated point.
280 float mPanGestureTwoPointVelocityBias; ///< The ratio of first and second interpolated points to use for velocity. 0.0f = 100% of first point. 1.0f = 100% of second point.
281 float mPanGestureTwoPointAccelerationBias; ///< The ratio of first and second interpolated points to use for acceleration. 0.0f = 100% of first point. 1.0f = 100% of second point.
282 int mPanGestureMultitapSmoothingRange; ///< The range in time (ms) of points in the history to smooth the final output against.
283 int mPanMinimumDistance; ///< minimum distance required before pan starts
284 int mPanMinimumEvents; ///< minimum events required before pan starts
285 int mGlesCallTime; ///< time in seconds between status updates
286 unsigned int mWindowWidth; ///< width of the window
287 unsigned int mWindowHeight; ///< height of the window
288 ThreadingMode::Type mThreadingMode; ///< threading mode
289 unsigned int mRenderRefreshRate; ///< render refresh rate
290 bool mGlesCallAccumulate; ///< Whether or not to accumulate gles call statistics
292 Dali::Integration::Log::LogFunction mLogFunction;
294 // Undefined copy constructor.
295 EnvironmentOptions( const EnvironmentOptions& );
297 // Undefined assignment operator.
298 EnvironmentOptions& operator=( const EnvironmentOptions& );
306 #endif // __DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H__