[Libreoffice-commits] core.git: vcl/android

Tor Lillqvist tml at iki.fi
Mon Feb 25 12:18:39 PST 2013


 vcl/android/androidinst.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit b917d352d97581122e5e445db54dd62565709a3f
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Feb 25 22:07:36 2013 +0200

    The source buffer (virtual device) has 4 bytes per pixel, too
    
    Now the desktop-style Writer window looks fine on my device. (The app still
    crashes quickly, though.)
    
    Change-Id: I2542fba653cfef651f207388f1fd98d186485d3b

diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 8bd285f..339d2e7 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -221,11 +221,10 @@ static void BlitFrameRegionToWindow(ANativeWindow_Buffer *pOutBuffer,
     // FIXME: do some cropping goodness on aSrcRect to ensure no overflows etc.
     ARect aSrcRect = rSrcRect;
 
-    // FIXME: by default we have WINDOW_FORMAT_RGB_565 = 4 ...
     for (unsigned int y = 0; y < (unsigned int)(aSrcRect.bottom - aSrcRect.top); y++)
     {
         unsigned char *sp = ( pSrc + nStride * (aSrcRect.top + y) +
-                              aSrcRect.left * 3 /* src pixel size */ );
+                              aSrcRect.left * 4 /* src pixel size */ );
 
         switch (pOutBuffer->format) {
         case WINDOW_FORMAT_RGBA_8888:
@@ -236,9 +235,9 @@ static void BlitFrameRegionToWindow(ANativeWindow_Buffer *pOutBuffer,
                                   nDestX * 4 /* dest pixel size */ );
             for (unsigned int x = 0; x < (unsigned int)(aSrcRect.right - aSrcRect.left); x++)
             {
-                dp[x*4 + 0] = sp[x*3 + 2]; // R
-                dp[x*4 + 1] = sp[x*3 + 1]; // G
-                dp[x*4 + 2] = sp[x*3 + 0]; // B
+                dp[x*4 + 0] = sp[x*4 + 2]; // R
+                dp[x*4 + 1] = sp[x*4 + 1]; // G
+                dp[x*4 + 2] = sp[x*4 + 0]; // B
                 dp[x*4 + 3] = 255; // A
             }
             break;


More information about the Libreoffice-commits mailing list