4976fea19503c91d2dad0363a51c6cb9dee8bdf1
[platform/core/uifw/dali-adaptor.git] / dali / internal / system / common / environment-options.cpp
1 /*
2  * Copyright (c) 2019 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 <cstdlib>
23 #include <dali/integration-api/render-controller.h>
24 #include <dali/public-api/math/math-utils.h>
25
26 // INTERNAL INCLUDES
27 #include <dali/internal/trace/common/trace-factory.h>
28 #include <dali/internal/system/common/environment-variables.h>
29
30 namespace Dali
31 {
32
33 namespace Internal
34 {
35
36 namespace Adaptor
37 {
38
39 namespace
40 {
41 const unsigned int DEFAULT_STATISTICS_LOG_FREQUENCY = 2;
42 const int DEFAULT_MULTI_SAMPLING_LEVEL = -1;
43 const bool DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING = true;
44 const bool DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING = true;
45 const bool DEFAULT_PARTIAL_UPDATE_REQUIRED_SETTING = true;
46
47 unsigned int GetIntegerEnvironmentVariable( const char* variable, unsigned int defaultValue )
48 {
49   const char* variableParameter = std::getenv(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 GetIntegerEnvironmentVariable( const char* variable, int& intValue )
57 {
58   const char* variableParameter = std::getenv(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 GetFloatEnvironmentVariable( const char* variable, float& floatValue )
70 {
71   const char* variableParameter = std::getenv(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 const char * GetCharEnvironmentVariable( const char * variable )
83 {
84   return std::getenv( variable );
85 }
86
87 } // unnamed namespace
88
89 EnvironmentOptions::EnvironmentOptions()
90 : mLogFunction( NULL ),
91   mWindowName(),
92   mWindowClassName(),
93   mNetworkControl( 0 ),
94   mFpsFrequency( 0 ),
95   mUpdateStatusFrequency( 0 ),
96   mObjectProfilerInterval( 0 ),
97   mPerformanceStatsLevel( 0 ),
98   mPerformanceStatsFrequency( DEFAULT_STATISTICS_LOG_FREQUENCY ),
99   mPerformanceTimeStampOutput( 0 ),
100   mPanGestureLoggingLevel( 0 ),
101   mWindowWidth( 0u ),
102   mWindowHeight( 0u ),
103   mRenderRefreshRate( 1u ),
104   mMaxTextureSize( 0 ),
105   mRenderToFboInterval( 0u ),
106   mPanGesturePredictionMode( -1 ),
107   mPanGesturePredictionAmount( -1 ), ///< only sets value in pan gesture if greater than 0
108   mPanGestureMaxPredictionAmount( -1 ),
109   mPanGestureMinPredictionAmount( -1 ),
110   mPanGesturePredictionAmountAdjustment( -1 ),
111   mPanGestureSmoothingMode( -1 ),
112   mPanGestureSmoothingAmount( -1.0f ),
113   mPanGestureUseActualTimes( -1 ),
114   mPanGestureInterpolationTimeRange( -1 ),
115   mPanGestureScalarOnlyPredictionEnabled( -1 ),
116   mPanGestureTwoPointPredictionEnabled( -1 ),
117   mPanGestureTwoPointInterpolatePastTime( -1 ),
118   mPanGestureTwoPointVelocityBias( -1.0f ),
119   mPanGestureTwoPointAccelerationBias( -1.0f ),
120   mPanGestureMultitapSmoothingRange( -1 ),
121   mPanMinimumDistance( -1 ),
122   mPanMinimumEvents( -1 ),
123   mPinchMinimumDistance( -1.0f ),
124   mPinchMinimumTouchEvents( -1 ),
125   mPinchMinimumTouchEventsAfterStart( -1 ),
126   mRotationMinimumTouchEvents( -1 ),
127   mRotationMinimumTouchEventsAfterStart( -1 ),
128   mLongPressMinimumHoldingTime( -1 ),
129   mGlesCallTime( 0 ),
130   mMultiSamplingLevel( DEFAULT_MULTI_SAMPLING_LEVEL ),
131   mThreadingMode( ThreadingMode::COMBINED_UPDATE_RENDER ),
132   mGlesCallAccumulate( false ),
133   mDepthBufferRequired( DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING ),
134   mStencilBufferRequired( DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING ),
135   mPartialUpdateRequired( DEFAULT_PARTIAL_UPDATE_REQUIRED_SETTING )
136 {
137   ParseEnvironmentOptions();
138 }
139
140 EnvironmentOptions::~EnvironmentOptions()
141 {
142 }
143
144 void EnvironmentOptions::CreateTraceManager( PerformanceInterface* performanceInterface )
145 {
146   mTraceManager = TraceManagerFactory::CreateTraceFactory( performanceInterface );
147 }
148
149 void EnvironmentOptions::InstallTraceFunction() const
150 {
151   if( mTraceManager )
152   {
153     mTraceManager->Initialise();
154   }
155 }
156
157 void EnvironmentOptions::SetLogFunction( const Dali::Integration::Log::LogFunction& logFunction )
158 {
159   mLogFunction = logFunction;
160 }
161
162 void EnvironmentOptions::InstallLogFunction() const
163 {
164   Dali::Integration::Log::InstallLogFunction( mLogFunction );
165 }
166
167 void EnvironmentOptions::UnInstallLogFunction() const
168 {
169   Dali::Integration::Log::UninstallLogFunction();
170 }
171
172 unsigned int EnvironmentOptions::GetNetworkControlMode() const
173 {
174   return mNetworkControl;
175 }
176 unsigned int EnvironmentOptions::GetFrameRateLoggingFrequency() const
177 {
178   return mFpsFrequency;
179 }
180
181 unsigned int EnvironmentOptions::GetUpdateStatusLoggingFrequency() const
182 {
183   return mUpdateStatusFrequency;
184 }
185
186 unsigned int EnvironmentOptions::GetObjectProfilerInterval() const
187 {
188   return mObjectProfilerInterval;
189 }
190
191 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingOptions() const
192 {
193   return mPerformanceStatsLevel;
194 }
195 unsigned int EnvironmentOptions::GetPerformanceStatsLoggingFrequency() const
196 {
197   return mPerformanceStatsFrequency;
198 }
199 unsigned int EnvironmentOptions::GetPerformanceTimeStampOutput() const
200 {
201   return mPerformanceTimeStampOutput;
202 }
203
204 unsigned int EnvironmentOptions::GetPanGestureLoggingLevel() const
205 {
206   return mPanGestureLoggingLevel;
207 }
208
209 int EnvironmentOptions::GetPanGesturePredictionMode() const
210 {
211   return mPanGesturePredictionMode;
212 }
213
214 int EnvironmentOptions::GetPanGesturePredictionAmount() const
215 {
216   return mPanGesturePredictionAmount;
217 }
218
219 int EnvironmentOptions::GetPanGestureMaximumPredictionAmount() const
220 {
221   return mPanGestureMaxPredictionAmount;
222 }
223
224 int EnvironmentOptions::GetPanGestureMinimumPredictionAmount() const
225 {
226   return mPanGestureMinPredictionAmount;
227 }
228
229 int EnvironmentOptions::GetPanGesturePredictionAmountAdjustment() const
230 {
231   return mPanGesturePredictionAmountAdjustment;
232 }
233
234 int EnvironmentOptions::GetPanGestureSmoothingMode() const
235 {
236   return mPanGestureSmoothingMode;
237 }
238
239 float EnvironmentOptions::GetPanGestureSmoothingAmount() const
240 {
241   return mPanGestureSmoothingAmount;
242 }
243
244 int EnvironmentOptions::GetPanGestureUseActualTimes() const
245 {
246   return mPanGestureUseActualTimes;
247 }
248
249 int EnvironmentOptions::GetPanGestureInterpolationTimeRange() const
250 {
251   return mPanGestureInterpolationTimeRange;
252 }
253
254 int EnvironmentOptions::GetPanGestureScalarOnlyPredictionEnabled() const
255 {
256   return mPanGestureScalarOnlyPredictionEnabled;
257 }
258
259 int EnvironmentOptions::GetPanGestureTwoPointPredictionEnabled() const
260 {
261   return mPanGestureTwoPointPredictionEnabled;
262 }
263
264 int EnvironmentOptions::GetPanGestureTwoPointInterpolatePastTime() const
265 {
266   return mPanGestureTwoPointInterpolatePastTime;
267 }
268
269 float EnvironmentOptions::GetPanGestureTwoPointVelocityBias() const
270 {
271   return mPanGestureTwoPointVelocityBias;
272 }
273
274 float EnvironmentOptions::GetPanGestureTwoPointAccelerationBias() const
275 {
276   return mPanGestureTwoPointAccelerationBias;
277 }
278
279 int EnvironmentOptions::GetPanGestureMultitapSmoothingRange() const
280 {
281   return mPanGestureMultitapSmoothingRange;
282 }
283
284 int EnvironmentOptions::GetMinimumPanDistance() const
285 {
286   return mPanMinimumDistance;
287 }
288
289 int EnvironmentOptions::GetMinimumPanEvents() const
290 {
291   return mPanMinimumEvents;
292 }
293
294 float EnvironmentOptions::GetMinimumPinchDistance() const
295 {
296   return mPinchMinimumDistance;
297 }
298
299 int EnvironmentOptions::GetMinimumPinchTouchEvents() const
300 {
301   return mPinchMinimumTouchEvents;
302 }
303
304 int EnvironmentOptions::GetMinimumPinchTouchEventsAfterStart() const
305 {
306   return mPinchMinimumTouchEventsAfterStart;
307 }
308
309 int EnvironmentOptions::GetMinimumRotationTouchEvents() const
310 {
311   return mRotationMinimumTouchEvents;
312 }
313
314 int EnvironmentOptions::GetMinimumRotationTouchEventsAfterStart() const
315 {
316   return mRotationMinimumTouchEventsAfterStart;
317 }
318
319 int EnvironmentOptions::GetLongPressMinimumHoldingTime() const
320 {
321   return mLongPressMinimumHoldingTime;
322 }
323
324 unsigned int EnvironmentOptions::GetWindowWidth() const
325 {
326   return mWindowWidth;
327 }
328
329 unsigned int EnvironmentOptions::GetWindowHeight() const
330 {
331   return mWindowHeight;
332 }
333
334 int EnvironmentOptions::GetGlesCallTime() const
335 {
336   return mGlesCallTime;
337 }
338
339 bool EnvironmentOptions::GetGlesCallAccumulate() const
340 {
341   return mGlesCallAccumulate;
342 }
343
344 const std::string& EnvironmentOptions::GetWindowName() const
345 {
346   return mWindowName;
347 }
348
349 const std::string& EnvironmentOptions::GetWindowClassName() const
350 {
351   return mWindowClassName;
352 }
353
354 ThreadingMode::Type EnvironmentOptions::GetThreadingMode() const
355 {
356   return mThreadingMode;
357 }
358
359 unsigned int EnvironmentOptions::GetRenderRefreshRate() const
360 {
361   return mRenderRefreshRate;
362 }
363
364 int EnvironmentOptions::GetMultiSamplingLevel() const
365 {
366   return mMultiSamplingLevel;
367 }
368
369 unsigned int EnvironmentOptions::GetMaxTextureSize() const
370 {
371   return mMaxTextureSize;
372 }
373
374 unsigned int EnvironmentOptions::GetRenderToFboInterval() const
375 {
376   return mRenderToFboInterval;
377 }
378
379 bool EnvironmentOptions::PerformanceServerRequired() const
380 {
381   return ( ( GetPerformanceStatsLoggingOptions() > 0) ||
382            ( GetPerformanceTimeStampOutput() > 0 ) ||
383            ( GetNetworkControlMode() > 0) );
384 }
385
386 bool EnvironmentOptions::DepthBufferRequired() const
387 {
388   return mDepthBufferRequired;
389 }
390
391 bool EnvironmentOptions::StencilBufferRequired() const
392 {
393   return mStencilBufferRequired;
394 }
395
396 bool EnvironmentOptions::PartialUpdateRequired() const
397 {
398   return mPartialUpdateRequired;
399 }
400
401 void EnvironmentOptions::ParseEnvironmentOptions()
402 {
403   // get logging options
404   mFpsFrequency = GetIntegerEnvironmentVariable( DALI_ENV_FPS_TRACKING, 0 );
405   mUpdateStatusFrequency = GetIntegerEnvironmentVariable( DALI_ENV_UPDATE_STATUS_INTERVAL, 0 );
406   mObjectProfilerInterval = GetIntegerEnvironmentVariable( DALI_ENV_OBJECT_PROFILER_INTERVAL, 0 );
407   mPerformanceStatsLevel = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE_STATS, 0 );
408   mPerformanceStatsFrequency = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PERFORMANCE_STATS_FREQUENCY, 0 );
409   mPerformanceTimeStampOutput = GetIntegerEnvironmentVariable( DALI_ENV_PERFORMANCE_TIMESTAMP_OUTPUT, 0 );
410   mNetworkControl = GetIntegerEnvironmentVariable( DALI_ENV_NETWORK_CONTROL, 0 );
411   mPanGestureLoggingLevel = GetIntegerEnvironmentVariable( DALI_ENV_LOG_PAN_GESTURE, 0 );
412
413   int predictionMode;
414   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_MODE, predictionMode) )
415   {
416     mPanGesturePredictionMode = predictionMode;
417   }
418   int predictionAmount(-1);
419   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT, predictionAmount) )
420   {
421     if( predictionAmount < 0 )
422     {
423       // do not support times in the past
424       predictionAmount = 0;
425     }
426     mPanGesturePredictionAmount = predictionAmount;
427   }
428   int minPredictionAmount(-1);
429   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MIN_PREDICTION_AMOUNT, minPredictionAmount) )
430   {
431     if( minPredictionAmount < 0 )
432     {
433       // do not support times in the past
434       minPredictionAmount = 0;
435     }
436     mPanGestureMinPredictionAmount = minPredictionAmount;
437   }
438   int maxPredictionAmount(-1);
439   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MAX_PREDICTION_AMOUNT, maxPredictionAmount) )
440   {
441     if( minPredictionAmount > -1 && maxPredictionAmount < minPredictionAmount )
442     {
443       // maximum amount should not be smaller than minimum amount
444       maxPredictionAmount = minPredictionAmount;
445     }
446     mPanGestureMaxPredictionAmount = maxPredictionAmount;
447   }
448   int predictionAmountAdjustment(-1);
449   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT_ADJUSTMENT, predictionAmountAdjustment) )
450   {
451     if( predictionAmountAdjustment < 0 )
452     {
453       // negative amount doesn't make sense
454       predictionAmountAdjustment = 0;
455     }
456     mPanGesturePredictionAmountAdjustment = predictionAmountAdjustment;
457   }
458   int smoothingMode;
459   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_SMOOTHING_MODE, smoothingMode) )
460   {
461     mPanGestureSmoothingMode = smoothingMode;
462   }
463   float smoothingAmount = 1.0f;
464   if( GetFloatEnvironmentVariable(DALI_ENV_PAN_SMOOTHING_AMOUNT, smoothingAmount) )
465   {
466     smoothingAmount = Clamp(smoothingAmount, 0.0f, 1.0f);
467     mPanGestureSmoothingAmount = smoothingAmount;
468   }
469
470   int useActualTimes( -1 );
471   if( GetIntegerEnvironmentVariable( DALI_ENV_PAN_USE_ACTUAL_TIMES, useActualTimes ) )
472   {
473     mPanGestureUseActualTimes = useActualTimes == 0 ? 0 : 1;
474   }
475
476   int interpolationTimeRange( -1 );
477   if( GetIntegerEnvironmentVariable( DALI_ENV_PAN_INTERPOLATION_TIME_RANGE, interpolationTimeRange ) )
478   {
479     if( interpolationTimeRange < 0 )
480     {
481       interpolationTimeRange = 0;
482     }
483     mPanGestureInterpolationTimeRange = interpolationTimeRange;
484   }
485
486   int scalarOnlyPredictionEnabled( -1 );
487   if( GetIntegerEnvironmentVariable( DALI_ENV_PAN_SCALAR_ONLY_PREDICTION_ENABLED, scalarOnlyPredictionEnabled ) )
488   {
489     mPanGestureScalarOnlyPredictionEnabled = scalarOnlyPredictionEnabled == 0 ? 0 : 1;
490   }
491
492   int twoPointPredictionEnabled( -1 );
493   if( GetIntegerEnvironmentVariable( DALI_ENV_PAN_TWO_POINT_PREDICTION_ENABLED, twoPointPredictionEnabled ) )
494   {
495     mPanGestureTwoPointPredictionEnabled = twoPointPredictionEnabled == 0 ? 0 : 1;
496   }
497
498   int twoPointPastInterpolateTime( -1 );
499   if( GetIntegerEnvironmentVariable( DALI_ENV_PAN_TWO_POINT_PAST_INTERPOLATE_TIME, twoPointPastInterpolateTime ) )
500   {
501     if( twoPointPastInterpolateTime < 0 )
502     {
503       twoPointPastInterpolateTime = 0;
504     }
505     mPanGestureTwoPointInterpolatePastTime = twoPointPastInterpolateTime;
506   }
507
508   float twoPointVelocityBias = -1.0f;
509   if( GetFloatEnvironmentVariable( DALI_ENV_PAN_TWO_POINT_VELOCITY_BIAS, twoPointVelocityBias ) )
510   {
511     twoPointVelocityBias = Clamp( twoPointVelocityBias, 0.0f, 1.0f );
512     mPanGestureTwoPointVelocityBias = twoPointVelocityBias;
513   }
514
515   float twoPointAccelerationBias = -1.0f;
516   if( GetFloatEnvironmentVariable( DALI_ENV_PAN_TWO_POINT_ACCELERATION_BIAS, twoPointAccelerationBias ) )
517   {
518     twoPointAccelerationBias = Clamp( twoPointAccelerationBias, 0.0f, 1.0f );
519     mPanGestureTwoPointAccelerationBias = twoPointAccelerationBias;
520   }
521
522   int multitapSmoothingRange( -1 );
523   if( GetIntegerEnvironmentVariable( DALI_ENV_PAN_MULTITAP_SMOOTHING_RANGE, multitapSmoothingRange ) )
524   {
525     if( multitapSmoothingRange < 0 )
526     {
527       multitapSmoothingRange = 0;
528     }
529     mPanGestureMultitapSmoothingRange = multitapSmoothingRange;
530   }
531
532   int minimumDistance(-1);
533   if ( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MINIMUM_DISTANCE, minimumDistance ))
534   {
535     mPanMinimumDistance = minimumDistance;
536   }
537
538   int minimumEvents(-1);
539   if ( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MINIMUM_EVENTS, minimumEvents ))
540   {
541     mPanMinimumEvents = minimumEvents;
542   }
543
544   float pinchMinimumDistance = -1.0f;
545   if( GetFloatEnvironmentVariable( DALI_ENV_PINCH_MINIMUM_DISTANCE, pinchMinimumDistance ) )
546   {
547     mPinchMinimumDistance = pinchMinimumDistance;
548   }
549
550   int pinchMinimumTouchEvents = -1;
551   if( GetIntegerEnvironmentVariable( DALI_ENV_PINCH_MINIMUM_TOUCH_EVENTS, pinchMinimumTouchEvents ) )
552   {
553     mPinchMinimumTouchEvents = pinchMinimumTouchEvents;
554   }
555
556   int pinchMinimumTouchEventsAfterStart = -1;
557   if( GetIntegerEnvironmentVariable( DALI_ENV_PINCH_MINIMUM_TOUCH_EVENTS_AFTER_START, pinchMinimumTouchEventsAfterStart ) )
558   {
559     mPinchMinimumTouchEventsAfterStart = pinchMinimumTouchEventsAfterStart;
560   }
561
562   int rotationMinimumTouchEvents = -1;
563   if( GetIntegerEnvironmentVariable( DALI_ENV_ROTATION_MINIMUM_TOUCH_EVENTS, rotationMinimumTouchEvents ) )
564   {
565     mRotationMinimumTouchEvents = rotationMinimumTouchEvents;
566   }
567
568   int rotationMinimumTouchEventsAfterStart = -1;
569   if( GetIntegerEnvironmentVariable( DALI_ENV_ROTATION_MINIMUM_TOUCH_EVENTS_AFTER_START, rotationMinimumTouchEventsAfterStart ) )
570   {
571     mRotationMinimumTouchEventsAfterStart = rotationMinimumTouchEventsAfterStart;
572   }
573
574   int longPressMinimumHoldingTime = -1;
575   if( GetIntegerEnvironmentVariable( DALI_ENV_LONG_PRESS_MINIMUM_HOLDING_TIME, longPressMinimumHoldingTime ) )
576   {
577     mLongPressMinimumHoldingTime = longPressMinimumHoldingTime;
578   }
579
580   int glesCallTime(0);
581   if ( GetIntegerEnvironmentVariable(DALI_GLES_CALL_TIME, glesCallTime ))
582   {
583     mGlesCallTime = glesCallTime;
584   }
585
586   int glesCallAccumulate( 0 );
587   if ( GetIntegerEnvironmentVariable( DALI_GLES_CALL_ACCUMULATE, glesCallAccumulate ) )
588   {
589     mGlesCallAccumulate = glesCallAccumulate != 0;
590   }
591
592   int windowWidth(0), windowHeight(0);
593   if ( GetIntegerEnvironmentVariable( DALI_WINDOW_WIDTH, windowWidth ) && GetIntegerEnvironmentVariable( DALI_WINDOW_HEIGHT, windowHeight ) )
594   {
595     mWindowWidth = windowWidth;
596     mWindowHeight = windowHeight;
597   }
598
599   const char * windowName = GetCharEnvironmentVariable( DALI_WINDOW_NAME );
600   if ( windowName )
601   {
602     mWindowName = windowName;
603   }
604
605   const char * windowClassName = GetCharEnvironmentVariable( DALI_WINDOW_CLASS_NAME );
606   if ( windowClassName )
607   {
608     mWindowClassName = windowClassName;
609   }
610
611   int threadingMode(0);
612   if ( GetIntegerEnvironmentVariable( DALI_THREADING_MODE, threadingMode ) )
613   {
614     switch( threadingMode )
615     {
616       case ThreadingMode::COMBINED_UPDATE_RENDER:
617       {
618         mThreadingMode = static_cast< ThreadingMode::Type >( threadingMode );
619         break;
620       }
621     }
622   }
623
624   int renderRefreshRate(0);
625   if ( GetIntegerEnvironmentVariable( DALI_REFRESH_RATE, renderRefreshRate ) )
626   {
627     // Only change it if it's valid
628     if( renderRefreshRate > 1 )
629     {
630       mRenderRefreshRate = renderRefreshRate;
631     }
632   }
633
634   int multiSamplingLevel( 0 );
635   if( GetIntegerEnvironmentVariable( DALI_ENV_MULTI_SAMPLING_LEVEL, multiSamplingLevel ) )
636   {
637     mMultiSamplingLevel = multiSamplingLevel;
638   }
639
640   int maxTextureSize( 0 );
641   if( GetIntegerEnvironmentVariable( DALI_ENV_MAX_TEXTURE_SIZE, maxTextureSize ) )
642   {
643     if( maxTextureSize > 0 )
644     {
645       mMaxTextureSize = maxTextureSize;
646     }
647   }
648
649   mRenderToFboInterval = GetIntegerEnvironmentVariable( DALI_RENDER_TO_FBO, 0u );
650
651
652   int depthBufferRequired( -1 );
653   if( GetIntegerEnvironmentVariable( DALI_ENV_DISABLE_DEPTH_BUFFER, depthBufferRequired ) )
654   {
655     if( depthBufferRequired > 0 )
656     {
657       mDepthBufferRequired = false;
658       mStencilBufferRequired = false; // Disable stencil buffer as well
659     }
660   }
661
662   int stencilBufferRequired( -1 );
663   if( GetIntegerEnvironmentVariable( DALI_ENV_DISABLE_STENCIL_BUFFER, stencilBufferRequired ) )
664   {
665     if( stencilBufferRequired > 0 )
666     {
667       mStencilBufferRequired = false;
668     }
669   }
670
671   int partialUpdateRequired( -1 );
672   if( GetIntegerEnvironmentVariable( DALI_ENV_DISABLE_PARTIAL_UPDATE, partialUpdateRequired ) )
673   {
674     if( partialUpdateRequired > 0 )
675     {
676       mPartialUpdateRequired = false;
677     }
678   }
679 }
680
681 } // Adaptor
682
683 } // Internal
684
685 } // Dali