diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-13 21:30:05 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-11-15 12:17:42 +0100 |
commit | aa9dfcee5039246874809f1235835415b8eaa1a9 (patch) | |
tree | 5fdbe1eeaf493d849b3fabf4beafe18a005dad4c /vcl/opengl | |
parent | 9d2afa44fd783820c64d424632f4d96278382253 (diff) |
vcl: Implement copyBits in the OpenGL backend
Change-Id: I101afd11394d3d024d38519afd61d700114702ac
Diffstat (limited to 'vcl/opengl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 027d9ac61174..801130ffbb29 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -30,6 +30,7 @@ #include <basegfx/polygon/b2dtrapezoid.hxx> #include <vcl/opengl/OpenGLHelper.hxx> +#include "salgdi.hxx" #include "opengl/salbmp.hxx" #include <vector> @@ -1082,13 +1083,13 @@ 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::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) { - // TODO Check if SalGraphicsImpl is the same - const bool bSameGraphics( false ); + OpenGLSalGraphicsImpl *pImpl = pSrcGraphics ? dynamic_cast< OpenGLSalGraphicsImpl* >(pSrcGraphics->GetImpl()) : NULL; SAL_INFO( "vcl.opengl", "::copyBits" ); - if( bSameGraphics && + + if( pImpl == this && (rPosAry.mnSrcWidth == rPosAry.mnDestWidth) && (rPosAry.mnSrcHeight == rPosAry.mnDestHeight)) { @@ -1102,6 +1103,16 @@ void OpenGLSalGraphicsImpl::copyBits( const SalTwoRect& rPosAry, SalGraphics* /* return; } + if( pImpl->mbOffscreen ) + { + Size aSize( pImpl->GetWidth(), pImpl->GetHeight() ); + PreDraw(); + DrawTexture( pImpl->maOffscreenTex, rPosAry ); + PostDraw(); + return; + } + + SAL_WARN( "vcl.opengl", "*** NOT IMPLEMENTED *** copyBits" ); // TODO Copy from one FBO to the other (glBlitFramebuffer) } |