{
const unsigned int DEFAULT_STATISTICS_LOG_FREQUENCY = 2;
const int DEFAULT_MULTI_SAMPLING_LEVEL = -1;
+const bool DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING = true;
+const bool DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING = true;
unsigned int GetIntegerEnvironmentVariable( const char* variable, unsigned int defaultValue )
{
} // unnamed namespace
EnvironmentOptions::EnvironmentOptions()
-: mWindowName(),
+: mLogFunction( NULL ),
+ mWindowName(),
mWindowClassName(),
- mNetworkControl(0),
- mFpsFrequency(0),
- mUpdateStatusFrequency(0),
+ mPanGestureSmoothingAmount( -1.0f ),
+ mNetworkControl( 0 ),
+ mFpsFrequency( 0 ),
+ mUpdateStatusFrequency( 0 ),
mObjectProfilerInterval( 0 ),
- mPerformanceStatsLevel(0),
+ mPerformanceStatsLevel( 0 ),
mPerformanceStatsFrequency( DEFAULT_STATISTICS_LOG_FREQUENCY ),
- mPerformanceTimeStampOutput(0),
- mPanGestureLoggingLevel(0),
- mPanGesturePredictionMode(-1),
- mPanGesturePredictionAmount(-1), ///< only sets value in pan gesture if greater than 0
- mPanGestureMaxPredictionAmount(-1),
- mPanGestureMinPredictionAmount(-1),
- mPanGesturePredictionAmountAdjustment(-1),
- mPanGestureSmoothingMode(-1),
- mPanGestureSmoothingAmount(-1.0f),
- mPanMinimumDistance(-1),
- mPanMinimumEvents(-1),
- mGlesCallTime( 0 ),
+ mPerformanceTimeStampOutput( 0 ),
+ mPanGestureLoggingLevel( 0 ),
mWindowWidth( 0u ),
mWindowHeight( 0u ),
- mThreadingMode( ThreadingMode::COMBINED_UPDATE_RENDER ),
mRenderRefreshRate( 1u ),
- mGlesCallAccumulate( false ),
- mMultiSamplingLevel( DEFAULT_MULTI_SAMPLING_LEVEL ),
mMaxTextureSize( 0 ),
- mIndicatorVisibleMode( -1 ),
mRenderToFboInterval( 0u ),
- mLogFunction( NULL )
+ mPanGesturePredictionMode( -1 ),
+ mPanGesturePredictionAmount( -1 ), ///< only sets value in pan gesture if greater than 0
+ mPanGestureMaxPredictionAmount( -1 ),
+ mPanGestureMinPredictionAmount( -1 ),
+ mPanGesturePredictionAmountAdjustment( -1 ),
+ mPanGestureSmoothingMode( -1 ),
+ mPanMinimumDistance( -1 ),
+ mPanMinimumEvents( -1 ),
+ mGlesCallTime( 0 ),
+ mMultiSamplingLevel( DEFAULT_MULTI_SAMPLING_LEVEL ),
+ mIndicatorVisibleMode( -1 ),
+ mThreadingMode( ThreadingMode::COMBINED_UPDATE_RENDER ),
+ mGlesCallAccumulate( false ),
+ mDepthBufferRequired( DEFAULT_DEPTH_BUFFER_REQUIRED_SETTING ),
+ mStencilBufferRequired( DEFAULT_STENCIL_BUFFER_REQUIRED_SETTING )
{
ParseEnvironmentOptions();
}
( GetNetworkControlMode() > 0) );
}
+bool EnvironmentOptions::DepthBufferRequired() const
+{
+ return mDepthBufferRequired;
+}
+
+bool EnvironmentOptions::StencilBufferRequired() const
+{
+ return mStencilBufferRequired;
+}
+
void EnvironmentOptions::ParseEnvironmentOptions()
{
// get logging options
}
mRenderToFboInterval = GetIntegerEnvironmentVariable( DALI_RENDER_TO_FBO, 0u );
+
+
+ int depthBufferRequired( -1 );
+ if( GetIntegerEnvironmentVariable( DALI_ENV_DISABLE_DEPTH_BUFFER, depthBufferRequired ) )
+ {
+ if( depthBufferRequired > 0 )
+ {
+ mDepthBufferRequired = false;
+ mStencilBufferRequired = false; // Disable stencil buffer as well
+ }
+ }
+
+ int stencilBufferRequired( -1 );
+ if( GetIntegerEnvironmentVariable( DALI_ENV_DISABLE_STENCIL_BUFFER, stencilBufferRequired ) )
+ {
+ if( stencilBufferRequired > 0 )
+ {
+ mStencilBufferRequired = false;
+ }
+ }
}
} // Adaptor
*/
unsigned int GetRenderToFboInterval() const;
+ /**
+ * @return Whether the depth buffer is required.
+ */
+ bool DepthBufferRequired() const;
+
+ /**
+ * @return Whether the stencil buffer is required.
+ */
+ bool StencilBufferRequired() const;
+
+ /// Deleted copy constructor.
+ EnvironmentOptions( const EnvironmentOptions& ) = delete;
+
+ /// Deleted move constructor.
+ EnvironmentOptions( const EnvironmentOptions&& ) = delete;
+
+ /// Deleted assignment operator.
+ EnvironmentOptions& operator=( const EnvironmentOptions& ) = delete;
+
+ /// Deleted move assignment operator.
+ EnvironmentOptions& operator=( const EnvironmentOptions&& ) = delete;
+
private: // Internal
/**
private: // Data
+ Dali::Integration::Log::LogFunction mLogFunction;
+
std::string mWindowName; ///< name of the window
std::string mWindowClassName; ///< name of the class the window belongs to
+ float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
unsigned int mNetworkControl; ///< whether network control is enabled
unsigned int mFpsFrequency; ///< how often fps is logged out in seconds
unsigned int mUpdateStatusFrequency; ///< how often update status is logged out in frames
unsigned int mPerformanceStatsFrequency; ///< performance statistics logging frequency (seconds)
unsigned int mPerformanceTimeStampOutput; ///< performance time stamp output ( bitmask)
unsigned int mPanGestureLoggingLevel; ///< pan-gesture log level
+ unsigned int mWindowWidth; ///< width of the window
+ unsigned int mWindowHeight; ///< height of the window
+ unsigned int mRenderRefreshRate; ///< render refresh rate
+ unsigned int mMaxTextureSize; ///< The maximum texture size that GL can handle
+ 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.
int mPanGesturePredictionMode; ///< prediction mode for pan gestures
int mPanGesturePredictionAmount; ///< prediction amount for pan gestures
int mPanGestureMaxPredictionAmount; ///< maximum prediction amount for pan gestures
int mPanGestureMinPredictionAmount; ///< minimum prediction amount for pan gestures
int mPanGesturePredictionAmountAdjustment; ///< adjustment of prediction amount for pan gestures
int mPanGestureSmoothingMode; ///< prediction mode for pan gestures
- float mPanGestureSmoothingAmount; ///< prediction amount for pan gestures
int mPanMinimumDistance; ///< minimum distance required before pan starts
int mPanMinimumEvents; ///< minimum events required before pan starts
int mGlesCallTime; ///< time in seconds between status updates
- unsigned int mWindowWidth; ///< width of the window
- unsigned int mWindowHeight; ///< height of the window
- ThreadingMode::Type mThreadingMode; ///< threading mode
- unsigned int mRenderRefreshRate; ///< render refresh rate
- bool mGlesCallAccumulate; ///< Whether or not to accumulate gles call statistics
int mMultiSamplingLevel; ///< The number of samples required in multisample buffers
- unsigned int mMaxTextureSize; ///< The maximum texture size that GL can handle
int mIndicatorVisibleMode; ///< Indicator visible mode
- 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.
-
- Dali::Integration::Log::LogFunction mLogFunction;
-
- // Undefined copy constructor.
- EnvironmentOptions( const EnvironmentOptions& );
-
- // Undefined assignment operator.
- EnvironmentOptions& operator=( const EnvironmentOptions& );
-
+ ThreadingMode::Type mThreadingMode; ///< threading mode
+ bool mGlesCallAccumulate; ///< Whether or not to accumulate gles call statistics
+ bool mDepthBufferRequired; ///< Whether the depth buffer is required
+ bool mStencilBufferRequired; ///< Whether the stencil buffer is required
};
} // Adaptor
#define DALI_RENDER_TO_FBO "DALI_RENDER_TO_FBO"
+#define DALI_ENV_DISABLE_DEPTH_BUFFER "DALI_DISABLE_DEPTH_BUFFER"
+
+#define DALI_ENV_DISABLE_STENCIL_BUFFER "DALI_DISABLE_STENCIL_BUFFER"
+
} // namespace Adaptor
} // namespace Internal
mGLES = new GlImplementation();
}
- mEglFactory = new EglFactory( mEnvironmentOptions->GetMultiSamplingLevel() );
+ const Integration::DepthBufferAvailable depthBufferAvailable = static_cast< Integration::DepthBufferAvailable >( mEnvironmentOptions->DepthBufferRequired() );
+ const Integration::StencilBufferAvailable stencilBufferAvailable = static_cast< Integration::StencilBufferAvailable >( mEnvironmentOptions->StencilBufferRequired() );
+
+ mEglFactory = new EglFactory( mEnvironmentOptions->GetMultiSamplingLevel(), depthBufferAvailable, stencilBufferAvailable );
EglSyncImplementation* eglSyncImpl = mEglFactory->GetSyncImplementation();
*eglSyncImpl,
*mGestureManager,
dataRetentionPolicy ,
- 0u != mEnvironmentOptions->GetRenderToFboInterval() );
+ ( 0u != mEnvironmentOptions->GetRenderToFboInterval() ) ? Integration::RenderToFrameBuffer::TRUE : Integration::RenderToFrameBuffer::FALSE,
+ depthBufferAvailable,
+ stencilBufferAvailable );
const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval();
if( 0u < timeInterval )
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Adaptor
{
-EglFactory::EglFactory( int multiSamplingLevel )
+EglFactory::EglFactory( int multiSamplingLevel,
+ Integration::DepthBufferAvailable depthBufferRequired,
+ Integration::StencilBufferAvailable stencilBufferRequired )
: mEglImplementation(NULL),
mEglImageExtensions(NULL),
mEglSync(new EglSyncImplementation), // Created early, as needed by Core constructor
- mMultiSamplingLevel( multiSamplingLevel )
+ mMultiSamplingLevel( multiSamplingLevel ),
+ mDepthBufferRequired( depthBufferRequired ),
+ mStencilBufferRequired( stencilBufferRequired )
{
}
EglInterface* EglFactory::Create()
{
// Created by RenderThread (After Core construction)
- mEglImplementation = new EglImplementation( mMultiSamplingLevel );
+ mEglImplementation = new EglImplementation( mMultiSamplingLevel, mDepthBufferRequired, mStencilBufferRequired );
mEglImageExtensions = new EglImageExtensions( mEglImplementation );
mEglSync->Initialize(mEglImplementation); // The sync impl needs the EglDisplay
-#ifndef __DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H__
-#define __DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H__
+#ifndef DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
+#define DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
// EXTERNAL INCLUDES
+#include <dali/integration-api/core-enumerations.h>
// INTERNAL INCLUDES
#include <base/interfaces/egl-factory-interface.h>
class EglFactory : public EglFactoryInterface
{
public:
+
/**
* Constructor
+ * @param[in] multiSamplingLevel The Multi-sampling level required
+ * @param[in] depthBufferRequired Whether the depth buffer is required
+ * @param[in] stencilBufferRequired Whether the stencil buffer is required
*/
- EglFactory( int multiSamplingLevel );
+ EglFactory( int multiSamplingLevel,
+ Integration::DepthBufferAvailable depthBufferRequired,
+ Integration::StencilBufferAvailable stencilBufferRequired );
/**
* Destructor
EglSyncImplementation* mEglSync;
int mMultiSamplingLevel;
+ Integration::DepthBufferAvailable mDepthBufferRequired;
+ Integration::StencilBufferAvailable mStencilBufferRequired;
};
-}
-}
-}
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
-#endif //__DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H__
+#endif // DALI_INTERNAL_ADAPTOR_EGL_FACTORY_IMPL_H
} \
}
-EglImplementation::EglImplementation( int multiSamplingLevel )
- : mEglNativeDisplay(0),
- mEglNativeWindow(0),
- mCurrentEglNativePixmap(0),
- mEglDisplay(0),
- mEglConfig(0),
- mEglContext(0),
- mCurrentEglSurface(0),
- mGlesInitialized(false),
- mIsOwnSurface(true),
- mContextCurrent(false),
- mIsWindow(true),
- mColorDepth(COLOR_DEPTH_24),
- mMultiSamplingLevel( multiSamplingLevel )
+EglImplementation::EglImplementation( int multiSamplingLevel,
+ Integration::DepthBufferAvailable depthBufferRequired,
+ Integration::StencilBufferAvailable stencilBufferRequired )
+: mContextAttribs(),
+ mEglNativeDisplay( 0 ),
+ mEglNativeWindow( 0 ),
+ mCurrentEglNativePixmap( 0 ),
+ mEglDisplay( 0 ),
+ mEglConfig( 0 ),
+ mEglContext( 0 ),
+ mCurrentEglSurface( 0 ),
+ mMultiSamplingLevel( multiSamplingLevel ),
+ mColorDepth( COLOR_DEPTH_24 ),
+ mGlesInitialized( false ),
+ mIsOwnSurface( true ),
+ mContextCurrent( false ),
+ mIsWindow( true ),
+ mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
+ mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE )
{
}
#endif // _ARCH_ARM_
configAttribs.PushBack( EGL_DEPTH_SIZE );
- configAttribs.PushBack( 24 );
+ configAttribs.PushBack( mDepthBufferRequired ? 24 : 0 );
configAttribs.PushBack( EGL_STENCIL_SIZE );
- configAttribs.PushBack( 8 );
+ configAttribs.PushBack( mStencilBufferRequired ? 8 : 0 );
+
#ifndef DALI_PROFILE_UBUNTU
if( mMultiSamplingLevel != EGL_DONT_CARE )
{
-#ifndef __DALI_INTERNAL_EGL_IMPLEMENTATION_H__
-#define __DALI_INTERNAL_EGL_IMPLEMENTATION_H__
+#ifndef DALI_INTERNAL_EGL_IMPLEMENTATION_H
+#define DALI_INTERNAL_EGL_IMPLEMENTATION_H
/*
* Copyright (c) 2017 Samsung Electronics Co., Ltd.
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <dali/public-api/common/dali-vector.h>
+#include <dali/integration-api/core-enumerations.h>
// INTERNAL INCLUDES
#include <adaptors/integration-api/egl-interface.h>
class EglImplementation : public EglInterface
{
public:
+
/**
* Constructor
- * @param environmentOptions To check the envirionment options
+ * @param[in] multiSamplingLevel The Multi-sampling level required
+ * @param[in] depthBufferRequired Whether the depth buffer is required
+ * @param[in] stencilBufferRequired Whether the stencil buffer is required
*/
- EglImplementation( int multiSamplingLevel );
+ EglImplementation( int multiSamplingLevel,
+ Integration::DepthBufferAvailable depthBufferRequired,
+ Integration::StencilBufferAvailable stencilBufferRequired );
/**
* Destructor
EGLContext mEglContext;
EGLSurface mCurrentEglSurface;
+ int mMultiSamplingLevel;
+
+ ColorDepth mColorDepth;
+
bool mGlesInitialized;
bool mIsOwnSurface;
bool mContextCurrent;
bool mIsWindow;
- ColorDepth mColorDepth;
-
- int mMultiSamplingLevel;
+ bool mDepthBufferRequired;
+ bool mStencilBufferRequired;
};
} // namespace Adaptor
} // namespace Dali
-#endif // __DALI_INTERNAL_EGL_IMPLEMENTATION_H__
+#endif // DALI_INTERNAL_EGL_IMPLEMENTATION_H
mGlSyncAbstraction,
mGestureManager,
mDataRetentionPolicy,
- false );
+ Integration::RenderToFrameBuffer::FALSE,
+ Integration::DepthBufferAvailable::TRUE,
+ Integration::StencilBufferAvailable::TRUE );
mCore->ContextCreated();
mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );