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

Zolnai Tamás tamas.zolnai at collabora.com
Wed Jun 4 00:41:10 PDT 2014


 external/libgltf/UnpackedTarball_libgltf.mk         |    1 
 external/libgltf/patches/accurate_fps_counter.patch |   41 ++++++++++++++++++++
 2 files changed, 42 insertions(+)

New commits:
commit 813bd9a1b84f2629fce991805ad801db9997cc63
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Wed Jun 4 09:37:52 2014 +0200

    Patching libgltf: make FPS counter more accurate
    
    Before, it only calculated with the rendering time of the
    last frame of the second. So it did not matter how much
    frame was rendered actually.
    Now, it counts the frames.
    
    Change-Id: I0928a4c3f6e4770c253708f1a4d41c7745de18b7

diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk
index 5e293e9..8ec713b 100644
--- a/external/libgltf/UnpackedTarball_libgltf.mk
+++ b/external/libgltf/UnpackedTarball_libgltf.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
 	external/libgltf/patches/use_8x_ssaa.diff \
 	external/libgltf/patches/rgba_textures.patch \
 	external/libgltf/patches/deallocation_fix.patch \
+	external/libgltf/patches/accurate_fps_counter.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libgltf/patches/accurate_fps_counter.patch b/external/libgltf/patches/accurate_fps_counter.patch
new file mode 100644
index 0000000..127fed6
--- /dev/null
+++ b/external/libgltf/patches/accurate_fps_counter.patch
@@ -0,0 +1,41 @@
+diff -ur libgltf.org/src/FPSCounter.cpp libgltf/src/FPSCounter.cpp
+--- libgltf.org/src/FPSCounter.cpp	2014-06-04 08:55:02.133882400 +0200
++++ libgltf/src/FPSCounter.cpp	2014-06-04 09:14:40.847536600 +0200
+@@ -74,8 +74,9 @@
+     glUniform4fv(iLoc, 1, (GLfloat*)&lightVector);
+     if (mDurationTime >= CLOCKS_PER_SEC)
+     {
+-        mFPS = getFPS();
++        mFPS = mFrames;
+         mDurationTime = 0;
++        mFrames = 0;
+ #ifdef _WIN32
+         mTotalTime = getExecutionTime();
+ #endif
+@@ -110,6 +111,7 @@
+ #endif
+ #endif
+         }
++        ++mFrames;
+     }
+ 
+     pFont->printFormattedString(pViewport->width - 100, 30, 15, "FPS: %d",mFPS);
+diff -ur libgltf.org/src/FPSCounter.h libgltf/src/FPSCounter.h
+--- libgltf.org/src/FPSCounter.h	2014-06-04 08:55:02.133882400 +0200
++++ libgltf/src/FPSCounter.h	2014-06-04 08:58:18.704629400 +0200
+@@ -75,6 +75,7 @@
+                ShaderProgram* pShaderProgram)
+         : mFPS(0), mDurationTime(0),mCurrentTime(0)
+         ,mLastTime(0),mTotalTime(0),uiFPSProgram(0)
++        ,mFrames(0)
+     {
+         pFont = new Font();
+         pFont->loadFont(fontBuf,bufSize, 32);
+@@ -128,6 +129,7 @@
+ #endif
+ #endif
+ 
++    int mFrames;
+     int mFPS;
+ 
+ #if WRITEFPS2FILE


More information about the Libreoffice-commits mailing list