1 #ifndef DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
2 #define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
5 * Copyright (c) 2017 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
49 * non-virtual destructor, not intended as a base class
51 ~EnvironmentOptions();
54 * @param logFunction logging function
56 void SetLogFunction( const Dali::Integration::Log::LogFunction& logFunction );
59 * Install the log function for the current thread.
61 void InstallLogFunction() const;
64 * Un-install the log function for the current thread.
66 void UnInstallLogFunction() const;
69 * @return whether network control is enabled or not ( 0 = off, 1 = on )
71 unsigned int GetNetworkControlMode() const;
74 * @return frequency of how often FPS is logged out (e.g. 0 = off, 2 = every 2 seconds).
76 unsigned int GetFrameRateLoggingFrequency() const;
79 * @return frequency of how often Update Status is logged out (e.g. 0 = off, 60 = log every 60 frames = 1 second @ 60FPS).
81 unsigned int GetUpdateStatusLoggingFrequency() const;
84 * @return object profiler status interval ( 0 == off )
86 unsigned int GetObjectProfilerInterval() const;
89 * @return performance statistics log level ( 0 == off )
91 unsigned int GetPerformanceStatsLoggingOptions() const;
94 * @return performance statistics log frequency in seconds
96 unsigned int GetPerformanceStatsLoggingFrequency() const;
99 * @return performance time stamp output ( 0 == off)
101 unsigned int GetPerformanceTimeStampOutput() const;
104 * @return pan-gesture logging level ( 0 == off )
106 unsigned int GetPanGestureLoggingLevel() const;
109 * @return pan-gesture prediction mode ( -1 means not set so no prediction, 0 = no prediction )
111 int GetPanGesturePredictionMode() const;
114 * @return pan-gesture prediction amount
116 int GetPanGesturePredictionAmount() const;
119 * @return maximum pan-gesture prediction amount
121 int GetPanGestureMaximumPredictionAmount() const;
124 * @return minimum pan-gesture prediction amount
126 int GetPanGestureMinimumPredictionAmount() const;
129 * @brief Gets the prediction amount to adjust when the pan velocity is changed.
131 * If the pan velocity is accelerating, the prediction amount will be increased
132 * by the specified amount until it reaches the upper bound. If the pan velocity
133 * is decelerating, the prediction amount will be decreased by the specified
134 * amount until it reaches the lower bound.
136 * @return pan-gesture prediction amount adjustment
138 int GetPanGesturePredictionAmountAdjustment() const;
141 * @return pan-gesture smoothing mode ( -1 means not set so no smoothing, 0 = no smoothing )
143 int GetPanGestureSmoothingMode() const;
146 * @return pan-gesture smoothing amount
148 float GetPanGestureSmoothingAmount() const;
151 * @return The minimum distance before a pan can be started (-1 means it's not set)
153 int GetMinimumPanDistance() const;
156 * @return The minimum events before a pan can be started (-1 means it's not set)
158 int GetMinimumPanEvents() const;
161 * @return The width of the window
163 unsigned int GetWindowWidth() const;
166 * @return The height of the window
168 unsigned int GetWindowHeight() const;
171 * @brief Get the graphics status time
173 int GetGlesCallTime() const;
176 * @brief Get whether or not to accumulate gles call statistics
178 bool GetGlesCallAccumulate() const;
181 * @return true if performance server is required
183 bool PerformanceServerRequired() const;
186 * @return Gets the window name.
188 const std::string& GetWindowName() const;
191 * @return Gets the window class.
193 const std::string& GetWindowClassName() const;
196 * @return The thread mode that DALi should use.
198 ThreadingMode::Type GetThreadingMode() const;
201 * @return The render refresh rate.
203 unsigned int GetRenderRefreshRate() const;
206 * @return The number of samples required in multisample buffers
208 int GetMultiSamplingLevel() const;
211 * @return The maximum texture size
213 unsigned int GetMaxTextureSize() const;
216 * @return The maximum texture size
218 int GetIndicatorVisibleMode() const;
221 * @brief Retrieves the interval of frames to be rendered into the Frame Buffer Object and the Frame Buffer.
223 * @return The number of frames that are going to be rendered into the Frame Buffer Object but the last one which is going to be rendered into the Frame Buffer.
225 unsigned int GetRenderToFboInterval() const;
230 * Parses the environment options.
231 * Called from the constructor
233 void ParseEnvironmentOptions();
237 std::string mWindowName; ///< name of the window
238 std::string mWindowClassName; ///< name of the class the window belongs to
239 unsigned int mNetworkControl; ///< whether network control is enabled
240 unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
241 unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
242 unsigned int mObjectProfilerInterval; ///< how often object counts are logged out in seconds
243 unsigned int mPerformanceStatsLevel; ///< performance statistics logging bitmask
244 unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
245 unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
246 unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
247 int mPanGesturePredictionMode; ///< prediction mode for pan gestures
248 int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
249 int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
250 int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
251 int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
252 int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
253 float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
254 int mPanMinimumDistance; ///< minimum distance required before pan starts
255 int mPanMinimumEvents; ///< minimum events required before pan starts
256 int mGlesCallTime; ///< time in seconds between status updates
257 unsigned int mWindowWidth; ///< width of the window
258 unsigned int mWindowHeight; ///< height of the window
259 ThreadingMode::Type mThreadingMode; ///< threading mode
260 unsigned int mRenderRefreshRate; ///< render refresh rate
261 bool mGlesCallAccumulate; ///< Whether or not to accumulate gles call statistics
262 int mMultiSamplingLevel; ///< The number of samples required in multisample buffers
263 unsigned int mMaxTextureSize; ///< The maximum texture size that GL can handle
264 int mIndicatorVisibleMode; ///< Indicator visible mode
265 unsigned int mRenderToFboInterval; ///< The number of frames that are going to be rendered into the Frame Buffer Object but the last one which is going to be rendered into the Frame Buffer.
267 Dali::Integration::Log::LogFunction mLogFunction;
269 // Undefined copy constructor.
270 EnvironmentOptions( const EnvironmentOptions& );
272 // Undefined assignment operator.
273 EnvironmentOptions& operator=( const EnvironmentOptions& );
281 #endif // DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H