[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source external/libgltf

2014-05-28 Thread Zolnai Tamás
 avmedia/source/opengl/oglplayer.cxx  |   20 +++
 external/libgltf/UnpackedTarball_libgltf.mk  |1 
 external/libgltf/patches/free_file_buffers.patch |   58 ---
 3 files changed, 19 insertions(+), 60 deletions(-)

New commits:
commit fafc1e29c1f060c1a44361a0445300f9786ad6f4
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Wed May 28 13:02:15 2014 +0200

libgltf: solve this memory leak problem on a better way 2

Handle those cases when file loading failes.
Release *.json file on a different way since it is allocated
by libgltf (inside the glTFHandle).

Change-Id: Idf6c6971a8ac1b342d89dc4f61a62624183e01d0

diff --git a/avmedia/source/opengl/oglplayer.cxx 
b/avmedia/source/opengl/oglplayer.cxx
index 8955e59..53356ca 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -33,6 +33,13 @@ OGLPlayer::OGLPlayer()
 
 OGLPlayer::~OGLPlayer()
 {
+for (size_t i = 0; i  m_pHandle-size; ++i)
+{
+if (m_pHandle-files[i].type != GLTF_JSON)
+{
+delete [] m_pHandle-files[i].buffer;
+}
+}
 gltf_renderer_release(m_pHandle);
 }
 
@@ -79,6 +86,8 @@ bool OGLPlayer::create( const OUString rURL )
 
 m_pHandle = gltf_renderer_init(aJsonFile);
 
+delete [] aJsonFile.buffer;
+
 if( !m_pHandle || !m_pHandle-files )
 {
 SAL_WARN(avmedia.opengl, gltf_renderer_init returned an invalid 
glTFHandle);
@@ -98,7 +107,14 @@ bool OGLPlayer::create( const OUString rURL )
 // Load images as bitmaps
 GraphicFilter aFilter;
 Graphic aGraphic;
-aFilter.ImportGraphic(aGraphic, INetURLObject(sFilesURL));
+if( aFilter.ImportGraphic(aGraphic, INetURLObject(sFilesURL)) 
!= GRFILTER_OK )
+{
+rFile.buffer = 0;
+rFile.imagewidth = 0;
+rFile.imageheight = 0;
+SAL_WARN(avmedia.opengl, Can't load texture file:  + 
sFilesURL);
+return false;
+}
 BitmapEx aBitmapEx = aGraphic.GetBitmapEx();
 aBitmapEx.Mirror(BMP_MIRROR_VERT);
 rFile.buffer = 
(char*)OpenGLHelper::ConvertBitmapExToRGBABuffer(aBitmapEx);
@@ -109,6 +125,8 @@ bool OGLPlayer::create( const OUString rURL )
 {
 if( !lcl_LoadFile(rFile, sFilesURL) )
 {
+rFile.buffer = 0;
+rFile.size = 0;
 SAL_WARN(avmedia.opengl, Can't load glTF file:  + 
sFilesURL);
 return false;
 }
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk 
b/external/libgltf/UnpackedTarball_libgltf.mk
index 7a0d91a..8aba498 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -18,7 +18,6 @@ $(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/free_file_buffers.patch \
external/libgltf/patches/rgba_textures.patch \
 ))
 
diff --git a/external/libgltf/patches/free_file_buffers.patch 
b/external/libgltf/patches/free_file_buffers.patch
deleted file mode 100644
index 9f92da3..000
--- a/external/libgltf/patches/free_file_buffers.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp
 libgltf.org/src/LoadScene.cpp  2014-05-26 21:46:51.986986538 +0200
-+++ libgltf/src/LoadScene.cpp  2014-05-26 21:47:28.206985004 +0200
-@@ -127,7 +127,7 @@
- return gHandle;
- }
- 
--bool Parser::releaseFileName()
-+bool Parser::releaseFiles()
- {
- glTFHandle* gHandle = pScene-getGltfHandle();
- for (int i = (int)gHandle-size - 1 ; i = 0 ; i--)
-@@ -137,6 +137,7 @@
- free(gHandle-files[i].filename);
- gHandle-files[i].filename = NULL;
- }
-+delete [] gHandle-files[i].buffer;
- }
- 
- if (gHandle-files != NULL)
-diff -ur libgltf.org/src/LoadScene.h libgltf/src/LoadScene.h
 libgltf.org/src/LoadScene.h2014-05-26 21:46:51.986986538 +0200
