summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-07-19 09:53:19 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-07-20 07:49:11 +0000
commit55fee3e981f5c2b901d7bdbbf8965f434cbea7ff (patch)
tree91f0e5d0b7ea0a66b9c0a6f008ed68b9b90c00d0 /slideshow
parent439df080e7e82908cd80e01ca1b3a03ddb3ac8ec (diff)
tdf#97195 make diamond transition work again
(cherry picked from commit a0d3168ee4ac202790f1d4d0c95a6264cc8bf455) Change-Id: I28236dd0c7dbd4e1798055229b2db2d0101a493e Reviewed-on: https://gerrit.libreoffice.org/27313 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx54
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx2
2 files changed, 56 insertions, 0 deletions
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index b6c3a6e0039f..669f68aa9f4a 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -310,6 +310,36 @@ OGLTransitionImpl::displaySlide(
CHECK_GL_ERROR();
}
+void
+OGLTransitionImpl::displayUnbufferedSlide(
+ const double nTime,
+ const sal_Int32 glSlideTex, const Primitives_t& primitives,
+ double SlideWidthScale, double SlideHeightScale )
+{
+ CHECK_GL_ERROR();
+ glPushMatrix();
+ CHECK_GL_ERROR();
+ glBindTexture(GL_TEXTURE_2D, glSlideTex);
+ CHECK_GL_ERROR();
+ glBindVertexArray(0);
+ CHECK_GL_ERROR();
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ CHECK_GL_ERROR();
+ if (m_nSceneTransformLocation != -1) {
+ glUniformMatrix4fv(m_nSceneTransformLocation, 1, false, glm::value_ptr(glm::mat4()));
+ CHECK_GL_ERROR();
+ }
+ for (const Primitive& primitive: primitives)
+ primitive.display(m_nPrimitiveTransformLocation, nTime, SlideWidthScale, SlideHeightScale);
+ CHECK_GL_ERROR();
+ glBindVertexArray(m_nVertexArrayObject);
+ CHECK_GL_ERROR();
+ glBindBuffer(GL_ARRAY_BUFFER, m_nVertexBufferObject);
+ CHECK_GL_ERROR();
+ glPopMatrix();
+ CHECK_GL_ERROR();
+}
+
void OGLTransitionImpl::displayScene( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight )
{
const SceneObjects_t& rSceneObjects(maScene.getSceneObjects());
@@ -319,6 +349,30 @@ void OGLTransitionImpl::displayScene( double nTime, double SlideWidth, double Sl
CHECK_GL_ERROR();
}
+void Primitive::display(GLint primitiveTransformLocation, double nTime, double WidthScale, double HeightScale) const
+{
+ glm::mat4 matrix;
+ applyOperations( matrix, nTime, WidthScale, HeightScale );
+
+ CHECK_GL_ERROR();
+ if (primitiveTransformLocation != -1) {
+ glUniformMatrix4fv(primitiveTransformLocation, 1, false, glm::value_ptr(matrix));
+ CHECK_GL_ERROR();
+ }
+
+ glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
+ CHECK_GL_ERROR();
+ glEnableClientState( GL_VERTEX_ARRAY );
+ CHECK_GL_ERROR();
+ glVertexPointer( 3, GL_FLOAT, sizeof(Vertex), &Vertices[0] );
+ CHECK_GL_ERROR();
+ glDrawArrays( GL_TRIANGLES, 0, getVerticesSize() );
+ CHECK_GL_ERROR();
+ glPopClientAttrib();
+
+ CHECK_GL_ERROR();
+}
+
void Primitive::display(GLint primitiveTransformLocation, double nTime, double WidthScale, double HeightScale, int first) const
{
glm::mat4 matrix;
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
index 488a035adef8..2a7c472ada69 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
@@ -166,6 +166,7 @@ protected:
}
void displaySlide( double nTime, sal_Int32 glSlideTex, const Primitives_t& primitives, double SlideWidthScale, double SlideHeightScale );
+ void displayUnbufferedSlide( double nTime, sal_Int32 glSlideTex, const Primitives_t& primitives, double SlideWidthScale, double SlideHeightScale );
void displayScene( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight);
void applyOverallOperations( double nTime, double SlideWidthScale, double SlideHeightScale );
@@ -314,6 +315,7 @@ public:
void swap(Primitive& rOther);
void applyOperations(glm::mat4& matrix, double nTime, double SlideWidthScale, double SlideHeightScale) const;
+ void display(GLint primitiveTransformLocation, double nTime, double WidthScale, double HeightScale) const;
void display(GLint primitiveTransformLocation, double nTime, double WidthScale, double HeightScale, int first) const;
/** PushBack a vertex,normal, and tex coord. Each SlideLocation is where on the slide is mapped to this location ( from (0,0) to (1,1) ). This will make sure the correct aspect ratio is used, and helps to make slides begin and end at the correct position. (0,0) is the top left of the slide, and (1,1) is the bottom right.