/*
- * Copyright (c) 2016 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.
#include <gl/gl-implementation.h>
#include <gl/egl-debug.h>
+// EGL constants use C style casts
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+
namespace Dali
{
} \
}
-EglImplementation::EglImplementation()
+EglImplementation::EglImplementation( int multiSamplingLevel )
: mEglNativeDisplay(0),
mEglNativeWindow(0),
mCurrentEglNativePixmap(0),
mIsOwnSurface(true),
mContextCurrent(false),
mIsWindow(true),
- mColorDepth(COLOR_DEPTH_24)
+ mColorDepth(COLOR_DEPTH_24),
+ mMultiSamplingLevel( multiSamplingLevel )
{
}
{
if(mIsOwnSurface && mCurrentEglSurface)
{
+ // Make context null to prevent crash in driver side
+ MakeContextNull();
eglDestroySurface( mEglDisplay, mCurrentEglSurface );
mCurrentEglSurface = 0;
}
{
if ( mGlesInitialized )
{
- // in latest Mali DDK (r2p3 ~ r3p0 in April, 2012),
- // MakeContextNull should be called before eglDestroy surface
- // to prevent crash in _mali_surface_destroy_callback
+ // Make context null to prevent crash in driver side
MakeContextNull();
if(mIsOwnSurface && mCurrentEglSurface)
#else // DALI_GLES_VERSION >= 30
- DALI_LOG_WARNING( "Using OpenGL ES 2 \n" );
+ Integration::Log::LogMessage( Integration::Log::DebugInfo, "Using OpenGL ES 2 \n" );
configAttribs.PushBack( EGL_OPENGL_ES2_BIT );
#endif //DALI_GLES_VERSION >= 30
configAttribs.PushBack( EGL_STENCIL_SIZE );
configAttribs.PushBack( 8 );
#ifndef DALI_PROFILE_UBUNTU
- configAttribs.PushBack( EGL_SAMPLES );
- configAttribs.PushBack( 4 );
- configAttribs.PushBack( EGL_SAMPLE_BUFFERS );
- configAttribs.PushBack( 1 );
+ if( mMultiSamplingLevel != EGL_DONT_CARE )
+ {
+ configAttribs.PushBack( EGL_SAMPLES );
+ configAttribs.PushBack( mMultiSamplingLevel );
+ configAttribs.PushBack( EGL_SAMPLE_BUFFERS );
+ configAttribs.PushBack( 1 );
+ }
#endif // DALI_PROFILE_UBUNTU
configAttribs.PushBack( EGL_NONE );
} // namespace Internal
} // namespace Dali
+
+#pragma GCC diagnostic pop