[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source download.lst external/libgltf
Jan Holesovsky
kendy at collabora.com
Wed May 21 08:52:25 PDT 2014
avmedia/source/opengl/oglframegrabber.cxx | 4
avmedia/source/opengl/oglplayer.cxx | 3
avmedia/source/opengl/oglwindow.cxx | 12 -
download.lst | 2
external/libgltf/UnpackedTarball_libgltf.mk | 1
external/libgltf/patches/disable_fps_and_timer.patch | 124 +++++++++++++++++++
6 files changed, 135 insertions(+), 11 deletions(-)
New commits:
commit 1d8ce469ba1ffb162e74a3669824022ac5716fee
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue May 20 22:00:19 2014 +0200
libgltf: Updated version.
Change-Id: Ia394ff00421f495757cc2ce55e7b91bfebe715eb
diff --git a/avmedia/source/opengl/oglframegrabber.cxx b/avmedia/source/opengl/oglframegrabber.cxx
index 9db1f1b..e92cd86 100644
--- a/avmedia/source/opengl/oglframegrabber.cxx
+++ b/avmedia/source/opengl/oglframegrabber.cxx
@@ -33,11 +33,11 @@ OGLFrameGrabber::~OGLFrameGrabber()
{
}
-uno::Reference< css::graphic::XGraphic > SAL_CALL OGLFrameGrabber::grabFrame( double fMediaTime )
+uno::Reference< css::graphic::XGraphic > SAL_CALL OGLFrameGrabber::grabFrame( double /*fMediaTime*/ )
throw ( uno::RuntimeException, std::exception )
{
boost::scoped_array<sal_uInt8> pBuffer(new sal_uInt8[m_pHandle->viewport.width * m_pHandle->viewport.height * 4]);
- gltf_renderer_get_bitmap(&m_pHandle, 1, fMediaTime, (char*)pBuffer.get(), GL_BGRA);
+ gltf_renderer_get_bitmap(&m_pHandle, 1, (char*)pBuffer.get(), GL_BGRA);
BitmapEx aBitmap = OpenGLHelper::ConvertBGRABufferToBitmapEx(pBuffer.get(), m_pHandle->viewport.width, m_pHandle->viewport.height);
return Graphic( aBitmap ).GetXGraphic();
}
diff --git a/avmedia/source/opengl/oglplayer.cxx b/avmedia/source/opengl/oglplayer.cxx
index 83f5221..323242a 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -30,8 +30,7 @@ OGLPlayer::OGLPlayer()
OGLPlayer::~OGLPlayer()
{
- // Comment out while it causes segmentation fault
- // gltf_renderer_release(m_pHandle);
+ gltf_renderer_release(m_pHandle);
}
static bool lcl_LoadFile( glTFFile* io_pFile, const OUString& rURL)
diff --git a/avmedia/source/opengl/oglwindow.cxx b/avmedia/source/opengl/oglwindow.cxx
index 7bdc9f7..6f39b0e 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -32,9 +32,9 @@ OGLWindow::~OGLWindow()
void SAL_CALL OGLWindow::update() throw (css::uno::RuntimeException, std::exception)
{
m_pContext->makeCurrent();
- gltf_prepare_renderer(&m_pHandle->viewport);
+ gltf_prepare_renderer(m_pHandle);
gltf_renderer(m_pHandle);
- gltf_complete_renderer();
+ gltf_complete_renderer(m_pHandle);
m_pContext->swapBuffers();
}
@@ -257,8 +257,8 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
glm::vec3 vEye;
glm::vec3 vView;
glm::vec3 vUp;
- gltf_get_camera_pos(&vEye,&vView,&vUp);
- float fModelSize =(float)gltf_get_model_size();
+ gltf_get_camera_pos(m_pHandle, &vEye,&vView,&vUp);
+ float fModelSize =(float)gltf_get_model_size(m_pHandle);
glm::vec3 vMove = vView-vEye;
vMove = glm::normalize(vMove);
@@ -277,7 +277,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
if(nCode == KEY_W)vMoveBy -= vMup*(0.001f*fModelSize);
if(nCode == KEY_S)vMoveBy += vMup*(0.001f*fModelSize);
}
- gltf_renderer_move_camera(vMoveBy.x,vMoveBy.y,vMoveBy.z,0.0);
+ gltf_renderer_move_camera(m_pHandle, vMoveBy.x, vMoveBy.y, vMoveBy.z, 0.0);
update();
}
}
@@ -309,7 +309,7 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, pEvent)
long nDeltaX = m_aLastMousePos.X()-aCurPos.X();
long nDeltaY = aCurPos.Y()-m_aLastMousePos.Y();
// TODO: It seems this method just moves the camera but not rotate it.
- gltf_renderer_rotate_camera((float)nDeltaX*fSensitivity,(float)nDeltaY*fSensitivity,0.0,0.0);
+ gltf_renderer_rotate_camera(m_pHandle, (float)nDeltaX*fSensitivity, (float)nDeltaY*fSensitivity, 0.0, 0.0);
update();
m_aLastMousePos = aCurPos;
diff --git a/download.lst b/download.lst
index a17ca5e..20921ad 100644
--- a/download.lst
+++ b/download.lst
@@ -82,7 +82,7 @@ export LIBATOMIC_OPS_TARBALL := libatomic_ops-7_2d.zip
export LIBEOT_MD5SUM := aa24f5dd2a2992f4a116aa72af817548
export LIBEOT_TARBALL := libeot-0.01.tar.bz2
export LIBEXTTEXTCAT_TARBALL := ae330b9493bd4503ac390106ff6060d7-libexttextcat-3.4.3.tar.bz2
-export LIBGLTF_TARBALL := 02faa5e385c7083fc1e9cfbe71470e1f-libgltf.tar.bz2
+export LIBGLTF_TARBALL := 510c3f8504bfb8cc8c8fc5d0fac74055-libgltf.tar.bz2
export LIBLANGTAG_TARBALL := 36271d3fa0d9dec1632029b6d7aac925-liblangtag-0.5.1.tar.bz2
export LIBXMLSEC_TARBALL := 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
export LIBXML_TARBALL := 9c0cfef285d5c4a5c80d00904ddab380-libxml2-2.9.1.tar.gz
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk
index d8434b6..e919c71 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1))
$(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
external/libgltf/patches/include_path_glew.patch \
external/libgltf/patches/include_path_freetype.patch \
+ external/libgltf/patches/disable_fps_and_timer.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/patches/disable_fps_and_timer.patch b/external/libgltf/patches/disable_fps_and_timer.patch
new file mode 100644
index 0000000..c5d5eb2
--- /dev/null
+++ b/external/libgltf/patches/disable_fps_and_timer.patch
@@ -0,0 +1,124 @@
+diff --git libgltf/src/RenderScene.cpp libgltf/src/RenderScene.cpp
+index 88c5c9a..6639572 100644
+--- libgltf/src/RenderScene.cpp
++++ libgltf/src/RenderScene.cpp
+@@ -383,7 +383,9 @@ void RenderWithFBO::releaseFbo()
+
+
+ CPhysicalCamera* RenderScene::sCamera = NULL;
++#if ENABLE_FPS
+ FPSCounter* RenderScene::pFPSCounter = NULL;
++#endif
+ ShaderProgram RenderScene::mShaderProgram = ShaderProgram();
+
+ RenderScene::RenderScene()
+@@ -400,10 +402,12 @@ RenderScene::RenderScene()
+
+ RenderScene::~RenderScene()
+ {
++#if ENABLE_FPS
+ if (pFPSCounter != NULL)
+ {
+ delete pFPSCounter;
+ }
++#endif
+ #if ENABLE_TIMER
+ if(pTimer != NULL)
+ {
+@@ -815,8 +819,10 @@ int RenderScene::initRender(glTFHandle* handle)
+
+ void RenderScene::initFPS(unsigned char* fontBuf,unsigned int bufSize)
+ {
++#if ENABLE_FPS
+ pFPSCounter = new FPSCounter(fontBuf,bufSize);
+ pFPSCounter->loadFPSShader(&mShaderProgram);
++#endif
+ }
+
+ void RenderScene::renderPrimitive(RenderPrimitive* pPrimitive,
+@@ -1132,10 +1138,12 @@ void RenderScene::drawTriangle(RenderPrimitive* pPrimitive)
+
+ void RenderScene::prepareRender(void* lpParam)
+ {
++#if ENABLE_FPS
+ if (pFPSCounter != NULL)
+ {
+ pFPSCounter->timeStamp();
+ }
++#endif
+ viewport = *((glTFViewport*)lpParam);
+ fbo.createAndBindFbo(viewport.width * SSAA, viewport.height * SSAA);
+ glBindFramebuffer(GL_FRAMEBUFFER, fbo.mFboId);
+@@ -1229,10 +1237,12 @@ void RenderScene::renderShader(Technique* pTechnique)
+
+ void RenderScene::completeRender()
+ {
++#if ENABLE_FPS
+ if (pFPSCounter != NULL)
+ {
+ pFPSCounter->printFPS(&viewport);
+ }
++#endif
+ glViewport(viewport.x, viewport.y, viewport.width, viewport.height);
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ fbo.renderFboTexture();
+@@ -1356,4 +1366,4 @@ double RenderScene::getAnimDuration()
+ int RenderScene::isAnimPlay()
+ {
+ return this->mAnimationPlay ? 1 : 0;
+-}
+\ No newline at end of file
++}
+diff --git libgltf/src/RenderScene.h libgltf/src/RenderScene.h
+index cc0b3e5..065a689 100644
+--- libgltf/src/RenderScene.h
++++ libgltf/src/RenderScene.h
+@@ -8,12 +8,22 @@
+ #ifndef RENDERSCENE_H
+ #define RENDERSCENE_H
+
++#ifndef ENABLE_FPS
++#define ENABLE_FPS 0
++#endif
++
++#ifndef ENABLE_TIMER
++#define ENABLE_TIMER 0
++#endif
++
+ #include "Shaders.h"
+ #include "Common.h"
+ #include "Texture.h"
+ #include "Camera.h"
+ #include "LoadScene.h"
++#if ENABLE_FPS
+ #include "FPSCounter.h"
++#endif
+ #include "Timer.h"
+
+ using namespace glTF;
+@@ -246,7 +256,9 @@ private:
+ bool loadFPSShader();
+ int getFPS();
+ void printFPS(glTFViewport* pViewpoit);
++#if ENABLE_FPS
+ static FPSCounter* pFPSCounter;
++#endif
+ RenderWithFBO fbo;
+ #if ENABLE_TIMER
+ Timer* pTimer;
+diff --git libgltf/src/Timer.h libgltf/src/Timer.h
+index e4d778b..9ab2d74 100644
+--- libgltf/src/Timer.h
++++ libgltf/src/Timer.h
+@@ -10,7 +10,10 @@
+ #include "time.h"
+ #include "Common.h"
+
+-#define ENABLE_TIMER 1
++#ifndef ENABLE_TIMER
++#define ENABLE_TIMER 0
++#endif
++
+ #define DETAILED_INFO 1
+
+ #if ENABLE_TIMER
More information about the Libreoffice-commits
mailing list