summaryrefslogtreecommitdiff
path: root/vcl/opengl/gdiimpl.cxx
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-28 14:58:53 -0500
committerJan Holesovsky <kendy@collabora.com>2014-12-02 15:47:34 +0100
commitf4527d8f17285a139ef8aa626c50c3b492108af9 (patch)
treec8df7bfd49903dc7bdabbb1b5246771f49d05dbf /vcl/opengl/gdiimpl.cxx
parent5933c72dd39d597037528f8473fa2bf67e59a757 (diff)
vcl: Fix a coordinate issue when getting a bitmap from a VirtualDevice
Change-Id: I06fef2765f2dc9d64a991385a984a4c75a1fd424
Diffstat (limited to 'vcl/opengl/gdiimpl.cxx')
-rw-r--r--vcl/opengl/gdiimpl.cxx3
1 files changed, 2 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();