ooo-build r12033 - in trunk: . patches/dev300 patches/src680
- From: rodo svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12033 - in trunk: . patches/dev300 patches/src680
- Date: Fri, 28 Mar 2008 10:35:32 +0000 (GMT)
Author: rodo
Date: Fri Mar 28 10:35:32 2008
New Revision: 12033
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12033&view=rev
Log:
2008-03-28 Radek Doulik <rodo novell com>
* patches/dev300/apply: added the new transogl fixes
* patches/src680/apply: added transogl-sync-fix.diff with changed
described below
* build/ooh680-m12/slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx:
do glflush and xsync for every frame to have more fluent animation
on Mesa and possibly others
* patches/src680/apply: added transogl-dispose-fix.diff with
changed described below
* build/ooh680-m12/slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx:
unset current context before destroying it, we were doing that
only when build with debug. call also disposing in initialization
before deleting the transitioner instance. disable mipmaps on Mesa
as valgrind shows invalid read in gluBuild2DMipmaps
Added:
trunk/patches/src680/transogl-dispose-fix.diff
trunk/patches/src680/transogl-sync-fix.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/src680/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Fri Mar 28 10:35:32 2008
@@ -1558,6 +1558,8 @@
transogl-shader-transitions.diff
transogl-mesa-fallback.diff
transogl-shader-transitions-1.diff
+transogl-dispose-fix.diff
+transogl-sync-fix.diff
[ Experimental ]
# sal_uInt32 -> sal_uIntPtr for events on some places
Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply (original)
+++ trunk/patches/src680/apply Fri Mar 28 10:35:32 2008
@@ -1658,6 +1658,8 @@
transogl-shader-transitions.diff
transogl-mesa-fallback.diff
transogl-shader-transitions-1.diff
+transogl-dispose-fix.diff
+transogl-sync-fix.diff
[ Experimental ]
# sal_uInt32 -> sal_uIntPtr for events on some places
Added: trunk/patches/src680/transogl-dispose-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/transogl-dispose-fix.diff Fri Mar 28 10:35:32 2008
@@ -0,0 +1,61 @@
+diff -rup OGLTrans-orig/OGLTrans_TransitionerImpl.cxx OGLTrans/OGLTrans_TransitionerImpl.cxx
+--- OGLTrans-orig/OGLTrans_TransitionerImpl.cxx 2008-03-28 10:20:31.000000000 +0100
++++ OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-03-28 10:55:57.000000000 +0100
+@@ -209,6 +209,7 @@ void OGLTransitionerImpl::initialize( co
+ /* TODO: check for version once the bug in fglrx driver is fixed */
+ cbBrokenTexturesATI = (strcmp( (const char *) glGetString( GL_VENDOR ), "ATI Technologies Inc." ) == 0 );
+
++ instance->disposing();
+ delete instance;
+ initialized = true;
+ }
+@@ -343,6 +344,10 @@ bool OGLTransitionerImpl::initWindowFrom
+ return false;
+ }
+ glXMakeCurrent( GLWin.dpy, GLWin.win, GLWin.ctx );
++ if( glGetError() != GL_NO_ERROR ) {
++ OSL_TRACE("glError: %s\n", (char *)gluErrorString(glGetError()));
++ return false;
++ }
+
+ glEnable(GL_CULL_FACE);
+ glCullFace(GL_BACK);
+@@ -489,7 +494,7 @@ void OGLTransitionerImpl::GLInitSlides()
+
+ glGenTextures(1, &GLleavingSlide);
+ glBindTexture(GL_TEXTURE_2D, GLleavingSlide);
+- if( pTransition && !cbBrokenTexturesATI && !pTransition->mbUseMipMapLeaving) {
++ if( ( pTransition && !pTransition->mbUseMipMapLeaving ) || cbBrokenTexturesATI || cbMesa ) { /* I get invalid read on Mesa in gluBuild2DMipmaps, so disable Mesa as well */
+ glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, SlideSize.Width, SlideSize.Height, 0, Format, GL_UNSIGNED_BYTE, &LeavingBytes[0]);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+@@ -513,7 +518,7 @@ void OGLTransitionerImpl::GLInitSlides()
+
+ glGenTextures(1, &GLenteringSlide);
+ glBindTexture(GL_TEXTURE_2D, GLenteringSlide);
+- if( pTransition && !cbBrokenTexturesATI && !pTransition->mbUseMipMapEntering ) {
++ if( ( pTransition && !pTransition->mbUseMipMapLeaving ) || cbBrokenTexturesATI || cbMesa ) {
+ glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, SlideSize.Width, SlideSize.Height, 0, Format, GL_UNSIGNED_BYTE, &EnteringBytes[0]);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+@@ -566,7 +571,10 @@ void OGLTransitionerImpl::disposing()
+
+ if(GLWin.ctx)
+ {
+- OSL_ENSURE( glXMakeCurrent(GLWin.dpy, None, NULL) , "Error releasing glX context" );
++ glXMakeCurrent(GLWin.dpy, None, NULL);
++ if( glGetError() != GL_NO_ERROR ) {
++ OSL_TRACE("glError: %s\n", (char *)gluErrorString(glGetError()));
++ }
+ glXDestroyContext(GLWin.dpy, GLWin.ctx);
+ GLWin.ctx = NULL;
+ }
+@@ -650,7 +658,7 @@ public:
+ return uno::Reference< presentation::XTransition >();
+
+
+- OGLTransitionImpl* pTransition;
++ OGLTransitionImpl* pTransition = NULL;
+
+ if( transitionType == animations::TransitionType::MISCSHAPEWIPE ) {
+ pTransition = new OGLTransitionImpl();
Added: trunk/patches/src680/transogl-sync-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/transogl-sync-fix.diff Fri Mar 28 10:35:32 2008
@@ -0,0 +1,99 @@
+diff -rup OGLTrans-orig/OGLTrans_TransitionerImpl.cxx OGLTrans/OGLTrans_TransitionerImpl.cxx
+--- OGLTrans-orig/OGLTrans_TransitionerImpl.cxx 2008-03-28 10:20:31.000000000 +0100
++++ OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-03-28 11:22:52.000000000 +0100
+@@ -183,16 +183,6 @@ void OGLTransitionerImpl::initialize( co
+ instance = new OGLTransitionerImpl( NULL );
+ instance->initWindowFromSlideShowView( xView, 0, 0 );
+
+- if( instance->GLWin.HasGLXExtension("GLX_SGI_swap_control" ) ) {
+- // enable vsync
+- typedef GLint (*glXSwapIntervalProc)(GLint);
+- glXSwapIntervalProc glXSwapInterval = (glXSwapIntervalProc) unx::glXGetProcAddress( (const GLubyte*) "glXSwapIntervalSGI" );
+- if( glXSwapInterval ) {
+- glXSwapInterval( 1 );
+- OSL_TRACE("set swap interval to 1 (enable vsync)");
+- }
+- }
+-
+ const GLubyte* version = glGetString( GL_VERSION );
+ if( version && version[0] ) {
+ cnGLVersion = version[0] - '0';
+@@ -209,6 +199,7 @@ void OGLTransitionerImpl::initialize( co
+ /* TODO: check for version once the bug in fglrx driver is fixed */
+ cbBrokenTexturesATI = (strcmp( (const char *) glGetString( GL_VENDOR ), "ATI Technologies Inc." ) == 0 );
+
++ instance->disposing();
+ delete instance;
+ initialized = true;
+ }
+@@ -343,6 +334,20 @@ bool OGLTransitionerImpl::initWindowFrom
+ return false;
+ }
+ glXMakeCurrent( GLWin.dpy, GLWin.win, GLWin.ctx );
++ if( glGetError() != GL_NO_ERROR ) {
++ OSL_TRACE("glError: %s\n", (char *)gluErrorString(glGetError()));
++ return false;
++ }
++
++ if( GLWin.HasGLXExtension("GLX_SGI_swap_control" ) ) {
++ // enable vsync
++ typedef GLint (*glXSwapIntervalProc)(GLint);
++ glXSwapIntervalProc glXSwapInterval = (glXSwapIntervalProc) unx::glXGetProcAddress( (const GLubyte*) "glXSwapIntervalSGI" );
++ if( glXSwapInterval ) {
++ glXSwapInterval( 1 );
++ OSL_TRACE("set swap interval to 1 (enable vsync)");
++ }
++ }
+
+ glEnable(GL_CULL_FACE);
+ glCullFace(GL_BACK);
+@@ -489,7 +494,7 @@ void OGLTransitionerImpl::GLInitSlides()
+
+ glGenTextures(1, &GLleavingSlide);
+ glBindTexture(GL_TEXTURE_2D, GLleavingSlide);
+- if( pTransition && !cbBrokenTexturesATI && !pTransition->mbUseMipMapLeaving) {
++ if( ( pTransition && !pTransition->mbUseMipMapLeaving ) || cbBrokenTexturesATI || cbMesa ) {
+ glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, SlideSize.Width, SlideSize.Height, 0, Format, GL_UNSIGNED_BYTE, &LeavingBytes[0]);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+@@ -513,7 +518,7 @@ void OGLTransitionerImpl::GLInitSlides()
+
+ glGenTextures(1, &GLenteringSlide);
+ glBindTexture(GL_TEXTURE_2D, GLenteringSlide);
+- if( pTransition && !cbBrokenTexturesATI && !pTransition->mbUseMipMapEntering ) {
++ if( ( pTransition && !pTransition->mbUseMipMapLeaving ) || cbBrokenTexturesATI || cbMesa ) {
+ glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, SlideSize.Width, SlideSize.Height, 0, Format, GL_UNSIGNED_BYTE, &EnteringBytes[0]);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
+@@ -552,6 +557,10 @@ void SAL_CALL OGLTransitionerImpl::updat
+ unx::glXSwapBuffers(GLWin.dpy, GLWin.win);
+ if( pWindow )
+ pWindow->Show();
++
++ /* flush & sync */
++ glFlush();
++ XSync( GLWin.dpy, false );
+ }
+
+ // we are about to be disposed (someone call dispose() on us)
+@@ -566,7 +575,10 @@ void OGLTransitionerImpl::disposing()
+
+ if(GLWin.ctx)
+ {
+- OSL_ENSURE( glXMakeCurrent(GLWin.dpy, None, NULL) , "Error releasing glX context" );
++ glXMakeCurrent(GLWin.dpy, None, NULL);
++ if( glGetError() != GL_NO_ERROR ) {
++ OSL_TRACE("glError: %s\n", (char *)gluErrorString(glGetError()));
++ }
+ glXDestroyContext(GLWin.dpy, GLWin.ctx);
+ GLWin.ctx = NULL;
+ }
+@@ -650,7 +662,7 @@ public:
+ return uno::Reference< presentation::XTransition >();
+
+
+- OGLTransitionImpl* pTransition;
++ OGLTransitionImpl* pTransition = NULL;
+
+ if( transitionType == animations::TransitionType::MISCSHAPEWIPE ) {
+ pTransition = new OGLTransitionImpl();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]