external/libgltf/UnpackedTarball_libgltf.mk | 1 external/libgltf/pathces/fix_rendering_of_resized_model.patch | 71 ++++++++++ 2 files changed, 72 insertions(+)
New commits: commit 830aa8da71f798b83befd392c7773d81c142510e Author: Zolnai Tamás <tamas.zol...@collabora.com> Date: Tue Jul 15 23:15:08 2014 +0200 fdo#81182: glTF window size does not match with the scene size after resizing When viewport changed it is necessary to resize the whole scene. Calling releasFbo removes size dependent objects and triggers creating the new ones with the new size. Change-Id: Ibd8be1e92be92da31add4a30aa799f0995b1cc88 (cherry picked from commit 3cd7c0f6b6cdb8ebc6c72d2ffe1e0bc18968e27b) Reviewed-on: https://gerrit.libreoffice.org/10352 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/external/libgltf/UnpackedTarball_libgltf.mk b/external/libgltf/UnpackedTarball_libgltf.mk index 176c1d1..a7565ea 100644 --- a/external/libgltf/UnpackedTarball_libgltf.mk +++ b/external/libgltf/UnpackedTarball_libgltf.mk @@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchflags,libgltf,--binary)) $(eval $(call gb_UnpackedTarball_set_patchlevel,libgltf,1)) $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\ + external/libgltf/pathces/fix_rendering_of_resized_model.patch \ )) # vim: set noet sw=4 ts=4: diff --git a/external/libgltf/pathces/fix_rendering_of_resized_model.patch b/external/libgltf/pathces/fix_rendering_of_resized_model.patch new file mode 100644 index 0000000..57af9f9 --- /dev/null +++ b/external/libgltf/pathces/fix_rendering_of_resized_model.patch @@ -0,0 +1,71 @@ +diff -ur libgltf.org/src/RenderScene.cpp libgltf/src/RenderScene.cpp +--- libgltf.org/src/RenderScene.cpp 2014-07-15 17:33:12.615059856 +0200 ++++ libgltf/src/RenderScene.cpp 2014-07-15 22:24:20.862307666 +0200 +@@ -639,7 +639,7 @@ + , pScene(0) + , mLoadJson() + , mBindBufferMap() +- , viewport() ++ , mCurrentViewport() + , fbo() + , mEnableTransparency(false) + , mEnableRotation(false) +@@ -1555,10 +1555,9 @@ + pFPSCounter->timeStamp(); + } + #endif +- viewport = *((glTFViewport*)lpParam); + { + TRACE_TIME; +- status = initSSAAFrameBuf(&viewport); ++ status = initSSAAFrameBuf(((glTFViewport*)lpParam)); + if (LIBGLTF_SUCCESS != status) + return status; + } +@@ -1569,6 +1568,15 @@ + { + if (0 == pViewport->width) + return LIBGLTF_INVALID_SIZE; ++ ++ // When viewport changes we need to release fbo and create a new one ++ if( mCurrentViewport.x != pViewport->x || mCurrentViewport.y != pViewport->y || ++ mCurrentViewport.width != pViewport->width || mCurrentViewport.height != pViewport->height ) ++ { ++ fbo.releaseFbo(); ++ mCurrentViewport = *pViewport; ++ } ++ + #if DEFAULT_VIEW + unsigned int width = SSAA * DEFAULT_VIEW; + unsigned int height = (SSAA * DEFAULT_VIEW * +@@ -1730,14 +1738,14 @@ + #if ENABLE_FPS + if (0 != pFPSCounter) + { +- pFPSCounter->printFPS(&viewport); ++ pFPSCounter->printFPS(&mCurrentViewport); + } + #endif + + { + TRACE_TIME; +- glViewport(viewport.x, viewport.y, +- viewport.width, viewport.height); ++ glViewport(mCurrentViewport.x, mCurrentViewport.y, ++ mCurrentViewport.width, mCurrentViewport.height); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + fbo.renderFboTexture(); + } +Only in libgltf/src: RenderScene.cpp~ +diff -ur libgltf.org/src/RenderScene.h libgltf/src/RenderScene.h +--- libgltf.org/src/RenderScene.h 2014-07-15 17:33:12.615059856 +0200 ++++ libgltf/src/RenderScene.h 2014-07-15 22:18:01.306324010 +0200 +@@ -349,7 +349,7 @@ + std::map<std::string, BindBufferInfo> mBindBufferMap; + + static ShaderProgram mShaderProgram; +- glTFViewport viewport; ++ glTFViewport mCurrentViewport; + RenderWithFBO fbo; + + bool mEnableTransparency;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits