[dali_2.3.49] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / common / environment-options.cpp
1 /*
2  * Copyright (c) 2024 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/system/common/environment-options.h>
20
21 // EXTERNAL INCLUDES
22 #include <dali/integration-api/render-controller.h>
23 #include <dali/public-api/math/math-utils.h>
24 #include <cstdlib>
25 #include <functional>
26
27 // INTERNAL INCLUDES
28 #include <dali/devel-api/adaptor-framework/environment-variable.h>
29 #include <dali/internal/system/common/environment-variables.h>
30 #include <dali/internal/trace/common/trace-factory.h>
31
32 namespace Dali
33 {
34 namespace Internal
35 {
36 namespace Adaptor
37 {
38 namespace
39 {
40 const unsigned int DEFAULT_STATISTICS_LOG_FREQUENCY        = 2;
41 const int          DEFAULT_MULTI_SAMPLING_LEVEL            = -1;
42 const bool         DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING   = true;
43 const bool         DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING = true;
44 const bool         DEFAULT_PARTIAL_UPDATE_REQUIRED_SETTING = true;
45 const bool         DEFAULT_VSYNC_RENDER_REQUIRED_SETTING   = true;
46
47 unsigned int GetEnvironmentVariable(const char* variable, unsigned int defaultValue)
48 {
49   const char* variableParameter = Dali::EnvironmentVariable::GetEnvironmentVariable(variable);
50
51   // if the parameter exists convert it to an integer, else return the default value
52   unsigned int intValue = variableParameter ? std::atoi(variableParameter) : defaultValue;
53   return intValue;
54 }
55
56 bool GetEnvironmentVariable(const char* variable, int& intValue)
57 {
58   const char* variableParameter = Dali::EnvironmentVariable::GetEnvironmentVariable(variable);
59
60   if(!variableParameter)
61   {
62     return false;
63   }
64   // if the parameter exists convert it to an integer, else return the default value
65   intValue = std::atoi(variableParameter);
66   return true;
67 }
68
69 bool GetEnvironmentVariable(const char* variable, float& floatValue)
70 {
71   const char* variableParameter = Dali::EnvironmentVariable::GetEnvironmentVariable(variable);
72
73   if(!variableParameter)
74   {
75     return false;
76   }
77   // if the parameter exists convert it to an integer, else return the default value
78   floatValue = std::atof(variableParameter);
79   return true;
80 }
81
82 void SetFromEnvironmentVariable(const char* variable, std::string& stringValue)
83 {
84   const char* charValue = Dali::EnvironmentVariable::GetEnvironmentVariable(variable);
85   if(charValue)
86   {
87     stringValue = charValue;
88   }
89 }
90
91 template<typename Type>
92 void SetFromEnvironmentVariable(const char* variable, Type& memberVariable)
93 {
94   Type envVarValue = -1;
95   if(GetEnvironmentVariable(variable, envVarValue))
96   {
97     memberVariable = envVarValue;
98   }
99 }
100
101 template<typename Type>
102 void SetFromEnvironmentVariable(const char* variable, std::function<void(Type)> function)
103 {
104   Type envVarValue = -1;
105   if(GetEnvironmentVariable(variable, envVarValue))
106   {
107     function(envVarValue);
108   }
109 }
110
111 /// Provides a functor which ensures a non-negative number is set for the given member variable
112 struct MinimumZero
113 {
114   MinimumZero(int& memberValue)
115   : mMemberValue(memberValue)
116   {
117   }
118
119   void operator()(int value)
120   {
121     // Negative Amounts do not make sense
122     mMemberValue = std::max(0, value);
123   }
124
125   int& mMemberValue;
126 };
127
128 /// Provides a functor which clamps the environment variable between 0.0f and 1.0f
129 struct ClampBetweenZeroAndOne
130 {
131   ClampBetweenZeroAndOne(float& memberValue)
132   : mMemberValue(memberValue)
133   {
134   }
135
136   void operator()(float value)
137   {
138     value        = Clamp(value, 0.0f, 1.0f);
139     mMemberValue = value;
140   }
141
142   float& mMemberValue;
143 };
144
145 /// Provides a functor which only sets the member variable if the environment variable value is greater than the specified constant
146 struct GreaterThan
147 {
148   GreaterThan(unsigned int& memberValue, int greaterThanValue)
149   : mMemberValue(memberValue),
150     mGreaterThanValue(greaterThanValue)
151   {
152   }
153
154   void operator()(int value)
155   {
156     if(value > mGreaterThanValue)
157     {
158       mMemberValue = value;
159     }
160   }
161
162   unsigned int& mMemberValue;
163   const int     mGreaterThanValue;
164 };
165
166 /// Provides a functor which sets the member to 1 if if the environment variable value is not zero
167 struct EnableIfNonZero
168 {
169   EnableIfNonZero(int& memberValue)
170   : mMemberValue(memberValue)
171   {
172   }
173
174   void operator()(int value)
175   {
176     mMemberValue = (value == 0) ? 0 : 1;
177   }
178
179   int& mMemberValue;
180 };
181
182 /// Provides a functor which sets the member to false if the environment variable value is not zero
183 struct DisableIfNonZero
184 {
185   DisableIfNonZero(bool& memberValue)
186   : mMemberValue(memberValue)
187   {
188   }
189
190   void operator()(int value)
191   {
192     if(value > 0)
193     {
194       mMemberValue = false;
195     }
196   }
197
198   bool& mMemberValue;
199 };
200
201 } // unnamed namespace
202
203 EnvironmentOptions::EnvironmentOptions()
204 : mLogFunction(NULL),
205   mWindowName(),
206   mWindowClassName(),
207   mNetworkControl(0),
208   mFpsFrequency(0),
209   mUpdateStatusFrequency(0),
210   mObjectProfilerInterval(0),
211   mMemoryPoolInterval(0),
212   mPerformanceStatsLevel(0),
213   mPerformanceStatsFrequency(DEFAULT_STATISTICS_LOG_FREQUENCY),
214   mPerformanceTimeStampOutput(0),
215   mPanGestureLoggingLevel(0),
216   mWindowWidth(0u),
217   mWindowHeight(0u),
218   mRenderRefreshRate(1u),
219   mMaxTextureSize(0),
220   mRenderToFboInterval(0u),
221   mPanGesturePredictionMode(-1),
222   mPanGesturePredictionAmount(-1), ///< only sets value in pan gesture if greater than 0
223   mPanGestureMaxPredictionAmount(-1),
224   mPanGestureMinPredictionAmount(-1),
225   mPanGesturePredictionAmountAdjustment(-1),
226   mPanGestureSmoothingMode(-1),
227   mPanGestureSmoothingAmount(-1.0f),
228   mPanGestureUseActualTimes(-1),
229   mPanGestureInterpolationTimeRange(-1),
230   mPanGestureScalarOnlyPredictionEnabled(-1),
231   mPanGestureTwoPointPredictionEnabled(-1),
232   mPanGestureTwoPointInterpolatePastTime(-1),
233   mPanGestureTwoPointVelocityBias(-1.0f),
234   mPanGestureTwoPointAccelerationBias(-1.0f),
235   mPanGestureMultitapSmoothingRange(-1),
236   mPanMinimumDistance(-1),
237   mPanMinimumEvents(-1),
238   mPinchMinimumDistance(-1.0f),
239   mPinchMinimumTouchEvents(-1),
240   mPinchMinimumTouchEventsAfterStart(-1),
241   mRotationMinimumTouchEvents(-1),
242   mRotationMinimumTouchEventsAfterStart(-1),
243   mLongPressMinimumHoldingTime(-1),
244   mTapMaximumAllowedTime(-1),
245   mGlesCallTime(0),
246   mMultiSamplingLevel(DEFAULT_MULTI_SAMPLING_LEVEL),
247   mThreadingMode(ThreadingMode::COMBINED_UPDATE_RENDER),
248   mGlesCallAccumulate(false),
249   mDepthBufferRequired(DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING),
250   mStencilBufferRequired(DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING),
251   mPartialUpdateRequired(DEFAULT_PARTIAL_UPDATE_REQUIRED_SETTING),
252   mVsyncRenderRequired(DEFAULT_VSYNC_RENDER_REQUIRED_SETTING)
253 {
254   ParseEnvironmentOptions();
255 }
256
257 EnvironmentOptions::~EnvironmentOptions()
258 {
259 }
260
261 void EnvironmentOptions::CreateTraceManager(PerformanceInterface* performanceInterface)
262 {
263   mTraceManager = TraceManagerFactory::CreateTraceFactory(performanceInterface);
264 }
265
266 void EnvironmentOptions::InstallTraceFunction() const
267 {
268   if(mTraceManager)
269   {
270     mTraceManager->Initialise();
271   }
272 }
273
274 void EnvironmentOptions::SetLogFunction(const Dali::Integration::Log::LogFunction& logFunction)
275 {
276   mLogFunction = logFunction;
277 }
278
279 void EnvironmentOptions::InstallLogFunction() const
280 {
281   Dali::Integration::Log::InstallLogFunction(mLogFunction);
282 }
283
284 void EnvironmentOptions::UnInstallLogFunction() const
285 {
286   Dali::Integration::Log::UninstallLogFunction();
287 }
288
289 unsigned int EnvironmentOptions::GetNetworkControlMode() const
290 {
291   return mNetworkControl;
292 }
293 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
294 {
295   return mFpsFrequency;
296 }
297
298 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
299 {
300   return mUpdateStatusFrequency;
301 }
302
303 unsigned int EnvironmentOptions::GetObjectProfilerInterval() const
304 {
305   return mObjectProfilerInterval;
306 }
307 unsigned int EnvironmentOptions::GetMemoryPoolInterval() const
308 {
309   return mMemoryPoolInterval;
310 }
311 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingOptions() const
312 {
313   return mPerformanceStatsLevel;
314 }
315 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingFrequency() const
316 {
317   return mPerformanceStatsFrequency;
318 }
319 unsigned int EnvironmentOptions::GetPerformanceTimeStampOutput() const
320 {
321   return mPerformanceTimeStampOutput;
322 }
323
324 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
325 {
326   return mPanGestureLoggingLevel;
327 }
328
329 int EnvironmentOptions::GetPanGesturePredictionMode() const
330 {
331   return mPanGesturePredictionMode;
332 }
333
334 int EnvironmentOptions::GetPanGesturePredictionAmount() const
335 {
336   return mPanGesturePredictionAmount;
337 }
338
339 int EnvironmentOptions::GetPanGestureMaximumPredictionAmount() const
340 {
341   return mPanGestureMaxPredictionAmount;
342 }
343
344 int EnvironmentOptions::GetPanGestureMinimumPredictionAmount() const
345 {
346   return mPanGestureMinPredictionAmount;
347 }
348
349 int EnvironmentOptions::GetPanGesturePredictionAmountAdjustment() const
350 {
351   return mPanGesturePredictionAmountAdjustment;
352 }
353
354 int EnvironmentOptions::GetPanGestureSmoothingMode() const
355 {
356   return mPanGestureSmoothingMode;
357 }
358
359 float EnvironmentOptions::GetPanGestureSmoothingAmount() const
360 {
361   return mPanGestureSmoothingAmount;
362 }
363
364 int EnvironmentOptions::GetPanGestureUseActualTimes() const
365 {
366   return mPanGestureUseActualTimes;
367 }
368
369 int EnvironmentOptions::GetPanGestureInterpolationTimeRange() const
370 {
371   return mPanGestureInterpolationTimeRange;
372 }
373
374 int EnvironmentOptions::GetPanGestureScalarOnlyPredictionEnabled() const
375 {
376   return mPanGestureScalarOnlyPredictionEnabled;
377 }
378
379 int EnvironmentOptions::GetPanGestureTwoPointPredictionEnabled() const
380 {
381   return mPanGestureTwoPointPredictionEnabled;
382 }
383
384 int EnvironmentOptions::GetPanGestureTwoPointInterpolatePastTime() const
385 {
386   return mPanGestureTwoPointInterpolatePastTime;
387 }
388
389 float EnvironmentOptions::GetPanGestureTwoPointVelocityBias() const
390 {
391   return mPanGestureTwoPointVelocityBias;
392 }
393
394 float EnvironmentOptions::GetPanGestureTwoPointAccelerationBias() const
395 {
396   return mPanGestureTwoPointAccelerationBias;
397 }
398
399 int EnvironmentOptions::GetPanGestureMultitapSmoothingRange() const
400 {
401   return mPanGestureMultitapSmoothingRange;
402 }
403
404 int EnvironmentOptions::GetMinimumPanDistance() const
405 {
406   return mPanMinimumDistance;
407 }
408
409 int EnvironmentOptions::GetMinimumPanEvents() const
410 {
411   return mPanMinimumEvents;
412 }
413
414 float EnvironmentOptions::GetMinimumPinchDistance() const
415 {
416   return mPinchMinimumDistance;
417 }
418
419 int EnvironmentOptions::GetMinimumPinchTouchEvents() const
420 {
421   return mPinchMinimumTouchEvents;
422 }
423
424 int EnvironmentOptions::GetMinimumPinchTouchEventsAfterStart() const
425 {
426   return mPinchMinimumTouchEventsAfterStart;
427 }
428
429 int EnvironmentOptions::GetMinimumRotationTouchEvents() const
430 {
431   return mRotationMinimumTouchEvents;
432 }
433
434 int EnvironmentOptions::GetMinimumRotationTouchEventsAfterStart() const
435 {
436   return mRotationMinimumTouchEventsAfterStart;
437 }
438
439 int EnvironmentOptions::GetLongPressMinimumHoldingTime() const
440 {
441   return mLongPressMinimumHoldingTime;
442 }
443
444 int EnvironmentOptions::GetTapMaximumAllowedTime() const
445 {
446   return mTapMaximumAllowedTime;
447 }
448
449 unsigned int EnvironmentOptions::GetWindowWidth() const
450 {
451   return mWindowWidth;
452 }
453
454 unsigned int EnvironmentOptions::GetWindowHeight() const
455 {
456   return mWindowHeight;
457 }
458
459 int EnvironmentOptions::GetGlesCallTime() const
460 {
461   return mGlesCallTime;
462 }
463
464 bool EnvironmentOptions::GetGlesCallAccumulate() const
465 {
466   return mGlesCallAccumulate;
467 }
468
469 const std::string& EnvironmentOptions::GetWindowName() const
470 {
471   return mWindowName;
472 }
473
474 const std::string& EnvironmentOptions::GetWindowClassName() const
475 {
476   return mWindowClassName;
477 }
478
479 ThreadingMode::Type EnvironmentOptions::GetThreadingMode() const
480 {
481   return mThreadingMode;
482 }
483
484 unsigned int EnvironmentOptions::GetRenderRefreshRate() const
485 {
486   return mRenderRefreshRate;
487 }
488
489 int EnvironmentOptions::GetMultiSamplingLevel() const
490 {
491   return mMultiSamplingLevel;
492 }
493
494 unsigned int EnvironmentOptions::GetMaxTextureSize() const
495 {
496   return mMaxTextureSize;
497 }
498
499 unsigned int EnvironmentOptions::GetRenderToFboInterval() const
500 {
501   return mRenderToFboInterval;
502 }
503
504 bool EnvironmentOptions::PerformanceServerRequired() const
505 {
506   return ((GetPerformanceStatsLoggingOptions() > 0) ||
507           (GetPerformanceTimeStampOutput() > 0) ||
508           (GetNetworkControlMode() > 0));
509 }
510
511 bool EnvironmentOptions::DepthBufferRequired() const
512 {
513   return mDepthBufferRequired;
514 }
515
516 bool EnvironmentOptions::StencilBufferRequired() const
517 {
518   return mStencilBufferRequired;
519 }
520
521 bool EnvironmentOptions::PartialUpdateRequired() const
522 {
523   return mPartialUpdateRequired;
524 }
525
526 bool EnvironmentOptions::VsyncRenderRequired() const
527 {
528   return mVsyncRenderRequired;
529 }
530
531 void EnvironmentOptions::ParseEnvironmentOptions()
532 {
533   // get logging options
534   mFpsFrequency               = GetEnvironmentVariable(DALI_ENV_FPS_TRACKING, 0);
535   mUpdateStatusFrequency      = GetEnvironmentVariable(DALI_ENV_UPDATE_STATUS_INTERVAL, 0);
536   mObjectProfilerInterval     = GetEnvironmentVariable(DALI_ENV_OBJECT_PROFILER_INTERVAL, 0);
537   mMemoryPoolInterval         = GetEnvironmentVariable(DALI_ENV_MEMORY_POOL_INTERVAL, 0);
538   mPerformanceStatsLevel      = GetEnvironmentVariable(DALI_ENV_LOG_PERFORMANCE_STATS, 0);
539   mPerformanceStatsFrequency  = GetEnvironmentVariable(DALI_ENV_LOG_PERFORMANCE_STATS_FREQUENCY, 0);
540   mPerformanceTimeStampOutput = GetEnvironmentVariable(DALI_ENV_PERFORMANCE_TIMESTAMP_OUTPUT, 0);
541   mNetworkControl             = GetEnvironmentVariable(DALI_ENV_NETWORK_CONTROL, 0);
542   mPanGestureLoggingLevel     = GetEnvironmentVariable(DALI_ENV_LOG_PAN_GESTURE, 0);
543
544   SetFromEnvironmentVariable(DALI_ENV_PAN_PREDICTION_MODE, mPanGesturePredictionMode);
545   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_PREDICTION_AMOUNT, MinimumZero(mPanGesturePredictionAmount));
546   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_MIN_PREDICTION_AMOUNT, MinimumZero(mPanGestureMinPredictionAmount));
547   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_MAX_PREDICTION_AMOUNT,
548                                   [&](int maxPredictionAmount) {
549                                     if(mPanGestureMinPredictionAmount > -1 && maxPredictionAmount < mPanGestureMinPredictionAmount)
550                                     {
551                                       // maximum amount should not be smaller than minimum amount
552                                       maxPredictionAmount = mPanGestureMinPredictionAmount;
553                                     }
554                                     mPanGestureMaxPredictionAmount = maxPredictionAmount;
555                                   });
556   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_PREDICTION_AMOUNT_ADJUSTMENT, MinimumZero(mPanGesturePredictionAmountAdjustment));
557   SetFromEnvironmentVariable(DALI_ENV_PAN_SMOOTHING_MODE, mPanGestureSmoothingMode);
558   SetFromEnvironmentVariable<float>(DALI_ENV_PAN_SMOOTHING_AMOUNT, ClampBetweenZeroAndOne(mPanGestureSmoothingAmount));
559   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_USE_ACTUAL_TIMES, EnableIfNonZero(mPanGestureUseActualTimes));
560   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_INTERPOLATION_TIME_RANGE, MinimumZero(mPanGestureInterpolationTimeRange));
561   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_SCALAR_ONLY_PREDICTION_ENABLED, EnableIfNonZero(mPanGestureScalarOnlyPredictionEnabled));
562   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_TWO_POINT_PREDICTION_ENABLED, EnableIfNonZero(mPanGestureTwoPointPredictionEnabled));
563   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_TWO_POINT_PAST_INTERPOLATE_TIME, MinimumZero(mPanGestureTwoPointInterpolatePastTime));
564   SetFromEnvironmentVariable<float>(DALI_ENV_PAN_TWO_POINT_VELOCITY_BIAS, ClampBetweenZeroAndOne(mPanGestureTwoPointVelocityBias));
565   SetFromEnvironmentVariable<float>(DALI_ENV_PAN_TWO_POINT_ACCELERATION_BIAS, ClampBetweenZeroAndOne(mPanGestureTwoPointAccelerationBias));
566   SetFromEnvironmentVariable<int>(DALI_ENV_PAN_MULTITAP_SMOOTHING_RANGE, MinimumZero(mPanGestureMultitapSmoothingRange));
567   SetFromEnvironmentVariable(DALI_ENV_PAN_MINIMUM_DISTANCE, mPanMinimumDistance);
568   SetFromEnvironmentVariable(DALI_ENV_PAN_MINIMUM_EVENTS, mPanMinimumEvents);
569
570   SetFromEnvironmentVariable(DALI_ENV_PINCH_MINIMUM_DISTANCE, mPinchMinimumDistance);
571   SetFromEnvironmentVariable(DALI_ENV_PINCH_MINIMUM_TOUCH_EVENTS, mPinchMinimumTouchEvents);
572   SetFromEnvironmentVariable(DALI_ENV_PINCH_MINIMUM_TOUCH_EVENTS_AFTER_START, mPinchMinimumTouchEventsAfterStart);
573
574   SetFromEnvironmentVariable(DALI_ENV_ROTATION_MINIMUM_TOUCH_EVENTS, mRotationMinimumTouchEvents);
575   SetFromEnvironmentVariable(DALI_ENV_ROTATION_MINIMUM_TOUCH_EVENTS_AFTER_START, mRotationMinimumTouchEventsAfterStart);
576
577   SetFromEnvironmentVariable(DALI_ENV_LONG_PRESS_MINIMUM_HOLDING_TIME, mLongPressMinimumHoldingTime);
578   SetFromEnvironmentVariable(DALI_ENV_TAP_MAXIMUM_ALLOWED_TIME, mTapMaximumAllowedTime);
579
580   SetFromEnvironmentVariable(DALI_GLES_CALL_TIME, mGlesCallTime);
581   SetFromEnvironmentVariable<int>(DALI_GLES_CALL_ACCUMULATE, [&](int glesCallAccumulate) { mGlesCallAccumulate = glesCallAccumulate != 0; });
582
583   int windowWidth(0), windowHeight(0);
584   if(GetEnvironmentVariable(DALI_WINDOW_WIDTH, windowWidth) && GetEnvironmentVariable(DALI_WINDOW_HEIGHT, windowHeight))
585   {
586     mWindowWidth  = windowWidth;
587     mWindowHeight = windowHeight;
588   }
589   SetFromEnvironmentVariable(DALI_WINDOW_NAME, mWindowName);
590   SetFromEnvironmentVariable(DALI_WINDOW_CLASS_NAME, mWindowClassName);
591
592   SetFromEnvironmentVariable<int>(DALI_THREADING_MODE,
593                                   [&](int threadingMode) {
594                                     switch(threadingMode)
595                                     {
596                                       case ThreadingMode::COMBINED_UPDATE_RENDER:
597                                       {
598                                         mThreadingMode = static_cast<ThreadingMode::Type>(threadingMode);
599                                         break;
600                                       }
601                                     }
602                                   });
603
604   SetFromEnvironmentVariable<int>(DALI_REFRESH_RATE, GreaterThan(mRenderRefreshRate, 1));
605
606   SetFromEnvironmentVariable(DALI_ENV_MULTI_SAMPLING_LEVEL, mMultiSamplingLevel);
607
608   SetFromEnvironmentVariable<int>(DALI_ENV_MAX_TEXTURE_SIZE, GreaterThan(mMaxTextureSize, 0));
609
610   mRenderToFboInterval = GetEnvironmentVariable(DALI_RENDER_TO_FBO, 0u);
611
612   SetFromEnvironmentVariable<int>(DALI_ENV_DISABLE_DEPTH_BUFFER,
613                                   [&](int depthBufferRequired) {
614                                     if(depthBufferRequired > 0)
615                                     {
616                                       mDepthBufferRequired   = false;
617                                       mStencilBufferRequired = false; // Disable stencil buffer as well
618                                     }
619                                   });
620   SetFromEnvironmentVariable<int>(DALI_ENV_DISABLE_STENCIL_BUFFER, DisableIfNonZero(mStencilBufferRequired));
621
622   SetFromEnvironmentVariable<int>(DALI_ENV_DISABLE_PARTIAL_UPDATE, DisableIfNonZero(mPartialUpdateRequired));
623
624   SetFromEnvironmentVariable<int>(DALI_ENV_DISABLE_VSYNC_RENDER, DisableIfNonZero(mVsyncRenderRequired));
625 }
626
627 } // namespace Adaptor
628
629 } // namespace Internal
630
631 } // namespace Dali