[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 14 07:54:14 UTC 2019
vcl/unx/gtk3/gtk3gtkinst.cxx | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
New commits:
commit 137e14ec4c3d3258df3802426b5ffe469f7fbde3
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Oct 13 20:55:03 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Oct 14 09:53:13 2019 +0200
Related: tdf#124729 avoid GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
for 0 width or height
Change-Id: I1452d0e6c5470d855cae96308e689e87e1d582d5
Reviewed-on: https://gerrit.libreoffice.org/80746
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index d050f624797c..b1d3eed73097 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1419,12 +1419,17 @@ private:
int width = m_aGLWin.Width * scale;
int height = m_aGLWin.Height * scale;
+ // seen in tdf#124729 width/height of 0 leading to GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
+ int allocwidth = std::max(width, 1);
+ int allocheight = std::max(height, 1);
+
gtk_gl_area_make_current(GTK_GL_AREA(m_pGLArea));
glBindRenderbuffer(GL_RENDERBUFFER, m_nRenderBuffer);
- glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB8, width, height);
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB8, allocwidth, allocheight);
glBindRenderbuffer(GL_RENDERBUFFER, m_nDepthBuffer);
- glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height);
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, allocwidth, allocheight);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_nAreaFrameBuffer);
+
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, m_nRenderBuffer);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
@@ -1434,6 +1439,7 @@ private:
glBindRenderbuffer(GL_RENDERBUFFER, m_nRenderBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, m_nDepthBuffer);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_nFrameBuffer);
+
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, m_nRenderBuffer);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
@@ -1441,14 +1447,16 @@ private:
glViewport(0, 0, width, height);
glBindRenderbuffer(GL_RENDERBUFFER, m_nRenderScratchBuffer);
- glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB8, width, height);
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB8, allocwidth, allocheight);
glBindRenderbuffer(GL_RENDERBUFFER, m_nDepthScratchBuffer);
- glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, width, height);
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT24, allocwidth, allocheight);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_nFrameScratchBuffer);
+
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_RENDERBUFFER_EXT, m_nRenderScratchBuffer);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, m_nDepthScratchBuffer);
+
glViewport(0, 0, width, height);
}
More information about the Libreoffice-commits
mailing list