-+++ libgltf/src/LoadScene.h2014-05-26 21:47:33.170984793 +0200
-@@ -26,7 +26,7 @@
- {
- public:
- glTFHandle* getFileNameInJson(const std::string jsonFile);
--bool releaseFileName();
-+bool releaseFiles();
- int parseScene(Scene* pscene);
- bool parseJsonFile();
- void setJsonInfo(const std::string sbuffer);
-@@ -81,4 +81,4 @@
- bool is_json_in_buffer;
- };
- 
--#endif
-\ No newline at end of file
-+#endif
-diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
 libgltf.org/src/RenderScene.cpp2014-05-26 21:46:51.986986538 +0200
-+++ libgltf/src/RenderScene.cpp2014-05-26 

[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source external/libgltf

2014-05-27 Thread Zolnai Tamás
 avmedia/source/opengl/oglplayer.cxx  |   10 +++
 external/libgltf/UnpackedTarball_libgltf.mk  |1 
 external/libgltf/patches/free_file_buffers.patch |   58 ---
 3 files changed, 10 insertions(+), 59 deletions(-)

New commits:
commit f8436baa2267695455973a6fa42916f9ffc5c9da
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Tue May 27 10:48:43 2014 +0200

libgltf: solve this memory leak problem on a better way

Change-Id: I6e6fbf47c216bf9151e92d5e2a5b4eee57f52989

diff --git a/avmedia/source/opengl/oglplayer.cxx 
b/avmedia/source/opengl/oglplayer.cxx
index 2536b68..7831f6b 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -195,6 +195,14 @@ awt::Size SAL_CALL 
OGLPlayer::getPreferredPlayerWindowSize() throw ( uno::Runtim
 return awt::Size( 480, 360 );
 }
 
+static void lcl_ReleaseFiles(glTFHandle* pHandle)
+{
+for( int i = 0; i  pHandle-size; ++i )
+{
+delete [] pHandle-files[i].buffer;
+}
+}
+
 uno::Reference media::XPlayerWindow  SAL_CALL OGLPlayer::createPlayerWindow( 
const uno::Sequence uno::Any  rArguments )
  throw ( uno::RuntimeException, std::exception )
 {
@@ -219,6 +227,7 @@ uno::Reference media::XPlayerWindow  SAL_CALL 
OGLPlayer::createPlayerWindow( c
 m_pHandle-viewport.width = aSize.Width();
 m_pHandle-viewport.height = aSize.Height();
 gltf_renderer_set_content(m_pHandle);
+lcl_ReleaseFiles(m_pHandle);
 m_pOGLWindow = new OGLWindow(m_pHandle, m_aContext, pChildWindow);
 return uno::Reference media::XPlayerWindow ( m_pOGLWindow );
 }
@@ -239,6 +248,7 @@ uno::Reference media::XFrameGrabber  SAL_CALL 
OGLPlayer::createFrameGrabber()
 m_pHandle-viewport.width = getPreferredPlayerWindowSize().Width;
 m_pHandle-viewport.height = getPreferredPlayerWindowSize().Height;
 gltf_renderer_set_content(m_pHandle);
+lcl_ReleaseFiles(m_pHandle);
 return uno::Reference media::XFrameGrabber ();
 OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( m_pHandle );
 return uno::Reference media::XFrameGrabber ( pFrameGrabber );
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk 
b/external/libgltf/UnpackedTarball_libgltf.mk
index acfbab0..d8434b6 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -18,7 +18,6 @@ $(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/free_file_buffers.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/patches/free_file_buffers.patch 
b/external/libgltf/patches/free_file_buffers.patch
deleted file mode 100644
index 9f92da3..000
--- a/external/libgltf/patches/free_file_buffers.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp
 libgltf.org/src/LoadScene.cpp  2014-05-26 21:46:51.986986538 +0200
-+++ libgltf/src/LoadScene.cpp  2014-05-26 21:47:28.206985004 +0200
-@@ -127,7 +127,7 @@
- return gHandle;
- }
- 
--bool Parser::releaseFileName()
-+bool Parser::releaseFiles()
- {
- glTFHandle* gHandle = pScene-getGltfHandle();
- for (int i = (int)gHandle-size - 1 ; i = 0 ; i--)
-@@ -137,6 +137,7 @@
- free(gHandle-files[i].filename);
- gHandle-files[i].filename = NULL;
- }
-+delete [] gHandle-files[i].buffer;
- }
- 
- if (gHandle-files != NULL)
-diff -ur libgltf.org/src/LoadScene.h libgltf/src/LoadScene.h
 libgltf.org/src/LoadScene.h2014-05-26 21:46:51.986986538 +0200
-+++ libgltf/src/LoadScene.h2014-05-26 21:47:33.170984793 +0200
-@@ -26,7 +26,7 @@
- {
- public:
- glTFHandle* getFileNameInJson(const std::string jsonFile);
--bool releaseFileName();
-+bool releaseFiles();
- int parseScene(Scene* pscene);
- bool parseJsonFile();
- void setJsonInfo(const std::string sbuffer);
-@@ -81,4 +81,4 @@
- bool is_json_in_buffer;
- };
- 
--#endif
-\ No newline at end of file
-+#endif
-diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
 libgltf.org/src/RenderScene.cpp2014-05-26 21:46:51.986986538 +0200
-+++ libgltf/src/RenderScene.cpp2014-05-26 21:47:39.358984531 +0200
-@@ -1426,7 +1426,7 @@
- 
- void RenderScene::releaseRender()
- {
--mLoadJson.releaseFileName();
-+mLoadJson.releaseFiles();
- fbo.releaseFbo();
- return;
- }
-@@ -1543,4 +1543,4 @@
- int  RenderScene::isAnimPlay()
- {
- return this-mAnimationPlay ? 1 : 0;
--}
-\ No newline at end of file
-+}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source external/libgltf

2014-05-27 Thread Jan Holesovsky
 avmedia/source/opengl/oglplayer.cxx  |   10 ---
 external/libgltf/UnpackedTarball_libgltf.mk  |1 
 external/libgltf/patches/free_file_buffers.patch |   58 +++
 3 files changed, 59 insertions(+), 10 deletions(-)

New commits:
commit eb86aabb0b0ab291b935c14fc7dcb14c6b1cd745
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue May 27 11:54:40 2014 +0200

Revert libgltf: solve this memory leak problem on a better way

Unfortunately crashes subsequent starts of the slideshow.

This reverts commit f8436baa2267695455973a6fa42916f9ffc5c9da.

Change-Id: I141cf16a11b4f5e20fa05a5243049dd5cc5095b4

diff --git a/avmedia/source/opengl/oglplayer.cxx 
b/avmedia/source/opengl/oglplayer.cxx
index 7831f6b..2536b68 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -195,14 +195,6 @@ awt::Size SAL_CALL 
OGLPlayer::getPreferredPlayerWindowSize() throw ( uno::Runtim
 return awt::Size( 480, 360 );
 }
 
-static void lcl_ReleaseFiles(glTFHandle* pHandle)
-{
-for( int i = 0; i  pHandle-size; ++i )
-{
-delete [] pHandle-files[i].buffer;
-}
-}
-
 uno::Reference media::XPlayerWindow  SAL_CALL OGLPlayer::createPlayerWindow( 
const uno::Sequence uno::Any  rArguments )
  throw ( uno::RuntimeException, std::exception )
 {
@@ -227,7 +219,6 @@ uno::Reference media::XPlayerWindow  SAL_CALL 
OGLPlayer::createPlayerWindow( c
 m_pHandle-viewport.width = aSize.Width();
 m_pHandle-viewport.height = aSize.Height();
 gltf_renderer_set_content(m_pHandle);
-lcl_ReleaseFiles(m_pHandle);
 m_pOGLWindow = new OGLWindow(m_pHandle, m_aContext, pChildWindow);
 return uno::Reference media::XPlayerWindow ( m_pOGLWindow );
 }
@@ -248,7 +239,6 @@ uno::Reference media::XFrameGrabber  SAL_CALL 
OGLPlayer::createFrameGrabber()
 m_pHandle-viewport.width = getPreferredPlayerWindowSize().Width;
 m_pHandle-viewport.height = getPreferredPlayerWindowSize().Height;
 gltf_renderer_set_content(m_pHandle);
-lcl_ReleaseFiles(m_pHandle);
 return uno::Reference media::XFrameGrabber ();
 OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( m_pHandle );
 return uno::Reference media::XFrameGrabber ( pFrameGrabber );
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk 
b/external/libgltf/UnpackedTarball_libgltf.mk
index d8434b6..acfbab0 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/free_file_buffers.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/patches/free_file_buffers.patch 
b/external/libgltf/patches/free_file_buffers.patch
new file mode 100644
index 000..9f92da3
--- /dev/null
+++ b/external/libgltf/patches/free_file_buffers.patch
@@ -0,0 +1,58 @@
+diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp
+--- libgltf.org/src/LoadScene.cpp  2014-05-26 21:46:51.986986538 +0200
 libgltf/src/LoadScene.cpp  2014-05-26 21:47:28.206985004 +0200
+@@ -127,7 +127,7 @@
+ return gHandle;
+ }
+ 
+-bool Parser::releaseFileName()
++bool Parser::releaseFiles()
+ {
+ glTFHandle* gHandle = pScene-getGltfHandle();
+ for (int i = (int)gHandle-size - 1 ; i = 0 ; i--)
+@@ -137,6 +137,7 @@
+ free(gHandle-files[i].filename);
+ gHandle-files[i].filename = NULL;
+ }
++delete [] gHandle-files[i].buffer;
+ }
+ 
+ if (gHandle-files != NULL)
+diff -ur libgltf.org/src/LoadScene.h libgltf/src/LoadScene.h
+--- libgltf.org/src/LoadScene.h2014-05-26 21:46:51.986986538 +0200
 libgltf/src/LoadScene.h2014-05-26 21:47:33.170984793 +0200
