update ooo310-m15
[ooovba.git] / applied_patches / 0570-transogl-fix-dual-head.diff
blobdea20dab9a1c79527f38883a15dafb8352ee264c
1 diff -rup slideshow/source/engine/OGLTrans-orig-1/OGLTrans_TransitionerImpl.cxx slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx
2 --- slideshow/source/engine/OGLTrans-orig-1/OGLTrans_TransitionerImpl.cxx 2008-08-27 11:15:30.000000000 +0200
3 +++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-08-28 16:11:46.000000000 +0200
4 @@ -172,8 +172,8 @@ protected:
5 void createTexture( unsigned int* texID,
6 #ifdef GLX_VERSION_1_3
7 unx::GLXPixmap pixmap,
8 -#endif
9 bool usePixmap,
10 +#endif
11 bool useMipmap,
12 uno::Sequence<sal_Int8>& data,
13 const OGLFormat* pFormat );
14 @@ -225,6 +225,9 @@ private:
15 /** pointer to our window which we MIGHT create.
17 class SystemChildWindow* pWindow;
19 + Reference< rendering::XIntegerBitmap > mxLeavingBitmap;
20 + Reference< rendering::XIntegerBitmap > mxEnteringBitmap;
22 /** raw bytes of the entering bitmap
24 @@ -238,6 +241,7 @@ private:
25 unx::GLXPixmap LeavingPixmap;
26 unx::GLXPixmap EnteringPixmap;
27 #endif
28 + bool mbRestoreSync;
29 bool mbUseLeavingPixmap;
30 bool mbUseEnteringPixmap;
31 bool mbFreeLeavingPixmap;
32 @@ -648,13 +652,13 @@ void OGLTransitionerImpl::setSlides( con
33 if (isDisposed())
34 return;
36 - Reference< rendering::XIntegerBitmap > LeavingSlideIntBitmap( xLeavingSlide , UNO_QUERY_THROW );
37 - Reference< rendering::XIntegerBitmap > EnteringSlideIntBitmap( xEnteringSlide , UNO_QUERY_THROW );
38 + mxLeavingBitmap.set( xLeavingSlide , UNO_QUERY_THROW );
39 + mxEnteringBitmap.set( xEnteringSlide , UNO_QUERY_THROW );
40 Reference< XFastPropertySet > xLeavingSet( xLeavingSlide , UNO_QUERY );
41 Reference< XFastPropertySet > xEnteringSet( xEnteringSlide , UNO_QUERY );
43 geometry::IntegerRectangle2D SlideRect;
44 - SlideSize = LeavingSlideIntBitmap->getSize();
45 + SlideSize = mxLeavingBitmap->getSize();
46 SlideRect.X1 = 0;
47 SlideRect.X2 = SlideSize.Width;
48 SlideRect.Y1 = 0;
49 @@ -749,9 +753,9 @@ void OGLTransitionerImpl::setSlides( con
50 #endif
51 #endif
52 if( !mbUseLeavingPixmap )
53 - LeavingBytes = LeavingSlideIntBitmap->getData(SlideBitmapLayout,SlideRect);
54 + LeavingBytes = mxLeavingBitmap->getData(SlideBitmapLayout,SlideRect);
55 if( !mbUseEnteringPixmap )
56 - EnteringBytes = EnteringSlideIntBitmap->getData(SlideBitmapLayout,SlideRect);
57 + EnteringBytes = mxEnteringBitmap->getData(SlideBitmapLayout,SlideRect);
59 // TODO
60 #ifdef UNX
61 @@ -770,14 +774,15 @@ void OGLTransitionerImpl::setSlides( con
62 // I suspect some issues in above code in slideshow
63 // synchronize whole transition for now
64 XSynchronize( GLWin.dpy, true );
65 + mbRestoreSync = true;
66 #endif
69 void OGLTransitionerImpl::createTexture( unsigned int* texID,
70 #ifdef GLX_VERSION_1_3
71 unx::GLXPixmap pixmap,
72 -#endif
73 bool usePixmap,
74 +#endif
75 bool useMipmap,
76 uno::Sequence<sal_Int8>& data,
77 const OGLFormat* pFormat )
78 @@ -1010,8 +1015,8 @@ void OGLTransitionerImpl::GLInitSlides()
79 createTexture( &GLleavingSlide,
80 #ifdef GLX_VERSION_1_3
81 LeavingPixmap,
82 -#endif
83 mbUseLeavingPixmap,
84 +#endif
85 pTransition->mbUseMipMapLeaving,
86 LeavingBytes,
87 pFormat );
88 @@ -1019,8 +1024,8 @@ void OGLTransitionerImpl::GLInitSlides()
89 createTexture( &GLenteringSlide,
90 #ifdef GLX_VERSION_1_3
91 EnteringPixmap,
92 -#endif
93 mbUseEnteringPixmap,
94 +#endif
95 pTransition->mbUseMipMapEntering,
96 EnteringBytes,
97 pFormat );
98 @@ -1047,6 +1052,13 @@ void SAL_CALL OGLTransitionerImpl::updat
99 t3 = microsec_clock::local_time();
100 #endif
102 +#ifdef WNT
103 + wglMakeCurrent(GLWin.hDC,GLWin.hRC);
104 +#endif
105 +#ifdef UNX
106 + glXMakeCurrent( GLWin.dpy, GLWin.win, GLWin.ctx );
107 +#endif
109 glEnable(GL_DEPTH_TEST);
110 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
112 @@ -1083,6 +1095,15 @@ void OGLTransitionerImpl::disposing()
114 osl::MutexGuard const guard( m_aMutex );
116 + OSL_TRACE("dispose %p\n", this);
118 +#ifdef WNT
119 + wglMakeCurrent(GLWin.hDC,GLWin.hRC);
120 +#endif
121 +#ifdef UNX
122 + glXMakeCurrent( GLWin.dpy, GLWin.win, GLWin.ctx );
123 +#endif
125 #ifdef GLX_VERSION_1_3
126 unx::PFNGLXRELEASETEXIMAGEEXTPROC myglXReleaseTexImageEXT = (unx::PFNGLXRELEASETEXIMAGEEXTPROC) unx::glXGetProcAddress( (const GLubyte*) "glXReleaseTexImageEXT" );
127 if( mbUseLeavingPixmap ) {
128 @@ -1113,9 +1134,11 @@ void OGLTransitionerImpl::disposing()
129 pTransition->finish();
131 #ifdef UNX
132 - // try to reestablish synchronize state
133 - char* sal_synchronize = getenv("SAL_SYNCHRONIZE");
134 - XSynchronize( GLWin.dpy, sal_synchronize && *sal_synchronize == '1' );
135 + if( mbRestoreSync ) {
136 + // try to reestablish synchronize state
137 + char* sal_synchronize = getenv("SAL_SYNCHRONIZE");
138 + XSynchronize( GLWin.dpy, sal_synchronize && *sal_synchronize == '1' );
140 #endif
142 #if defined( WNT )
143 @@ -1140,6 +1163,9 @@ void OGLTransitionerImpl::disposing()
144 delete pWindow;
145 if (pTransition)
146 delete pTransition;
148 + mxLeavingBitmap.clear();
149 + mxEnteringBitmap.clear();
152 OGLTransitionerImpl::OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition) :
153 @@ -1150,6 +1176,7 @@ OGLTransitionerImpl::OGLTransitionerImpl
154 pWindow( NULL ),
155 EnteringBytes(),
156 LeavingBytes(),
157 + mbRestoreSync( false ),
158 mbUseLeavingPixmap( false ),
159 mbUseEnteringPixmap( false ),
160 SlideBitmapLayout(),