X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fgl%2Fegl-implementation.cpp;h=7ca4366226921abaa0e8adb84fbaec7e3d84bf95;hb=4a48855d64a579ae90a2f15c5bfc1b69c135dca0;hp=88a7b64f0a09975f21d6aac372f6ac52520d251b;hpb=a176711f865676d91e6bb781c1415f53eb0df19f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/gl/egl-implementation.cpp b/adaptors/common/gl/egl-implementation.cpp index 88a7b64..7ca4366 100644 --- a/adaptors/common/gl/egl-implementation.cpp +++ b/adaptors/common/gl/egl-implementation.cpp @@ -28,6 +28,10 @@ #include #include +// EGL constants use C style casts +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wold-style-cast" + namespace Dali { @@ -48,7 +52,7 @@ namespace Adaptor } \ } -EglImplementation::EglImplementation() +EglImplementation::EglImplementation( int multiSamplingLevel ) : mEglNativeDisplay(0), mEglNativeWindow(0), mCurrentEglNativePixmap(0), @@ -60,7 +64,8 @@ EglImplementation::EglImplementation() mIsOwnSurface(true), mContextCurrent(false), mIsWindow(true), - mColorDepth(COLOR_DEPTH_24) + mColorDepth(COLOR_DEPTH_24), + mMultiSamplingLevel( multiSamplingLevel ) { } @@ -150,6 +155,8 @@ void EglImplementation::DestroySurface() { if(mIsOwnSurface && mCurrentEglSurface) { + // Make context null to prevent crash in driver side + MakeContextNull(); eglDestroySurface( mEglDisplay, mCurrentEglSurface ); mCurrentEglSurface = 0; } @@ -216,9 +223,7 @@ void EglImplementation::TerminateGles() { 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) @@ -329,10 +334,13 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth ) 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 ); @@ -460,3 +468,5 @@ EGLDisplay EglImplementation::GetContext() const } // namespace Internal } // namespace Dali + +#pragma GCC diagnostic pop