+@@ -26,7 +26,7 @@
+ {
+ public:
+ glTFHandle* getFileNameInJson(const std::string jsonFile);
+-bool releaseFileName();
++bool releaseFiles();
+ int parseScene(Scene* pscene);
+ bool parseJsonFile();
+ void setJsonInfo(const std::string sbuffer);
+@@ -81,4 +81,4 @@
+ bool is_json_in_buffer;
+ };
+ 
+-#endif
+\ No newline at end of file
++#endif
+diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp
+--- libgltf.org/src/RenderScene.cpp2014-05-26 21:46:51.986986538 +0200
 libgltf/src/RenderScene.cpp2014-05-26 21:47:39.358984531 +0200
+@@ -1426,7 +1426,7 @@
+ 
+ void RenderScene::releaseRender()
+ {
+-mLoadJson.releaseFileName();
++mLoadJson.releaseFiles();
+ fbo.releaseFbo();
+ return;
+ }
+@@ -1543,4 +1543,4 @@
+ int  RenderScene::isAnimPlay()
+ {
+ return this-mAnimationPlay ? 1 : 0;
+-}
+\ No newline at end of file
++}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source

2014-05-27 Thread Zolnai Tamás
 avmedia/source/opengl/oglplayer.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d55b93da476499a991463a9416a97addea549669
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Tue May 27 20:12:59 2014 +0200

glTF rendering: fix texture problems

It seems we need mirroring.

Change-Id: Id9ad7041eb09ec773e4174cb68d34a65a2c473fe

diff --git a/avmedia/source/opengl/oglplayer.cxx 
b/avmedia/source/opengl/oglplayer.cxx
index 2536b68..af3707f 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -87,7 +87,8 @@ bool OGLPlayer::create( const OUString rURL )
 GraphicFilter aFilter;
 Graphic aGraphic;
 aFilter.ImportGraphic(aGraphic, INetURLObject(sFilesURL));
-const BitmapEx aBitmapEx = aGraphic.GetBitmapEx();
+BitmapEx aBitmapEx = aGraphic.GetBitmapEx();
+aBitmapEx.Mirror(BMP_MIRROR_VERT);
 rFile.buffer = 
(char*)OpenGLHelper::ConvertBitmapExToRGBABuffer(aBitmapEx);
 rFile.imagewidth = aBitmapEx.GetSizePixel().Width();
 rFile.imageheight = aBitmapEx.GetSizePixel().Height();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source

2014-05-26 Thread Jan Holesovsky
 avmedia/source/opengl/oglplayer.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 0e69e6ec4db9ba1651f460a1ca36fc31b79e5729
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue May 27 02:03:51 2014 +0200

[not for master] This makes the presentation work, but the preview does not.

A large model fails to work in the presentation mode when the preview is 
shown.

Change-Id: I30011d7f983ba1f5e2b9e3dc38830d139c378533

diff --git a/avmedia/source/opengl/oglplayer.cxx 
b/avmedia/source/opengl/oglplayer.cxx
index f2e80d2..2536b68 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -239,6 +239,7 @@ uno::Reference media::XFrameGrabber  SAL_CALL 
OGLPlayer::createFrameGrabber()
 m_pHandle-viewport.width = getPreferredPlayerWindowSize().Width;
 m_pHandle-viewport.height = getPreferredPlayerWindowSize().Height;
 gltf_renderer_set_content(m_pHandle);
