From dfeaee01a30109883e41f45faf28fc247dadb3b2 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 17 Nov 2014 04:35:29 +0000 Subject: vcl: copyBits should operate on mrParent if no context supplied. eg. OutputDevice::DrawOutDev: mpGraphics->CopyBits( aPosAry, NULL, this, NULL ); Change-Id: I0b041bb5aa6aba573b9f589842084722481cb438 --- vcl/inc/opengl/win/gdiimpl.hxx | 1 + vcl/inc/opengl/x11/gdiimpl.hxx | 1 + vcl/inc/openglgdiimpl.hxx | 2 +- vcl/opengl/gdiimpl.cxx | 4 ++-- vcl/opengl/win/gdiimpl.cxx | 6 ++++++ vcl/opengl/x11/gdiimpl.cxx | 6 ++++++ 6 files changed, 17 insertions(+), 3 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/opengl/win/gdiimpl.hxx b/vcl/inc/opengl/win/gdiimpl.hxx index 085be79bcef2..557e58a09af3 100644 --- a/vcl/inc/opengl/win/gdiimpl.hxx +++ b/vcl/inc/opengl/win/gdiimpl.hxx @@ -29,6 +29,7 @@ protected: virtual GLfloat GetHeight() const SAL_OVERRIDE; public: + virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) SAL_OVERRIDE; }; diff --git a/vcl/inc/opengl/x11/gdiimpl.hxx b/vcl/inc/opengl/x11/gdiimpl.hxx index 00eaf8cdf9c2..a2b863e3631d 100644 --- a/vcl/inc/opengl/x11/gdiimpl.hxx +++ b/vcl/inc/opengl/x11/gdiimpl.hxx @@ -32,6 +32,7 @@ protected: public: // implementation of X11GraphicsImpl + virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) SAL_OVERRIDE; void Init() SAL_OVERRIDE; bool FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) SAL_OVERRIDE; bool RenderPixmapToScreen( X11Pixmap* pPixmap, int nX, int nY ) SAL_OVERRIDE; diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx index dd0b1e38712d..80d760a69796 100644 --- a/vcl/inc/openglgdiimpl.hxx +++ b/vcl/inc/openglgdiimpl.hxx @@ -216,7 +216,7 @@ public: // CopyBits and DrawBitmap --> RasterOp and ClipRegion // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics - virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) SAL_OVERRIDE; + void DoCopyBits( const SalTwoRect& rPosAry, OpenGLSalGraphicsImpl *pSrcImpl ); virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) SAL_OVERRIDE; diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 8532ba026e17..9ed40b6e643d 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1171,9 +1171,9 @@ void OpenGLSalGraphicsImpl::copyArea( // CopyBits and DrawBitmap --> RasterOp and ClipRegion // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics -void OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) +void OpenGLSalGraphicsImpl::DoCopyBits( const SalTwoRect& rPosAry, OpenGLSalGraphicsImpl* pSrcImpl ) { - OpenGLSalGraphicsImpl *pImpl = pSrcGraphics ? dynamic_cast< OpenGLSalGraphicsImpl* >(pSrcGraphics->GetImpl()) : NULL; + OpenGLSalGraphicsImpl *pImpl = pSrcImpl; SAL_INFO( "vcl.opengl", "::copyBits" ); diff --git a/vcl/opengl/win/gdiimpl.cxx b/vcl/opengl/win/gdiimpl.cxx index e829ca445f42..67a192eb7f12 100644 --- a/vcl/opengl/win/gdiimpl.cxx +++ b/vcl/opengl/win/gdiimpl.cxx @@ -18,6 +18,12 @@ WinOpenGLSalGraphicsImpl::WinOpenGLSalGraphicsImpl(WinSalGraphics& rGraphics): { } +void WinOpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) +{ + OpenGLSalGraphicsImpl *pImpl = pSrcGraphics ? dynamic_cast< OpenGLSalGraphicsImpl* >(pSrcGraphics->GetImpl()) : static_cast< OpenGLSalGraphicsImpl *>(mrParent.GetImpl()); + OpenGLSalGraphicsImpl::DoCopyBits( rPosAry, pImpl ); +} + GLfloat WinOpenGLSalGraphicsImpl::GetWidth() const { if( mrParent.gethWnd() && IsWindow( mrParent.gethWnd() ) ) diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx index 5292038fcc9e..dcefcc23172f 100644 --- a/vcl/opengl/x11/gdiimpl.cxx +++ b/vcl/opengl/x11/gdiimpl.cxx @@ -81,6 +81,12 @@ void X11OpenGLSalGraphicsImpl::Init() } } +void X11OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) +{ + OpenGLSalGraphicsImpl *pImpl = pSrcGraphics ? dynamic_cast< OpenGLSalGraphicsImpl* >(pSrcGraphics->GetImpl()) : static_cast< OpenGLSalGraphicsImpl *>(mrParent.GetImpl()); + OpenGLSalGraphicsImpl::DoCopyBits( rPosAry, pImpl ); +} + bool X11OpenGLSalGraphicsImpl::FillPixmapFromScreen( X11Pixmap* pPixmap, int nX, int nY ) { Display* pDisplay = mrParent.GetXDisplay(); -- cgit v1.2.3