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