+return uno::Reference media::XFrameGrabber ();
 OGLFrameGrabber *pFrameGrabber = new OGLFrameGrabber( m_pHandle );
 return uno::Reference media::XFrameGrabber ( pFrameGrabber );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source download.lst external/libgltf

2014-05-24 Thread Jan Holesovsky
 avmedia/source/opengl/oglplayer.cxx  |   18 +-
 download.lst |2 
 external/libgltf/StaticLibrary_libgltf.mk|2 
 external/libgltf/UnpackedTarball_libgltf.mk  |1 
 external/libgltf/patches/disable_fps_and_timer.patch |  124 ---
 5 files changed, 10 insertions(+), 137 deletions(-)

New commits:
commit f60b1ae90a63909178391eb2a3610e79783b8d33
Author: Jan Holesovsky ke...@collabora.com
Date:   Sat May 24 17:49:38 2014 +0200

libgltf: Another new version.

Change-Id: I784579717674f1caf68ad489d1a931936f6f9651

diff --git a/avmedia/source/opengl/oglplayer.cxx 
b/avmedia/source/opengl/oglplayer.cxx
index 323242a..f2e80d2 100644
--- a/avmedia/source/opengl/oglplayer.cxx
+++ b/avmedia/source/opengl/oglplayer.cxx
@@ -76,25 +76,25 @@ bool OGLPlayer::create( const OUString rURL )
 // Load external resources
 for( size_t i = 0; i  m_pHandle-size; ++i )
 {
-glTFFile* pFile = m_pHandle-files[i];
-if( pFile  pFile-filename )
+glTFFile rFile = m_pHandle-files[i];
+if( rFile.filename )
 {
 const OUString sFilesURL =
-
INetURLObject::GetAbsURL(m_sURL,OStringToOUString(OString(pFile-filename),RTL_TEXTENCODING_UTF8));
-if( pFile-type == GLTF_IMAGE )
+
INetURLObject::GetAbsURL(m_sURL,OStringToOUString(OString(rFile.filename),RTL_TEXTENCODING_UTF8));
+if( rFile.type == GLTF_IMAGE )
 {
 // Load images as bitmaps
 GraphicFilter aFilter;
 Graphic aGraphic;
 aFilter.ImportGraphic(aGraphic, INetURLObject(sFilesURL));
 const BitmapEx aBitmapEx = aGraphic.GetBitmapEx();
-pFile-buffer = 
(char*)OpenGLHelper::ConvertBitmapExToRGBABuffer(aBitmapEx);
-pFile-imagewidth = aBitmapEx.GetSizePixel().Width();
-pFile-imageheight = aBitmapEx.GetSizePixel().Height();
+rFile.buffer = 
(char*)OpenGLHelper::ConvertBitmapExToRGBABuffer(aBitmapEx);
+rFile.imagewidth = aBitmapEx.GetSizePixel().Width();
+rFile.imageheight = aBitmapEx.GetSizePixel().Height();
 }
-else if( pFile-type == GLTF_BINARY || pFile-type == GLTF_GLSL )
+else if( rFile.type == GLTF_BINARY || rFile.type == GLTF_GLSL )
 {
-if( !lcl_LoadFile(pFile, sFilesURL) )
+if( !lcl_LoadFile(rFile, sFilesURL) )
 {
 SAL_WARN(avmedia.opengl, Can't load glTF file:  + 
sFilesURL);
 return false;
diff --git a/download.lst b/download.lst
index 20921ad..3e13a8e 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 := 510c3f8504bfb8cc8c8fc5d0fac74055-libgltf.tar.bz2
+export LIBGLTF_TARBALL := 1ce9a9714caff757bab489257eda955d-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/StaticLibrary_libgltf.mk 
b/external/libgltf/StaticLibrary_libgltf.mk
index 4628ebb..99a06c2 100644
--- a/external/libgltf/StaticLibrary_libgltf.mk
+++ b/external/libgltf/StaticLibrary_libgltf.mk
@@ -35,8 +35,6 @@ $(eval $(call gb_StaticLibrary_set_include,libgltf,\
 $(eval $(call gb_StaticLibrary_add_generated_exception_objects,libgltf,\
UnpackedTarball/libgltf/src/Camera \
UnpackedTarball/libgltf/src/Common \
-   UnpackedTarball/libgltf/src/Font \
-   UnpackedTarball/libgltf/src/FPSCounter \
UnpackedTarball/libgltf/src/libgltf \
UnpackedTarball/libgltf/src/LoadScene \
UnpackedTarball/libgltf/src/RenderScene \
diff --git a/external/libgltf/UnpackedTarball_libgltf.mk 
b/external/libgltf/UnpackedTarball_libgltf.mk
index e919c71..d8434b6 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -18,7 +18,6 @@ $(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
deleted file mode 100644
index c5d5eb2..000
--- a/external/libgltf/patches/disable_fps_and_timer.patch

[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source

2014-05-22 Thread Zolnai Tamás
 avmedia/source/framework/modeltools.cxx |   41 +---
 1 file changed, 33 insertions(+), 8 deletions(-)

New commits:
commit 22c98417735273a4c987edb0651dad645cf593bd
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Thu May 22 19:19:02 2014 +0200

glTF: download *.dae and *.kmz files to the temp folder before conversion

Copy them to the same folder where the conversion output is written.

Change-Id: I38b93bf3fc427974cff7d6975151451a253b1cce

diff --git a/avmedia/source/framework/modeltools.cxx 
b/avmedia/source/framework/modeltools.cxx
index a7237d5..7de35f7 100644
--- a/avmedia/source/framework/modeltools.cxx
+++ b/avmedia/source/framework/modeltools.cxx
@@ -153,12 +153,43 @@ bool Embed3DModel( const uno::Referenceframe::XModel 
xModel,
 if (bIsDAE || bIsKMZ)
 {
 std::shared_ptr GLTF::GLTFAsset asset(new GLTF::GLTFAsset());
-asset-setInputFilePath(OUStringToOString( rSourceURL, 
RTL_TEXTENCODING_UTF8 ).getStr());
+
+OUString sOutput;
+
::utl::LocalFileHelper::ConvertPhysicalNameToURL(::utl::TempFile::CreateTempName(),
 sOutput);
+// remove .tmp extension
+sOutput = sOutput.copy(0, sOutput.getLength()-4);
+asset-setBundleOutputPath(OUStringToOString( sOutput, 
RTL_TEXTENCODING_UTF8 ).getStr());
+
+const INetURLObject aSourceURLObj(sSource);
+// If *.dae or *.kmz file is not in the local file system, then copy 
them to a temp folder for the conversion
+if(aSourceURLObj.GetProtocol() != INET_PROT_FILE )
+{
+try
+{
+   ::ucbhelper::Content aSourceContent(sSource,
+uno::Referenceucb::XCommandEnvironment(),
+comphelper::getProcessComponentContext());
+
+const OUString sTarget = sOutput + GetFilename(sSource);
+::ucbhelper::Content aTempContent(sTarget,
+uno::Referenceucb::XCommandEnvironment(),
+comphelper::getProcessComponentContext());
+
+aTempContent.writeStream(aSourceContent.openStream(), true);
+sSource = sTarget;
+}
+catch (const uno::Exception)
+{
+SAL_WARN(avmedia.opengl, Exception while trying to copy 
source file to the temp folder for conversion:\n  sSource);
+return false;
+}
+}
+
+asset-setInputFilePath(OUStringToOString( sSource, 
RTL_TEXTENCODING_UTF8 ).getStr());
 
 if (bIsKMZ)
 {
 // KMZ converter needs a system path
-const INetURLObject aSourceURLObj(rSourceURL);
 const std::string sSourcePath =
 OUStringToOString( 
aSourceURLObj.getFSysPath(INetURLObject::FSYS_DETECT), RTL_TEXTENCODING_UTF8 
).getStr();
 const std::string strDaeFilePath = 
GLTF::Kmz2Collada()(sSourcePath);
@@ -172,12 +203,6 @@ bool Embed3DModel( const uno::Referenceframe::XModel 
xModel,
 asset-setInputFilePath(OUStringToOString( sDaeFilePath, 
RTL_TEXTENCODING_UTF8 ).getStr());
 }
 
-OUString sOutput;
-
::utl::LocalFileHelper::ConvertPhysicalNameToURL(::utl::TempFile::CreateTempName(),
 sOutput);
-// remove .tmp extension
-sOutput = sOutput.copy(0, sOutput.getLength()-4);
-asset-setBundleOutputPath(OUStringToOString( sOutput, 
RTL_TEXTENCODING_UTF8 ).getStr());
-
 GLTF::COLLADA2GLTFWriter writer(asset);
 writer.write();
 // Path to the .json file created by COLLADA2GLTFWriter
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source download.lst external/libgltf

2014-05-21 Thread Jan Holesovsky
 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 ke...@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_arraysal_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 := 

[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source

2014-05-20 Thread Zolnai Tamás
 avmedia/source/framework/modeltools.cxx |   20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit f6a3c83bd499bc8df21f937bfa5d4db14b4a5352
Author: Zolnai Tamás tamas.zol...@collabora.com
Date:   Tue May 20 16:46:43 2014 +0200

glTF embedding: handle missing image on a better way

Using empty tree leads to empty image url which
cause problem.

Change-Id: If815ce588fb303905035185404ede93fa424fcba

diff --git a/avmedia/source/framework/modeltools.cxx 
b/avmedia/source/framework/modeltools.cxx
index 1adef63..c3fa11e 100644
--- a/avmedia/source/framework/modeltools.cxx
+++ b/avmedia/source/framework/modeltools.cxx
@@ -25,6 +25,7 @@
 #include boost/property_tree/ptree.hpp
 #include boost/property_tree/json_parser.hpp
 #include boost/foreach.hpp
+#include boost/optional.hpp
 
 #ifdef ENABLE_COLLADA2GLTF
 #include COLLADA2GLTFWriter.h
@@ -71,7 +72,7 @@ static void lcl_EmbedExternals(const OUString rSourceURL, 
uno::Referenceembed:
 
 // Parse json, read externals' URI and modify this relative URI's so they 
remain valid in the new context.
 std::vectorstd::string vExternals;
-ptree aTree, aEmptyTree;
+ptree aTree;
 try
 {
 json_parser::read_json( sUrl, aTree );
@@ -85,12 +86,19 @@ static void lcl_EmbedExternals(const OUString rSourceURL, 
uno::Referenceembed:
 aTree.put(buffers. + rVal.first + 
.path.,sBufferUri.substr(sBufferUri.find_last_of('/')+1));
 }
 // Images for textures
-BOOST_FOREACH(ptree::value_type rVal,aTree.get_child(images, 
aEmptyTree))
+boost::optional ptree  aImages = aTree.get_child_optional(images);
+if( aImages )
 {
-const std::string sImageUri(rVal.second.getstd::string(path));
-vExternals.push_back(sImageUri);
-// Change path: make it contain only a file name
-aTree.put(images. + rVal.first + 
.path.,sImageUri.substr(sImageUri.find_last_of('/')+1));
+BOOST_FOREACH(ptree::value_type rVal,aImages.get())
+{
+const std::string 
sImageUri(rVal.second.getstd::string(path));
+if( !sImageUri.empty() )
+{
+vExternals.push_back(sImageUri);
+// Change path: make it contain only a file name
+aTree.put(images. + rVal.first + 
.path.,sImageUri.substr(sImageUri.find_last_of('/')+1));
+}
+}
 }
 // Shaders (contains names only)
 BOOST_FOREACH(ptree::value_type rVal,aTree.get_child(programs))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source download.lst external/libgltf

2014-05-19 Thread Jan Holesovsky
 avmedia/source/opengl/oglframegrabber.cxx|2 
 avmedia/source/opengl/oglwindow.cxx  |2 
 download.lst |2 
 external/libgltf/UnpackedTarball_libgltf.mk  |   10 -
 external/libgltf/patches/avoid_c++11_copy_filestream.patch   |   12 -
 external/libgltf/patches/constify_for_temporaries.patch  |   24 --
 external/libgltf/patches/extern-C.patch  |   20 --
 external/libgltf/patches/fmod_error_handling.patch   |   22 --
 external/libgltf/patches/get_bitmap_new_syntax.patch |   69 ---
 external/libgltf/patches/include_path_freetype.patch |7 
 external/libgltf/patches/include_path_glew.patch |   19 +-
 external/libgltf/patches/remove_extra_include.patch  |   11 -
 external/libgltf/patches/shader_charbuffer_used_as_cstring.patch |   94 
--
 external/libgltf/patches/typedef_used_as_struct.patch|   14 -
 external/libgltf/patches/unneeded_context_handling.patch |   18 -
 external/libgltf/patches/win_only_variables.patch|   13 -
 16 files changed, 15 insertions(+), 324 deletions(-)

New commits:
commit ee2c763ff5918e918db1e9c671c3a71c1b703872
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon May 12 21:56:26 2014 +0200

libgltf: Update to the new version.

Change-Id: Iffc91425d4395699a1c5f18ac10f5ed065231fdf

diff --git a/avmedia/source/opengl/oglframegrabber.cxx 
b/avmedia/source/opengl/oglframegrabber.cxx
index c4d2408f..9db1f1b 100644
--- a/avmedia/source/opengl/oglframegrabber.cxx
+++ b/avmedia/source/opengl/oglframegrabber.cxx
@@ -37,7 +37,7 @@ uno::Reference css::graphic::XGraphic  SAL_CALL 
OGLFrameGrabber::grabFrame( do
 throw ( uno::RuntimeException, std::exception )
 {
 boost::scoped_arraysal_uInt8 pBuffer(new 
sal_uInt8[m_pHandle-viewport.width * m_pHandle-viewport.height * 4]);
-gltf_renderer_get_bitmap(m_pHandle, fMediaTime, (char*)pBuffer.get(), 
GL_BGRA);
+gltf_renderer_get_bitmap(m_pHandle, 1, fMediaTime, (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/oglwindow.cxx 
b/avmedia/source/opengl/oglwindow.cxx
index ec21651..a3e5623 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -32,7 +32,7 @@ OGLWindow::~OGLWindow()
 void SAL_CALL OGLWindow::update() throw (css::uno::RuntimeException, 
std::exception)
 {
 m_pContext-makeCurrent();
-gltf_prepare_renderer(m_pHandle);
+gltf_prepare_renderer(m_pHandle-viewport);
 gltf_renderer(m_pHandle);
 gltf_complete_renderer();
 m_pContext-swapBuffers();
diff --git a/download.lst b/download.lst
index 69aa304..a17ca5e 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 := 1c33a8d54d570b8b2f90784814d9-libgltf.tar.bz2
+export LIBGLTF_TARBALL := 02faa5e385c7083fc1e9cfbe71470e1f-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 bd2ee0b..d8434b6 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -18,16 +18,6 @@ $(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/typedef_used_as_struct.patch \
-   external/libgltf/patches/avoid_c++11_copy_filestream.patch \
-   external/libgltf/patches/unneeded_context_handling.patch \
-   external/libgltf/patches/win_only_variables.patch \
-   external/libgltf/patches/constify_for_temporaries.patch \
-   external/libgltf/patches/shader_charbuffer_used_as_cstring.patch \
-   external/libgltf/patches/get_bitmap_new_syntax.patch \
-   external/libgltf/patches/remove_extra_include.patch \
-   external/libgltf/patches/fmod_error_handling.patch \
-   external/libgltf/patches/extern-C.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/patches/avoid_c++11_copy_filestream.patch 

[Libreoffice-commits] core.git: Branch 'feature/chart-3d-chart2' - avmedia/source

2014-05-19 Thread Jan Holesovsky
 avmedia/source/opengl/oglwindow.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 18f07f27b14023977ad4488bc11092dc78a22a32
Author: Jan Holesovsky ke...@collabora.com
Date:   Tue May 20 01:05:12 2014 +0200

gltf: Send delta when rotating, not absolute value.

Change-Id: I2453132fedc9a38f43c3de4b110459ba7771d085

diff --git a/avmedia/source/opengl/oglwindow.cxx 
b/avmedia/source/opengl/oglwindow.cxx
index a3e5623..7bdc9f7 100644
--- a/avmedia/source/opengl/oglwindow.cxx
+++ b/avmedia/source/opengl/oglwindow.cxx
@@ -300,13 +300,19 @@ IMPL_LINK(OGLWindow, CameraHandler, VclWindowEvent*, 
pEvent)
 if(pMouseEvt  pMouseEvt-IsLeft())
 {
 const Point aCurPos = pMouseEvt-GetPosPixel();
+float fSensitivity = std::min(m_pHandle-viewport.width, 
m_pHandle-viewport.height);
+if (fSensitivity == 0.0)
+fSensitivity = 1.0;
+else
+fSensitivity = 540.0 / fSensitivity;
 
 long nDeltaX = m_aLastMousePos.X()-aCurPos.X();
 long nDeltaY = aCurPos.Y()-m_aLastMousePos.Y();
-static const float fSensitivity = 1.0;
 // 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);
 update();
+
+m_aLastMousePos = aCurPos;
 }
 }
 return 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits