update ooo310-m15
[ooovba.git] / applied_patches / 0560-transogl-shader-transitions.diff
blob546e29bd365af57051e28b9199267fd74466cbbd
1 --- slideshow/source/engine/OGLTrans/makefile.mk.oglshtrans~ 2008-07-07 20:27:31.849846010 +0200
2 +++ slideshow/source/engine/OGLTrans/makefile.mk 2008-07-07 20:58:47.309096487 +0200
3 @@ -52,7 +52,7 @@ ENABLE_EXCEPTIONS=TRUE
4 SLOFILES = \
5 $(SLO)$/OGLTrans_TransitionImpl.obj \
6 $(SLO)$/OGLTrans_TransitionerImpl.obj
7 -
9 DLLPRE=
10 SHL1TARGET=$(TARGET).uno
12 --- slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx.oglshtrans~ 2008-07-07 20:56:19.994847050 +0200
13 +++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-07-07 21:05:13.163096087 +0200
14 @@ -91,7 +91,7 @@ class OGLTransitionerImpl : private cppu
16 public:
17 explicit OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition);
18 - void initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView, double, double);
19 + bool initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView, double, double);
20 void setSlides( const uno::Reference< rendering::XBitmap >& xLeavingSlide , const uno::Reference< rendering::XBitmap >& xEnteringSlide );
22 // XTransition
23 @@ -168,15 +168,18 @@ private:
25 /** whether we are running on ATI fglrx with bug related to textures
27 - bool bBrokenTexturesATI;
28 + bool mbBrokenTexturesATI;
30 + /* GL version */
31 + float mnGLVersion;
34 -void OGLTransitionerImpl::initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView, double, double)
35 +bool OGLTransitionerImpl::initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView, double, double)
37 osl::MutexGuard const guard( m_aMutex );
39 if (isDisposed())
40 - return;
41 + return false;
43 /// take the XSlideShowView and extract the parent window from it. see viewmediashape.cxx
44 uno::Reference< rendering::XCanvas > xCanvas(xView->getCanvas(), uno::UNO_QUERY_THROW);
45 @@ -312,6 +315,10 @@ void OGLTransitionerImpl::initWindowFrom
46 vi,
48 GL_TRUE);
49 + if( glGetError() != GL_NO_ERROR ) {
50 + OSL_TRACE("glError: %s\n", (char *)gluErrorString(glGetError()));
51 + return false;
52 + }
53 #endif
55 #if defined( WNT )
56 @@ -351,8 +358,18 @@ void OGLTransitionerImpl::initWindowFrom
57 OSL_TRACE("set swap interval to 1 (enable vsync)");
61 + const GLubyte* version = glGetString( GL_VERSION );
62 + if( version && version[0] ) {
63 + mnGLVersion = version[0] - '0';
64 + if( version[1] == '.' && version[2] )
65 + mnGLVersion += (version[2] - '0')/10.0;
66 + } else
67 + mnGLVersion = 1.0;
68 + OSL_TRACE("GL version: %s parsed: %f", version, mnGLVersion );
70 /* TODO: check for version once the bug in fglrx driver is fixed */
71 - bBrokenTexturesATI = (strcmp( (const char *) glGetString( GL_VENDOR ), "ATI Technologies Inc." ) == 0 );
72 + mbBrokenTexturesATI = (strcmp( (const char *) glGetString( GL_VENDOR ), "ATI Technologies Inc." ) == 0 );
73 #endif
74 glEnable(GL_CULL_FACE);
75 glCullFace(GL_BACK);
76 @@ -375,8 +392,10 @@ void OGLTransitionerImpl::initWindowFrom
77 if( LeavingBytes.hasElements() && EnteringBytes.hasElements())
78 GLInitSlides();//we already have uninitialized slides, let's initialize
80 - if (pTransition)
81 - pTransition->prepare ();
82 + if( pTransition && pTransition->mnRequiredGLVersion <= mnGLVersion )
83 + pTransition->prepare( GLleavingSlide, GLenteringSlide );
85 + return true;
88 void OGLTransitionerImpl::setSlides( const uno::Reference< rendering::XBitmap >& xLeavingSlide,
89 @@ -453,7 +472,7 @@ void OGLTransitionerImpl::GLInitSlides()
91 osl::MutexGuard const guard( m_aMutex );
93 - if (isDisposed())
94 + if (isDisposed() || pTransition->mnRequiredGLVersion > mnGLVersion)
95 return;
97 glMatrixMode(GL_PROJECTION);
98 @@ -624,7 +643,7 @@ void OGLTransitionerImpl::GLInitSlides()
100 else
102 - if( pTransition && !bBrokenTexturesATI && !pTransition->mbUseMipMapLeaving) {
103 + if( pTransition && !mbBrokenTexturesATI && !pTransition->mbUseMipMapLeaving) {
104 glTexImage2D(GL_TEXTURE_2D, 0, pDetectedFormat->nInternalFormat, SlideSize.Width,
105 SlideSize.Height, &LeavingBytes[0]);
106 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
107 @@ -680,7 +699,7 @@ void OGLTransitionerImpl::GLInitSlides()
109 else
111 - if( pTransition && !bBrokenTexturesATI && !pTransition->mbUseMipMapEntering ) {
112 + if( pTransition && !mbBrokenTexturesATI && !pTransition->mbUseMipMapEntering ) {
113 glTexImage2D(GL_TEXTURE_2D, 0, pDetectedFormat->nInternalFormat, SlideSize.Width, SlideSize.Height, 0, Format, GL_UNSIGNED_BYTE, &EnteringBytes[0]);
114 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
115 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
116 @@ -712,14 +731,14 @@ void SAL_CALL OGLTransitionerImpl::updat
118 osl::MutexGuard const guard( m_aMutex );
120 - if (isDisposed())
121 + if (isDisposed() || pTransition->mnRequiredGLVersion > mnGLVersion)
122 return;
125 glEnable(GL_DEPTH_TEST);
126 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
128 if(pTransition)
129 - pTransition->display( nTime , GLleavingSlide , GLenteringSlide ,
130 + pTransition->display( nTime, GLleavingSlide, GLenteringSlide,
131 SlideSize.Width, SlideSize.Height,
132 static_cast<double>(GLWin.Width),
133 static_cast<double>(GLWin.Height) );
134 @@ -811,6 +830,8 @@ public:
135 case animations::TransitionSubType::BOTTOMRIGHT:
136 case animations::TransitionSubType::BOTTOMLEFT:
137 case animations::TransitionSubType::TOPCENTER:
138 + case animations::TransitionSubType::RIGHTCENTER:
139 + case animations::TransitionSubType::BOTTOMCENTER:
140 return sal_True;
142 default:
143 @@ -832,6 +853,9 @@ public:
144 const uno::Reference< rendering::XBitmap >& enteringBitmap,
145 const geometry::RealPoint2D& slideOffset ) throw (uno::RuntimeException)
147 + if( !hasTransition( transitionType, transitionSubType ) )
148 + return uno::Reference< presentation::XTransition >();
150 OGLTransitionImpl* pTransition;
152 if( transitionType == animations::TransitionType::MISCSHAPEWIPE ) {
153 @@ -874,8 +898,12 @@ public:
154 case animations::TransitionSubType::TOPCENTER:
155 pTransition->makeVenetianBlinds( false, 6 );
156 break;
157 - default:
158 - return uno::Reference< presentation::XTransition >();
159 + case animations::TransitionSubType::RIGHTCENTER:
160 + pTransition->makeStatic();
161 + break;
162 + case animations::TransitionSubType::BOTTOMCENTER:
163 + pTransition->makeDissolve();
164 + break;
166 } else if( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) {
167 pTransition = new OGLTransitionImpl();
168 @@ -883,13 +911,12 @@ public:
169 } else if( transitionType == animations::TransitionType::IRISWIPE && transitionSubType == animations::TransitionSubType::DIAMOND ) {
170 pTransition = new OGLTransitionImpl();
171 pTransition->makeDiamond();
172 - } else {
173 - return uno::Reference< presentation::XTransition >();
176 rtl::Reference<OGLTransitionerImpl> xRes(
177 new OGLTransitionerImpl(pTransition) );
178 - xRes->initWindowFromSlideShowView(view,slideOffset.X,slideOffset.Y);
179 + if(!xRes->initWindowFromSlideShowView(view,slideOffset.X,slideOffset.Y))
180 + return uno::Reference< presentation::XTransition >();
181 xRes->setSlides(leavingBitmap,enteringBitmap);
183 return uno::Reference<presentation::XTransition>(xRes.get());
184 --- slideshow/source/engine/OGLTrans/OGLTrans_TransitionImpl.cxx.oglshtrans~ 2008-07-07 20:49:22.350096529 +0200
185 +++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionImpl.cxx 2008-07-07 20:59:53.626846367 +0200
186 @@ -27,9 +27,11 @@
187 * for a copy of the LGPLv3 License.
189 ************************************************************************/
190 +#define GL_GLEXT_PROTOTYPES 1
191 #include "OGLTrans_TransitionImpl.hxx"
193 #include <GL/gl.h>
194 +#include <GL/glext.h>
195 #include <math.h>
198 @@ -45,6 +47,31 @@ void OGLTransitionImpl::clear()
199 maSceneObjects.clear();
201 mbReflectSlides = false;
203 +#ifdef GL_VERSION_2_0
204 + if( mProgramObject ) {
205 + glDeleteProgram( mProgramObject );
206 + mProgramObject = 0;
209 + if( mVertexObject ) {
210 + glDeleteShader( mVertexObject );
211 + mVertexObject = 0;
214 + if( mFragmentObject ) {
215 + glDeleteShader( mFragmentObject );
216 + mFragmentObject = 0;
218 +#endif
220 + if( maHelperTexture ) {
221 + glDeleteTextures( 1, &maHelperTexture );
222 + maHelperTexture = 0;
225 + if( mmClearTransition )
226 + (this->*mmClearTransition)();
229 OGLTransitionImpl::~OGLTransitionImpl()
230 @@ -52,11 +79,14 @@ OGLTransitionImpl::~OGLTransitionImpl()
231 clear();
234 -void OGLTransitionImpl::prepare()
235 +void OGLTransitionImpl::prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex )
237 for(unsigned int i(0); i < maSceneObjects.size(); ++i) {
238 maSceneObjects[i]->prepare();
241 + if( mmPrepareTransition )
242 + (this->*mmPrepareTransition)( glLeavingSlideTex, glEnteringSlideTex );
245 void OGLTransitionImpl::finish()
246 @@ -984,3 +1014,273 @@ void OGLTransitionImpl::makeFadeSmoothly
247 mmDisplaySlides = &OGLTransitionImpl::displaySlidesFadeSmoothly;
248 mbUseMipMapLeaving = mbUseMipMapEntering = false;
251 +static GLuint linkProgram( const char *vertexShader, const char *fragmentShader )
253 +#ifdef GL_VERSION_2_0
254 + GLhandleARB vertexObject, fragmentObject, programObject;
255 + GLint vertexCompiled, fragmentCompiled, programLinked;
256 + char log[1024];
258 + vertexObject = glCreateShaderObjectARB( GL_VERTEX_SHADER_ARB );
259 + fragmentObject = glCreateShader( GL_FRAGMENT_SHADER );
260 + OSL_TRACE("checkpoint 1: shaders created (%d) vertex: %d fragment: %d", glGetError() == GL_NO_ERROR, vertexObject, fragmentObject );
263 + glShaderSourceARB( vertexObject, 1, &vertexShader, NULL );
264 + glShaderSourceARB( fragmentObject, 1, &fragmentShader, NULL );
266 + glCompileShader( vertexObject );
267 + glGetInfoLogARB( vertexObject, sizeof( log ), NULL, log );
268 + OSL_TRACE("vertex compile log: %s", log);
269 + glGetShaderiv( vertexObject, GL_COMPILE_STATUS, &vertexCompiled );
270 + glCompileShader( fragmentObject );
271 + glGetInfoLogARB( fragmentObject, sizeof( log ), NULL, log );
272 + OSL_TRACE("fragment compile log: %s", log);
273 + glGetShaderiv( fragmentObject, GL_COMPILE_STATUS, &fragmentCompiled );
275 + if( !vertexCompiled || !fragmentCompiled )
276 + return 0;
278 + OSL_TRACE("checkpoint 2: shaders compiled (%d)", glGetError() == GL_NO_ERROR);
280 + programObject = glCreateProgram();
281 + glAttachShader( programObject, vertexObject );
282 + glAttachShader( programObject, fragmentObject );
284 + glLinkProgram( programObject );
285 + glGetInfoLogARB( programObject, sizeof( log ), NULL, log );
286 + OSL_TRACE("program link log: %s", log);
287 + glGetProgramiv( programObject, GL_LINK_STATUS, &programLinked );
289 + if( !programLinked )
290 + return 0;
292 + OSL_TRACE("checkpoint 3: program linked (%d)", glGetError() == GL_NO_ERROR);
294 + return programObject;
295 +#else
296 + return 0;
297 +#endif
300 +static const char* basicVertexShader = "\n\
301 +varying vec2 v_texturePosition;\n\
302 +\n\
303 +void main( void )\n\
304 +{\n\
305 + gl_Position = ftransform();\n\
306 + v_texturePosition = gl_MultiTexCoord0.xy;\n\
307 +}\n\
310 +static const char* staticFragmentShader = "\n\
311 +uniform sampler2D leavingSlideTexture;\n\
312 +uniform sampler2D enteringSlideTexture;\n\
313 +uniform sampler2D permTexture;\n\
314 +uniform float time;\n\
315 +varying vec2 v_texturePosition;\n\
316 +\n\
317 +float snoise(vec2 P) {\n\
318 +\n\
319 + return texture2D(permTexture, P).r;\n\
320 +}\n\
321 +\n\
322 +\n\
323 +#define PART 0.5\n\
324 +#define START 0.4\n\
325 +#define END 0.9\n\
326 +\n\
327 +void main() {\n\
328 + float sn = snoise(10.0*v_texturePosition+time*0.07);\n\
329 + if( time < PART ) {\n\
330 + float sn1 = snoise(vec2(time*15.0, 20.0*v_texturePosition.y));\n\
331 + float sn2 = snoise(v_texturePosition);\n\
332 + if (sn1 > 1.0 - time*time && sn2 < 2.0*time+0.1)\n\
333 + gl_FragColor = vec4(sn, sn, sn, 1.0);\n\
334 + else if (time > START )\n\
335 + gl_FragColor = ((time-START)/(PART - START))*vec4(sn, sn, sn, 1.0) + (1.0 - (time - START)/(PART - START))*texture2D(leavingSlideTexture, v_texturePosition);\n\
336 + else\n\
337 + gl_FragColor = texture2D(leavingSlideTexture, v_texturePosition);\n\
338 + } else if ( time < PART ) {\n\
339 + gl_FragColor = texture2D(leavingSlideTexture, v_texturePosition);\n\
340 + } else if ( time > END ) {\n\
341 + gl_FragColor = ((1.0 - time)/(1.0 - END))*vec4(sn, sn, sn, 1.0) + ((time - END)/(1.0 - END))*texture2D(enteringSlideTexture, v_texturePosition);\n\
342 + } else \n\
343 + gl_FragColor = vec4(sn, sn, sn, 1.0);\n\
344 +}\n\
347 +static const char* dissolveFragmentShader = "\n\
348 +uniform sampler2D leavingSlideTexture;\n\
349 +uniform sampler2D enteringSlideTexture;\n\
350 +uniform sampler2D permTexture;\n\
351 +uniform float time;\n\
352 +varying vec2 v_texturePosition;\n\
353 +\n\
354 +float snoise(vec2 P) {\n\
355 +\n\
356 + return texture2D(permTexture, P).r;\n\
357 +}\n\
358 +\n\
359 +void main() {\n\
360 + float sn = snoise(10.0*v_texturePosition);\n\
361 + if( sn < time)\n\
362 + gl_FragColor = texture2D(enteringSlideTexture, v_texturePosition);\n\
363 + else\n\
364 + gl_FragColor = texture2D(leavingSlideTexture, v_texturePosition);\n\
365 +}\n\
368 +int permutation256 [256]= {
369 +215, 100, 200, 204, 233, 50, 85, 196,
370 + 71, 141, 122, 160, 93, 131, 243, 234,
371 +162, 183, 36, 155, 4, 62, 35, 205,
372 + 40, 102, 33, 27, 255, 55, 214, 156,
373 + 75, 163, 134, 126, 249, 74, 197, 228,
374 + 72, 90, 206, 235, 17, 22, 49, 169,
375 +227, 89, 16, 5, 117, 60, 248, 230,
376 +217, 68, 138, 96, 194, 170, 136, 10,
377 +112, 238, 184, 189, 176, 42, 225, 212,
378 + 84, 58, 175, 244, 150, 168, 219, 236,
379 +101, 208, 123, 37, 164, 110, 158, 201,
380 + 78, 114, 57, 48, 70, 142, 106, 43,
381 +232, 26, 32, 252, 239, 98, 191, 94,
382 + 59, 149, 39, 187, 203, 190, 19, 13,
383 +133, 45, 61, 247, 23, 34, 20, 52,
384 +118, 209, 146, 193, 222, 18, 1, 152,
385 + 46, 41, 91, 148, 115, 25, 135, 77,
386 +254, 147, 224, 161, 9, 213, 223, 250,
387 +231, 251, 127, 166, 63, 179, 81, 130,
388 +139, 28, 120, 151, 241, 86, 111, 0,
389 + 88, 153, 172, 182, 159, 105, 178, 47,
390 + 51, 167, 65, 66, 92, 73, 198, 211,
391 +245, 195, 31, 220, 140, 76, 221, 186,
392 +154, 185, 56, 83, 38, 165, 109, 67,
393 +124, 226, 132, 53, 229, 29, 12, 181,
394 +121, 24, 207, 199, 177, 113, 30, 80,
395 + 3, 97, 188, 79, 216, 173, 8, 145,
396 + 87, 128, 180, 237, 240, 137, 125, 104,
397 + 15, 242, 119, 246, 103, 143, 95, 144,
398 + 2, 44, 69, 157, 192, 174, 14, 54,
399 +218, 82, 64, 210, 11, 6, 129, 21,
400 +116, 171, 99, 202, 7, 107, 253, 108
403 +void initPermTexture(GLuint *texID)
405 + glGenTextures(1, texID);
406 + glBindTexture(GL_TEXTURE_2D, *texID);
408 + static bool initialized = false;
409 + static unsigned char permutation2D[256*256*4];
410 + if( !initialized ) {
411 + int x, y;
413 + for( y=0; y < 256; y++ )
414 + for( x=0; x < 256; x++ )
415 + permutation2D[x*4 + y*1024] = permutation256[(y + permutation256[x]) & 0xff];
417 + initialized = true;
420 + glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, permutation2D );
421 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
422 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
425 +void OGLTransitionImpl::preparePermShader()
427 +#ifdef GL_VERSION_2_0
428 + if( mProgramObject ) {
429 + glUseProgram( mProgramObject );
431 + GLint location = glGetUniformLocation( mProgramObject, "leavingSlideTexture" );
432 + if( location != -1 ) {
433 + glUniform1i( location, 0 ); // texture unit 0
436 + glActiveTexture(GL_TEXTURE1);
437 + if( !maHelperTexture )
438 + initPermTexture( &maHelperTexture );
439 + glActiveTexture(GL_TEXTURE0);
441 + location = glGetUniformLocation( mProgramObject, "permTexture" );
442 + if( location != -1 ) {
443 + glUniform1i( location, 1 ); // texture unit 1
446 + location = glGetUniformLocation( mProgramObject, "enteringSlideTexture" );
447 + if( location != -1 ) {
448 + glUniform1i( location, 2 ); // texture unit 2
451 +#endif
454 +void OGLTransitionImpl::prepareStatic( ::sal_Int32 /* glLeavingSlideTex */, ::sal_Int32 /* glEnteringSlideTex */ )
456 + mProgramObject = linkProgram( basicVertexShader, staticFragmentShader );
458 + preparePermShader();
461 +void OGLTransitionImpl::displaySlidesShaders( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex,
462 + double SlideWidthScale, double SlideHeightScale )
464 + applyOverallOperations( nTime, SlideWidthScale, SlideHeightScale );
466 +#ifdef GL_VERSION_2_0
467 + if( mProgramObject ) {
468 + GLint location = glGetUniformLocation( mProgramObject, "time" );
469 + if( location != -1 ) {
470 + glUniform1f( location, nTime );
473 +#endif
475 + glActiveTexture( GL_TEXTURE2 );
476 + glBindTexture( GL_TEXTURE_2D, glEnteringSlideTex );
477 + glActiveTexture( GL_TEXTURE0 );
479 + displaySlide( nTime, glLeavingSlideTex, maLeavingSlidePrimitives, SlideWidthScale, SlideHeightScale );
482 +void OGLTransitionImpl::makeStatic()
484 + Primitive Slide;
486 + Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
487 + Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
488 + maLeavingSlidePrimitives.push_back (Slide);
489 + maEnteringSlidePrimitives.push_back (Slide);
491 + mmDisplaySlides = &OGLTransitionImpl::displaySlidesShaders;
492 + mmPrepareTransition = &OGLTransitionImpl::prepareStatic;
493 + mbUseMipMapLeaving = mbUseMipMapEntering = false;
495 + mnRequiredGLVersion = 2.0;
498 +void OGLTransitionImpl::prepareDissolve( ::sal_Int32 /* glLeavingSlideTex */, ::sal_Int32 /* glEnteringSlideTex */ )
500 + mProgramObject = linkProgram( basicVertexShader, dissolveFragmentShader );
502 + preparePermShader();
505 +void OGLTransitionImpl::makeDissolve()
507 + Primitive Slide;
509 + Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
510 + Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
511 + maLeavingSlidePrimitives.push_back (Slide);
512 + maEnteringSlidePrimitives.push_back (Slide);
514 + mmDisplaySlides = &OGLTransitionImpl::displaySlidesShaders;
515 + mmPrepareTransition = &OGLTransitionImpl::prepareDissolve;
516 + mbUseMipMapLeaving = mbUseMipMapEntering = false;
518 + mnRequiredGLVersion = 2.0;
520 --- slideshow/source/engine/OGLTrans/OGLTrans_TransitionImpl.hxx.oglshtrans~ 2008-07-07 20:49:22.351096586 +0200
521 +++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionImpl.hxx 2008-07-07 21:01:47.609846722 +0200
522 @@ -64,18 +64,25 @@ public:
523 OGLTransitionImpl() :
524 mbUseMipMapLeaving( true ),
525 mbUseMipMapEntering( true ),
526 + mnRequiredGLVersion( 1.0 ),
527 maLeavingSlidePrimitives(),
528 maEnteringSlidePrimitives(),
529 maSceneObjects(),
530 mbReflectSlides( false ),
531 + mVertexObject( 0 ),
532 + mFragmentObject( 0 ),
533 + mProgramObject( 0 ),
534 + maHelperTexture( 0 ),
535 mmPrepare( NULL ),
536 + mmPrepareTransition( NULL ),
537 + mmClearTransition( NULL ),
538 mmDisplaySlides( NULL )
541 ~OGLTransitionImpl();
543 - void prepare();
544 - void display( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight);
545 + void prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
546 + void display( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight );
547 void finish();
549 void makeOutsideCubeFaceToLeft();
550 @@ -89,6 +96,8 @@ public:
551 void makeIris();
552 void makeRochade();
553 void makeVenetianBlinds( bool vertical, int parts );
554 + void makeStatic();
555 + void makeDissolve();
557 /** 2D replacements
559 @@ -100,6 +109,10 @@ public:
560 bool mbUseMipMapLeaving;
561 bool mbUseMipMapEntering;
563 + /** which GL version does the transition require
564 + */
565 + float mnRequiredGLVersion;
567 private:
568 /** clears all the primitives and operations
570 @@ -131,6 +144,16 @@ private:
572 void (OGLTransitionImpl::*mmPrepare)( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight );
574 + /** When this method is not NULL, it is called after glx context is ready to let the transition prepare GL related things, like GLSL program.
575 + ** We might later replace this by cleaner derived class.
576 + */
577 + void (OGLTransitionImpl::*mmPrepareTransition)( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
579 + /** When this method is not NULL, it is called when the transition needs to clear after itself, like delete own textures etc.
580 + ** We might later replace this by cleaner derived class.
581 + */
582 + void (OGLTransitionImpl::*mmClearTransition)();
584 /** When this method is not NULL, it is called in display method to display the slides.
585 ** We might later replace this by cleaner derived class.
587 @@ -145,6 +168,10 @@ private:
589 void prepareDiamond( double nTime, double SlideWidth, double SlideHeight,double DispWidth, double DispHeight );
590 void displaySlidesFadeSmoothly( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
591 + void displaySlidesShaders( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale );
592 + void prepareStatic( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
593 + void prepareDissolve( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
594 + void preparePermShader();
597 class SceneObject