diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-28 14:58:53 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-12-02 11:58:46 +0100 |
commit | f1bfdc153b1ca8c8fb987b775a8c0ec350312a88 (patch) | |
tree | 192d9cf63038dd5f50b13c77bb779880d40d25f1 /vcl | |
parent | a7b9730164d7c5dca28b8abcc62425cbd75c64a7 (diff) |
vcl: Fix a coordinate issue when getting a bitmap from a VirtualDevice
Change-Id: I06fef2765f2dc9d64a991385a984a4c75a1fd424
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 3 | ||||
-rw-r--r-- | vcl/opengl/texture.cxx | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 4d362b15b4fc..462a479ba04e 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1113,8 +1113,8 @@ SalBitmap* OpenGLSalGraphicsImpl::getBitmap( long nX, long nY, long nWidth, long OpenGLSalBitmap* pBitmap = new OpenGLSalBitmap; SAL_INFO( "vcl.opengl", "::getBitmap " << nX << "," << nY << " " << nWidth << "x" << nHeight ); + //TODO really needed? PreDraw(); - nY = GetHeight() - nHeight - nY; if( !pBitmap->Create( maOffscreenTex, nX, nY, nWidth, nHeight ) ) { delete pBitmap; @@ -1129,6 +1129,7 @@ SalColor OpenGLSalGraphicsImpl::getPixel( long nX, long nY ) char pixel[3] = { 0, 0, 0 }; PreDraw(); + nY = GetHeight() - nY; glReadPixels( nX, nY, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel); PostDraw(); diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx index 7618c04d6471..0c45d7758a33 100644 --- a/vcl/opengl/texture.cxx +++ b/vcl/opengl/texture.cxx @@ -52,6 +52,9 @@ ImplOpenGLTexture::ImplOpenGLTexture( int nX, int nY, int nWidth, int nHeight ) mnHeight( nHeight ), mnFilter( GL_NEAREST ) { + // FIXME We need the window height here + // nY = GetHeight() - nHeight - nY; + glGenTextures( 1, &mnTexture ); glBindTexture( GL_TEXTURE_2D, mnTexture ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); |