[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl2' - vcl/opengl

Louis-Francis Ratté-Boulianne lfrb at collabora.com
Tue Nov 18 16:12:41 PST 2014


 vcl/opengl/gdiimpl.cxx |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

New commits:
commit 483a43df80569285006c4f8876508d8aa2a88a6d
Author: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
Date:   Tue Nov 18 19:11:04 2014 -0500

    vcl: Implement copyArea in OpenGL backend
    
    Change-Id: If98a2f39a7f3c3079abe7f5e293d7761db0ed8f9

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index a255804..c008cc2 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1358,12 +1358,26 @@ bool OpenGLSalGraphicsImpl::drawPolyPolygonBezier(
 
 // CopyArea --> No RasterOp, but ClipRegion
 void OpenGLSalGraphicsImpl::copyArea(
-            long /*nDestX*/, long /*nDestY*/,
-            long /*nSrcX*/, long /*nSrcY*/,
-            long /*nSrcWidth*/, long /*nSrcHeight*/,
+            long nDestX, long nDestY,
+            long nSrcX, long nSrcY,
+            long nSrcWidth, long nSrcHeight,
             sal_uInt16 /*nFlags*/ )
 {
-    SAL_INFO( "vcl.opengl", "::copyArea" );
+    SAL_INFO( "vcl.opengl", "::copyArea " << nSrcX << "," << nSrcY << " >> " << nDestX << "," << nDestY << " (" << nSrcWidth << "," << nSrcHeight << ")" );
+    OpenGLTexture aTexture;
+    SalTwoRect aPosAry;
+
+    aPosAry.mnSrcX = 0;
+    aPosAry.mnSrcY = 0;
+    aPosAry.mnDestX = nDestX;
+    aPosAry.mnDestY = nDestY;
+    aPosAry.mnSrcWidth = aPosAry.mnDestWidth = nSrcWidth;
+    aPosAry.mnSrcHeight = aPosAry.mnDestHeight = nSrcHeight;
+
+    PreDraw();
+    aTexture = OpenGLTexture( nSrcX, GetHeight() - nSrcY - nSrcHeight, nSrcWidth, nSrcHeight );
+    DrawTexture( aTexture, aPosAry );
+    PostDraw();
 }
 
 // CopyBits and DrawBitmap --> RasterOp and ClipRegion
@@ -1459,6 +1473,7 @@ SalBitmap* OpenGLSalGraphicsImpl::getBitmap( long nX, long nY, long nWidth, long
     SAL_INFO( "vcl.opengl", "::getBitmap " << nX << "," << nY <<
               " " << nWidth << "x" << nHeight );
     PreDraw();
+    nY = GetHeight() - nHeight - nY;
     if( !pBitmap->Create( maOffscreenTex, nX, nY, nWidth, nHeight ) )
     {
         delete pBitmap;


More information about the Libreoffice-commits mailing list