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