diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-13 21:37:54 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-11-15 12:17:43 +0100 |
commit | dce9610afed674ecec23497a1a004193a6cf3bf1 (patch) | |
tree | 7b0e2063667645ae3a4259a08c0ab1d2fce0eaf1 /vcl/opengl/x11 | |
parent | 330b7b310193f3290cbd4c340659f72d12c352e1 (diff) |
vcl: Improve OpenGLTexture implementation by allowing implicit sharing
Conflicts:
vcl/opengl/gdiimpl.cxx
Change-Id: I6421265325e72023d1affe671d75488185772786
Diffstat (limited to 'vcl/opengl/x11')
-rw-r--r-- | vcl/opengl/x11/gdiimpl.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx index 3d242ac5719e..3bbb3d359344 100644 --- a/vcl/opengl/x11/gdiimpl.cxx +++ b/vcl/opengl/x11/gdiimpl.cxx @@ -15,6 +15,7 @@ #include "unx/salgdi.h" #include "unx/salvd.h" +#include "opengl/texture.hxx" #include "opengl/x11/gdiimpl.hxx" #include <vcl/opengl/OpenGLContext.hxx> @@ -125,7 +126,6 @@ bool X11OpenGLSalGraphicsImpl::RenderPixmapToScreen( X11Pixmap* pPixmap, int nX, Display* pDisplay = mrParent.GetXDisplay(); GLXFBConfig pFbConfig; GLXPixmap pGlxPixmap; - GLuint nTexture; SalTwoRect aPosAry; bool bInverted; @@ -145,21 +145,18 @@ bool X11OpenGLSalGraphicsImpl::RenderPixmapToScreen( X11Pixmap* pPixmap, int nX, PreDraw(); - glGenTextures( 1, &nTexture ); + OpenGLTexture aTexture( pPixmap->GetWidth(), pPixmap->GetHeight(), false ); glActiveTexture( GL_TEXTURE0 ); - glBindTexture( GL_TEXTURE_2D, nTexture ); + aTexture.Bind(); //TODO: lfrb: glXGetProc to get the functions glXBindTexImageEXT( pDisplay, pGlxPixmap, GLX_FRONT_LEFT_EXT, NULL ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); - - DrawTexture( nTexture, pPixmap->GetSize(), aPosAry, !bInverted ); + DrawTexture( aTexture, aPosAry, !bInverted ); glXReleaseTexImageEXT( pDisplay, pGlxPixmap, GLX_FRONT_LEFT_EXT ); - glDeleteTextures( 1, &nTexture ); glXDestroyPixmap( pDisplay, pGlxPixmap ); + aTexture.Unbind(); PostDraw(); |