ooo-build r12075 - in trunk: . patches/src680



Author: rodo
Date: Tue Apr  1 15:28:03 2008
New Revision: 12075
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12075&view=rev

Log:
2008-04-01  Radek Doulik  <rodo novell com>

	* patches/src680/apply: added transogl-detect-fix.diff with
	changes described below

	* build/ooh680-m12/slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx:
	better detect whether GLX is present. Also fix vendor detection
	problem.



Added:
   trunk/patches/src680/transogl-detect-fix.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Tue Apr  1 15:28:03 2008
@@ -1668,6 +1668,7 @@
 transogl-shader-transitions-1.diff
 transogl-dispose-fix.diff
 transogl-sync-fix.diff
+transogl-detect-fix.diff
 
 [ Experimental ]
 # sal_uInt32 -> sal_uIntPtr for events on some places

Added: trunk/patches/src680/transogl-detect-fix.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/transogl-detect-fix.diff	Tue Apr  1 15:28:03 2008
@@ -0,0 +1,139 @@
+diff -rup slideshow/source/engine/OGLTrans-orig/OGLTrans_TransitionerImpl.cxx slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx
+--- slideshow/source/engine/OGLTrans-orig/OGLTrans_TransitionerImpl.cxx	2008-04-01 15:02:39.000000000 +0200
++++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx	2008-04-01 15:55:15.000000000 +0200
+@@ -88,7 +88,7 @@ public:
+     explicit OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition);
+     bool initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView, double, double);
+     void setSlides( const uno::Reference< rendering::XBitmap >& xLeavingSlide , const uno::Reference< rendering::XBitmap >& xEnteringSlide );
+-    static void initialize( const uno::Reference< presentation::XSlideShowView >& xView );
++    static bool initialize( const uno::Reference< presentation::XSlideShowView >& xView );
+ 
+     // XTransition
+     virtual SAL_CALL void update( double nTime ) throw (uno::RuntimeException);
+@@ -165,6 +165,8 @@ public:
+     /** Whether Mesa is the OpenGL vendor
+      */
+     static bool cbMesa;
++
++    static bool cbGLXPresent;
+ };
+ 
+ // declare the static variables as some gcc versions have problems declaring them automaticaly
+@@ -172,7 +174,7 @@ bool OGLTransitionerImpl::cbBrokenTextur
+ float OGLTransitionerImpl::cnGLVersion;
+ bool OGLTransitionerImpl::cbMesa;
+ 
+-void OGLTransitionerImpl::initialize( const uno::Reference< presentation::XSlideShowView >& xView )
++bool OGLTransitionerImpl::initialize( const uno::Reference< presentation::XSlideShowView >& xView )
+ {
+     // not thread safe
+     static bool initialized = false;
+@@ -181,37 +183,41 @@ void OGLTransitionerImpl::initialize( co
+         OGLTransitionerImpl *instance;
+ 
+         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)");
++        if( 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';
+-            if( version[1] == '.' && version[2] )
+-                cnGLVersion += (version[2] - '0')/10.0;
+-        } else
+-            cnGLVersion = 1.0;
+-        OSL_TRACE("GL version: %s parsed: %f", version, cnGLVersion );
+-
+-        const GLubyte* vendor = glGetString( GL_VENDOR );
+-        cbMesa = ( vendor && strstr( (const char *) vendor, "Mesa" ) );
+-        OSL_TRACE("GL vendor: %s identified as Mesa: %d", vendor, cbMesa );
++            const GLubyte* version = glGetString( GL_VERSION );
++            if( version && version[0] ) {
++                cnGLVersion = version[0] - '0';
++                if( version[1] == '.' && version[2] )
++                    cnGLVersion += (version[2] - '0')/10.0;
++            } else
++                cnGLVersion = 1.0;
++            OSL_TRACE("GL version: %s parsed: %f", version, cnGLVersion );
++
++            const GLubyte* vendor = glGetString( GL_VENDOR );
++            cbMesa = ( vendor && strstr( (const char *) vendor, "Mesa" ) );
++            OSL_TRACE("GL vendor: %s identified as Mesa: %d", vendor, cbMesa );
+ 
+         /* TODO: check for version once the bug in fglrx driver is fixed */
+-        cbBrokenTexturesATI = (strcmp( (const char *) glGetString( GL_VENDOR ), "ATI Technologies Inc." ) == 0 );
++            cbBrokenTexturesATI = (vendor && strcmp( (const char *) vendor, "ATI Technologies Inc." ) == 0 );
++            cbGLXPresent = true;
++        } else
++            cbGLXPresent = false;
+ 
+         delete instance;
+         initialized = true;
+     }
++
++    return cbGLXPresent;
+ }
+ 
+ bool OGLTransitionerImpl::initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView, double, double)
+@@ -235,6 +241,10 @@ bool OGLTransitionerImpl::initWindowFrom
+ 
+     const SystemEnvData* sysData(pPWindow->GetSystemData());
+     GLWin.dpy = reinterpret_cast<unx::Display*>(sysData->pDisplay);
++
++    if( unx::glXQueryExtension( GLWin.dpy, NULL, NULL ) == false )
++        return false;
++
+     GLWin.win = sysData->aWindow;
+     GLWin.screen = unx::XDefaultScreen(GLWin.dpy);
+     unx::XVisualInfo* vi( NULL );
+@@ -538,7 +548,7 @@ void SAL_CALL OGLTransitionerImpl::updat
+ {
+     osl::MutexGuard const guard( m_aMutex );
+ 
+-    if (isDisposed() || pTransition->mnRequiredGLVersion > cnGLVersion)
++    if (isDisposed() || !cbGLXPresent || pTransition->mnRequiredGLVersion > cnGLVersion)
+         return;
+ 
+     glEnable(GL_DEPTH_TEST);
+@@ -642,7 +652,7 @@ public:
+         if( !hasTransition( transitionType, transitionSubType ) )
+             return uno::Reference< presentation::XTransition >();
+ 
+-        OGLTransitionerImpl::initialize( view );
++        bool bGLXPresent = OGLTransitionerImpl::initialize( view );
+ 
+         if( OGLTransitionerImpl::cbMesa && (
+             ( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) ||
+@@ -709,9 +719,11 @@ public:
+ 
+         rtl::Reference<OGLTransitionerImpl> xRes(
+             new OGLTransitionerImpl(pTransition) );
+-        if(!xRes->initWindowFromSlideShowView(view,slideOffset.X,slideOffset.Y))
+-            return uno::Reference< presentation::XTransition >();
+-        xRes->setSlides(leavingBitmap,enteringBitmap);
++        if( bGLXPresent ) {
++            if( !xRes->initWindowFromSlideShowView(view,slideOffset.X,slideOffset.Y))
++                return uno::Reference< presentation::XTransition >();
++            xRes->setSlides(leavingBitmap,enteringBitmap);
++        }
+ 
+         return uno::Reference<presentation::XTransition>(xRes.get());
+     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]