projects
/
platform
/
core
/
uifw
/
dali-adaptor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "[Tizen] Implement partial update"
[platform/core/uifw/dali-adaptor.git]
/
dali
/
internal
/
graphics
/
gles
/
egl-implementation.cpp
diff --git
a/dali/internal/graphics/gles/egl-implementation.cpp
b/dali/internal/graphics/gles/egl-implementation.cpp
index
6001bc6
..
ae95d25
100755
(executable)
--- a/
dali/internal/graphics/gles/egl-implementation.cpp
+++ b/
dali/internal/graphics/gles/egl-implementation.cpp
@@
-35,7
+35,9
@@
namespace
{
namespace
{
+ const uint32_t CHECK_EXTENSION_NUMBER = 2;
const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
const std::string EGL_KHR_SURFACELESS_CONTEXT = "EGL_KHR_surfaceless_context";
+ const std::string EGL_KHR_CREATE_CONTEXT = "EGL_KHR_create_context";
}
namespace Dali
}
namespace Dali
@@
-78,7
+80,9
@@
EglImplementation::EglImplementation( int multiSamplingLevel,
mIsWindow( true ),
mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ),
mIsWindow( true ),
mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE ),
- mIsSurfacelessContextSupported( false )
+ mIsSurfacelessContextSupported( false ),
+ mIsKhrCreateContextSupported( false ),
+ mIsFirstFrameAfterResume( false )
{
}
{
}
@@
-116,14
+120,20
@@
bool EglImplementation::InitializeGles( EGLNativeDisplayType display, bool isOwn
// Query EGL extensions to check whether surfaceless context is supported
const char* const extensionStr = eglQueryString( mEglDisplay, EGL_EXTENSIONS );
// Query EGL extensions to check whether surfaceless context is supported
const char* const extensionStr = eglQueryString( mEglDisplay, EGL_EXTENSIONS );
- std::istringstream stream(
extensionStr
);
+ std::istringstream stream(
extensionStr
);
std::string currentExtension;
std::string currentExtension;
- while ( std::getline( stream, currentExtension, ' ' ) )
+ uint32_t extensionCheckCount = 0;
+ while( std::getline( stream, currentExtension, ' ' ) && extensionCheckCount < CHECK_EXTENSION_NUMBER )
{
{
- if
( currentExtension == EGL_KHR_SURFACELESS_CONTEXT )
+ if( currentExtension == EGL_KHR_SURFACELESS_CONTEXT )
{
mIsSurfacelessContextSupported = true;
{
mIsSurfacelessContextSupported = true;
- break;
+ extensionCheckCount++;
+ }
+ if( currentExtension == EGL_KHR_CREATE_CONTEXT )
+ {
+ mIsKhrCreateContextSupported = true;
+ extensionCheckCount++;
}
}
}
}
@@
-211,8
+221,6
@@
void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eg
if(mIsOwnSurface)
{
if(mIsOwnSurface)
{
- glFinish();
-
eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext );
mCurrentEglContext = eglContext;
eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext );
mCurrentEglContext = eglContext;
@@
-240,8
+248,6
@@
void EglImplementation::MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglS
if(mIsOwnSurface)
{
if(mIsOwnSurface)
{
- glFinish();
-
eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext );
mCurrentEglContext = mEglContext;
eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext );
mCurrentEglContext = mEglContext;
@@
-305,6
+311,11
@@
void EglImplementation::SwapBuffers( EGLSurface& eglSurface )
{
if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
{
{
if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
{
+ if( mIsFirstFrameAfterResume )
+ {
+ DALI_LOG_RELEASE_INFO( "EglImplementation::SwapBuffers: First SwapBuffers call.\n" );
+ mIsFirstFrameAfterResume = false;
+ }
eglSwapBuffers( mEglDisplay, eglSurface );
}
}
eglSwapBuffers( mEglDisplay, eglSurface );
}
}
@@
-348,11
+359,7
@@
bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
if( mGlesVersion >= 30 )
{
if( mGlesVersion >= 30 )
{
-#ifdef _ARCH_ARM_
configAttribs.PushBack( EGL_OPENGL_ES3_BIT_KHR );
configAttribs.PushBack( EGL_OPENGL_ES3_BIT_KHR );
-#else
- configAttribs.PushBack( EGL_OPENGL_ES2_BIT );
-#endif // _ARCH_ARM_
}
else
{
}
else
{
@@
-370,8
+377,7
@@
bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
configAttribs.PushBack( EGL_BLUE_SIZE );
configAttribs.PushBack( 8 );
configAttribs.PushBack( EGL_BLUE_SIZE );
configAttribs.PushBack( 8 );
- // In the previous code, there was a branch for ARM.
- // If there is an issue in only ARM, we need to check here again.
+// For underlay video playback, we also need to set the alpha value of the 24/32bit window.
configAttribs.PushBack( EGL_ALPHA_SIZE );
configAttribs.PushBack( 8 );
configAttribs.PushBack( EGL_ALPHA_SIZE );
configAttribs.PushBack( 8 );
@@
-390,13
+396,16
@@
bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
}
#endif // DALI_PROFILE_UBUNTU
configAttribs.PushBack( EGL_NONE );
}
#endif // DALI_PROFILE_UBUNTU
configAttribs.PushBack( EGL_NONE );
+
+ // Ensure number of configs is set to 1 as on some drivers,
+ // eglChooseConfig succeeds but does not actually create a proper configuration.
if ( ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE ) ||
( numConfigs != 1 ) )
{
if( mGlesVersion >= 30 )
{
mEglConfig = NULL;
if ( ( eglChooseConfig( mEglDisplay, &(configAttribs[0]), &mEglConfig, 1, &numConfigs ) != EGL_TRUE ) ||
( numConfigs != 1 ) )
{
if( mGlesVersion >= 30 )
{
mEglConfig = NULL;
- DALI_LOG_ERROR("Fail to use OpenGL es 3.0. Retring to use OpenGL es 2.0.");
+ DALI_LOG_ERROR("Fail to use OpenGL es 3.0. Retr
y
ing to use OpenGL es 2.0.");
return false;
}
return false;
}
@@
-441,7
+450,7
@@
bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
Integration::Log::LogMessage(Integration::Log::DebugInfo, "Using OpenGL es %d.%d.\n", mGlesVersion / 10, mGlesVersion % 10 );
mContextAttribs.Clear();
Integration::Log::LogMessage(Integration::Log::DebugInfo, "Using OpenGL es %d.%d.\n", mGlesVersion / 10, mGlesVersion % 10 );
mContextAttribs.Clear();
- if( m
GlesVersion >= 30
)
+ if( m
IsKhrCreateContextSupported
)
{
mContextAttribs.Reserve(5);
mContextAttribs.PushBack( EGL_CONTEXT_MAJOR_VERSION_KHR );
{
mContextAttribs.Reserve(5);
mContextAttribs.PushBack( EGL_CONTEXT_MAJOR_VERSION_KHR );
@@
-453,7
+462,7
@@
bool EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
{
mContextAttribs.Reserve(3);
mContextAttribs.PushBack( EGL_CONTEXT_CLIENT_VERSION );
{
mContextAttribs.Reserve(3);
mContextAttribs.PushBack( EGL_CONTEXT_CLIENT_VERSION );
- mContextAttribs.PushBack(
2
);
+ mContextAttribs.PushBack(
mGlesVersion / 10
);
}
mContextAttribs.PushBack( EGL_NONE );
}
mContextAttribs.PushBack( EGL_NONE );
@@
-506,10
+515,10
@@
bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSur
DestroySurface( eglSurface );
// create the EGL surface
DestroySurface( eglSurface );
// create the EGL surface
- CreateSurfaceWindow( window, mColorDepth );
+
EGLSurface newEglSurface =
CreateSurfaceWindow( window, mColorDepth );
// set the context to be current with the new surface
// set the context to be current with the new surface
- MakeContextCurrent(
e
glSurface, eglContext );
+ MakeContextCurrent(
newE
glSurface, eglContext );
return contextLost;
}
return contextLost;
}
@@
-533,6
+542,11
@@
void EglImplementation::SetGlesVersion( const int32_t glesVersion )
mGlesVersion = glesVersion;
}
mGlesVersion = glesVersion;
}
+void EglImplementation::SetFirstFrameAfterResume()
+{
+ mIsFirstFrameAfterResume = true;
+}
+
EGLDisplay EglImplementation::GetDisplay() const
{
return mEglDisplay;
EGLDisplay EglImplementation::GetDisplay() const
{
return mEglDisplay;
@@
-553,6
+567,15
@@
bool EglImplementation::IsSurfacelessContextSupported() const
return mIsSurfacelessContextSupported;
}
return mIsSurfacelessContextSupported;
}
+void EglImplementation::WaitClient()
+{
+ // Wait for EGL to finish executing all rendering calls for the current context
+ if ( eglWaitClient() != EGL_TRUE )
+ {
+ TEST_EGL_ERROR("eglWaitClient");
+ }
+}
+
} // namespace Adaptor
} // namespace Internal
} // namespace Adaptor
} // namespace Internal