Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
129b8b85
Kaydet (Commit)
129b8b85
authored
Ara 09, 2015
tarafından
Emmanuel Gil Peyrot
Kaydeden (comit)
Tomaž Vajngerl
Ara 11, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
slideshow: Remove extraneous checks for the program object.
Change-Id: Ice61bfbd75aafd4197584c34ef7fbed80c20c184
üst
9e991f43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
87 deletions
+68
-87
OGLTrans_TransitionImpl.cxx
...ource/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+68
-87
No files found.
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
Dosyayı görüntüle @
129b8b85
...
...
@@ -143,67 +143,65 @@ bool OGLTransitionImpl::prepare( sal_Int32 glLeavingSlideTex, sal_Int32 glEnteri
if
(
!
m_nProgramObject
)
return
false
;
CHECK_GL_ERROR
();
glUseProgram
(
m_nProgramObject
);
CHECK_GL_ERROR
();
const
SceneObjects_t
&
rSceneObjects
(
maScene
.
getSceneObjects
());
for
(
size_t
i
(
0
);
i
!=
rSceneObjects
.
size
();
++
i
)
{
rSceneObjects
[
i
]
->
prepare
(
m_nProgramObject
);
}
CHECK_GL_ERROR
(
);
if
(
m_nProgramObject
)
{
glU
seProgram
(
m_nProgramObject
);
GLint
location
=
glGetUniformLocation
(
m_nProgramObject
,
"leavingSlideTexture"
);
if
(
location
!=
-
1
)
{
glU
niform1i
(
location
,
0
);
// texture unit 0
CHECK_GL_ERROR
();
}
GLint
location
=
glGetUniformLocation
(
m_nProgramObject
,
"leavingSlideTexture"
);
if
(
location
!=
-
1
)
{
glUniform1i
(
location
,
0
);
// texture unit 0
CHECK_GL_ERROR
();
}
location
=
glGetUniformLocation
(
m_nProgramObject
,
"enteringSlideTexture"
);
if
(
location
!=
-
1
)
{
glUniform1i
(
location
,
2
);
// texture unit 2
CHECK_GL_ERROR
();
}
uploadModelViewProjectionMatrices
();
location
=
glGetUniformLocation
(
m_nProgramObject
,
"enteringSlideTexture"
);
if
(
location
!=
-
1
)
{
glUniform1i
(
location
,
2
);
// texture unit 2
CHECK_GL_ERROR
();
}
m_nPrimitiveTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_primitiveTransformMatrix"
);
m_nSceneTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_sceneTransformMatrix"
);
m_nOperationsTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_operationsTransformMatrix"
);
uploadModelViewProjectionMatrices
();
glGenVertexArrays
(
1
,
&
m_nVertexArrayObject
);
glBindVertexArray
(
m_nVertexArrayObject
);
m_nPrimitiveTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_primitiveTransformMatrix"
);
m_nSceneTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_sceneTransformMatrix"
);
m_nOperationsTransformLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"u_operationsTransformMatrix"
);
glGenBuffers
(
1
,
&
m_nVertexBuffer
Object
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_nVertexBuffer
Object
);
glGenVertexArrays
(
1
,
&
m_nVertexArray
Object
);
glBindVertexArray
(
m_nVertexArray
Object
);
// In practice both leaving and entering slides share the same primitives.
m_nFirstIndices
=
uploadPrimitives
(
getScene
().
getLeavingSlide
()
);
glGenBuffers
(
1
,
&
m_nVertexBufferObject
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
m_nVertexBufferObject
);
// Attribute bindings
m_nPositionLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"a_position"
);
if
(
m_nPositionLocation
!=
-
1
)
{
glEnableVertexAttribArray
(
m_nPositionLocation
);
glVertexAttribPointer
(
m_nPositionLocation
,
3
,
GL_FLOAT
,
false
,
sizeof
(
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex
,
position
))
);
CHECK_GL_ERROR
();
}
// In practice both leaving and entering slides share the same primitives.
m_nFirstIndices
=
uploadPrimitives
(
getScene
().
getLeavingSlide
());
m_nNormalLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"a_normal"
);
if
(
m_nNormalLocation
!=
-
1
)
{
glEnableVertexAttribArray
(
m_nNormalLocation
);
glVertexAttribPointer
(
m_nNormalLocation
,
3
,
GL_FLOAT
,
false
,
sizeof
(
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex
,
normal
))
);
CHECK_GL_ERROR
();
}
// Attribute bindings
m_nPositionLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"a_position"
);
if
(
m_nPositionLocation
!=
-
1
)
{
glEnableVertexAttribArray
(
m_nPositionLocation
);
glVertexAttribPointer
(
m_nPositionLocation
,
3
,
GL_FLOAT
,
false
,
sizeof
(
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex
,
position
))
);
CHECK_GL_ERROR
();
}
m_nTexCoordLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"a_texCoord
"
);
if
(
m_nTexCoord
Location
!=
-
1
)
{
glEnableVertexAttribArray
(
m_nTexCoord
Location
);
glVertexAttribPointer
(
m_nTexCoordLocation
,
2
,
GL_FLOAT
,
false
,
sizeof
(
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex
,
texcoord
))
);
CHECK_GL_ERROR
();
}
m_nNormalLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"a_normal
"
);
if
(
m_nNormal
Location
!=
-
1
)
{
glEnableVertexAttribArray
(
m_nNormal
Location
);
glVertexAttribPointer
(
m_nNormalLocation
,
3
,
GL_FLOAT
,
false
,
sizeof
(
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex
,
normal
))
);
CHECK_GL_ERROR
();
}
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
m_nTexCoordLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"a_texCoord"
);
if
(
m_nTexCoordLocation
!=
-
1
)
{
glEnableVertexAttribArray
(
m_nTexCoordLocation
);
glVertexAttribPointer
(
m_nTexCoordLocation
,
2
,
GL_FLOAT
,
false
,
sizeof
(
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex
,
texcoord
))
);
CHECK_GL_ERROR
();
}
glBindBuffer
(
GL_ARRAY_BUFFER
,
0
);
CHECK_GL_ERROR
();
prepareTransition
(
glLeavingSlideTex
,
glEnteringSlideTex
);
...
...
@@ -252,12 +250,9 @@ void OGLTransitionImpl::displaySlides_( double nTime, sal_Int32 glLeavingSlideTe
CHECK_GL_ERROR
();
applyOverallOperations
(
nTime
,
SlideWidthScale
,
SlideHeightScale
);
if
(
m_nProgramObject
)
{
GLint
location
=
glGetUniformLocation
(
m_nProgramObject
,
"time"
);
if
(
location
!=
-
1
)
{
glUniform1f
(
location
,
nTime
);
}
}
GLint
location
=
glGetUniformLocation
(
m_nProgramObject
,
"time"
);
if
(
location
!=
-
1
)
glUniform1f
(
location
,
nTime
);
glActiveTexture
(
GL_TEXTURE2
);
glBindTexture
(
GL_TEXTURE_2D
,
glEnteringSlideTex
);
...
...
@@ -1418,20 +1413,18 @@ static void initPermTexture(GLuint *texID)
void
PermTextureTransition
::
prepareTransition
(
sal_Int32
,
sal_Int32
)
{
CHECK_GL_ERROR
();
if
(
m_nProgramObject
)
{
GLint
location
=
glGetUniformLocation
(
m_nProgramObject
,
"permTexture"
);
if
(
location
!=
-
1
)
{
glActiveTexture
(
GL_TEXTURE1
);
CHECK_GL_ERROR
();
if
(
!
m_nHelperTexture
)
initPermTexture
(
&
m_nHelperTexture
);
glActiveTexture
(
GL_TEXTURE0
);
CHECK_GL_ERROR
();
glUniform1i
(
location
,
1
);
// texture unit 1
CHECK_GL_ERROR
();
}
GLint
location
=
glGetUniformLocation
(
m_nProgramObject
,
"permTexture"
);
if
(
location
!=
-
1
)
{
glActiveTexture
(
GL_TEXTURE1
);
CHECK_GL_ERROR
();
if
(
!
m_nHelperTexture
)
initPermTexture
(
&
m_nHelperTexture
);
glActiveTexture
(
GL_TEXTURE0
);
CHECK_GL_ERROR
();
glUniform1i
(
location
,
1
);
// texture unit 1
CHECK_GL_ERROR
();
}
CHECK_GL_ERROR
();
}
...
...
@@ -1601,20 +1594,14 @@ void VortexTransition::prepareTransition( sal_Int32 glLeavingSlideTex, sal_Int32
PermTextureTransition
::
prepareTransition
(
glLeavingSlideTex
,
glEnteringSlideTex
);
CHECK_GL_ERROR
();
if
(
m_nProgramObject
)
{
mnTileInfoLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"tileInfo"
);
CHECK_GL_ERROR
();
glUseProgram
(
m_nProgramObject
);
CHECK_GL_ERROR
();
mnTileInfoLocation
=
glGetAttribLocation
(
m_nProgramObject
,
"tileInfo"
);
CHECK_GL_ERROR
();
GLint
nNumTilesLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"numTiles"
);
CHECK_GL_ERROR
();
GLint
nNumTilesLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"numTiles"
);
CHECK_GL_ERROR
();
glUniform2iv
(
nNumTilesLocation
,
1
,
glm
::
value_ptr
(
maNumTiles
));
CHECK_GL_ERROR
();
}
glUniform2iv
(
nNumTilesLocation
,
1
,
glm
::
value_ptr
(
maNumTiles
));
CHECK_GL_ERROR
();
glGenBuffers
(
1
,
&
mnTileInfoBuffer
);
CHECK_GL_ERROR
();
...
...
@@ -1712,17 +1699,11 @@ GLuint RippleTransition::makeShader() const
void
RippleTransition
::
prepareTransition
(
sal_Int32
,
sal_Int32
)
{
if
(
m_nProgramObject
)
{
glUseProgram
(
m_nProgramObject
);
CHECK_GL_ERROR
();
GLint
nCenterLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"center"
);
CHECK_GL_ERROR
();
GLint
nCenterLocation
=
glGetUniformLocation
(
m_nProgramObject
,
"center"
);
CHECK_GL_ERROR
();
glUniform2fv
(
nCenterLocation
,
1
,
glm
::
value_ptr
(
maCenter
));
CHECK_GL_ERROR
();
}
glUniform2fv
(
nCenterLocation
,
1
,
glm
::
value_ptr
(
maCenter
));
CHECK_GL_ERROR
();
}
std
::
shared_ptr
<
OGLTransitionImpl
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment