[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit include/vcl ios/experimental libreofficekit/qa libreofficekit/source vcl/headless

Tor Lillqvist tml at collabora.com
Fri Mar 20 04:15:32 PDT 2015


 desktop/source/lib/init.cxx                                    |    7 -------
 desktop/source/lib/lokandroid.cxx                              |    4 +---
 include/LibreOfficeKit/LibreOfficeKit.h                        |    1 -
 include/LibreOfficeKit/LibreOfficeKit.hxx                      |    3 +--
 include/vcl/svpforlokit.hxx                                    |    1 -
 ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m |    2 --
 libreofficekit/qa/lokdocview_quad/lokdocview_quad.c            |   10 ----------
 libreofficekit/qa/tilebench/tilebench.cxx                      |    9 +++------
 libreofficekit/source/gtk/lokdocview.cxx                       |    3 ---
 vcl/headless/svpvd.cxx                                         |    8 --------
 10 files changed, 5 insertions(+), 43 deletions(-)

New commits:
commit 7edd92c5576cc358815eb21634b3c27a43990c20
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Mar 20 13:12:08 2015 +0200

    Drop paintTile's row stride output parameter that nobody is interested in
    
    Change-Id: I166b4b713c2ea52c62c52045bb2073b6d84c1547

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c29223b..d0ae29b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -185,7 +185,6 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis, int nPartMode);
 void        doc_paintTile(LibreOfficeKitDocument* pThis,
                           unsigned char* pBuffer,
                           const int nCanvasWidth, const int nCanvasHeight,
-                          int* pRowStride,
                           const int nTilePosX, const int nTilePosY,
                           const int nTileWidth, const int nTileHeight);
 static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
@@ -585,7 +584,6 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis,
 void doc_paintTile (LibreOfficeKitDocument* pThis,
                     unsigned char* pBuffer,
                     const int nCanvasWidth, const int nCanvasHeight,
-                    int* pRowStride,
                     const int nTilePosX, const int nTilePosY,
                     const int nTileWidth, const int nTileHeight)
 {
@@ -615,8 +613,6 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 
     pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
                     nTilePosX, nTilePosY, nTileWidth, nTileHeight);
-
-    *pRowStride = GetRowStrideForLibreOfficeKit(aDevice.getSalVirtualDevice());
 #else
     SystemGraphicsData aData;
     aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
@@ -625,8 +621,6 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
 
     pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
                     nTilePosX, nTilePosY, nTileWidth, nTileHeight);
-
-    (void) pRowStride;
 #endif
 
     static bool bDebug = getenv("LOK_DEBUG") != 0;
@@ -646,7 +640,6 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
     (void) pBuffer;
     (void) nCanvasWidth;
     (void) nCanvasHeight;
-    (void) pRowStride;
     (void) nTilePosX;
     (void) nTilePosY;
     (void) nTileWidth;
diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index c23fd3f..5f7eab4 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -220,9 +220,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_paintTi
     LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
 
     unsigned char* buffer = (unsigned char*) pEnv->GetDirectBufferAddress(aByteBuffer);
-    int nStride = 0;
-    pDocument->pClass->paintTile(pDocument, buffer, nCanvasWidth, nCanvasHeight, &nStride, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
-    (void) nStride;
+    pDocument->pClass->paintTile(pDocument, buffer, nCanvasWidth, nCanvasHeight, nTilePosX, nTilePosY, nTileWidth, nTileHeight);
 }
 
 extern "C" SAL_JNI_EXPORT jlong JNICALL Java_org_libreoffice_kit_Document_getDocumentHeight
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 85f760c..98aa24d 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -97,7 +97,6 @@ struct _LibreOfficeKitDocumentClass
                            unsigned char* pBuffer,
                            const int nCanvasWidth,
                            const int nCanvasHeight,
-                           int* pRowStride,
                            const int nTilePosX,
                            const int nTilePosY,
                            const int nTileWidth,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 1d7d709..25d8980 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -73,13 +73,12 @@ public:
                           unsigned char* pBuffer,
                           const int nCanvasWidth,
                           const int nCanvasHeight,
-                          int* pRowStride,
                           const int nTilePosX,
                           const int nTilePosY,
                           const int nTileWidth,
                           const int nTileHeight)
     {
-        return mpDoc->pClass->paintTile(mpDoc, pBuffer, nCanvasWidth, nCanvasHeight, pRowStride,
+        return mpDoc->pClass->paintTile(mpDoc, pBuffer, nCanvasWidth, nCanvasHeight,
                                 nTilePosX, nTilePosY, nTileWidth, nTileHeight);
     }
 
diff --git a/include/vcl/svpforlokit.hxx b/include/vcl/svpforlokit.hxx
index 51299ee..0b8477a 100644
--- a/include/vcl/svpforlokit.hxx
+++ b/include/vcl/svpforlokit.hxx
@@ -18,7 +18,6 @@
 class SalFrame;
 
 VCL_DLLPUBLIC void InitSvpForLibreOfficeKit();
-VCL_DLLPUBLIC int GetRowStrideForLibreOfficeKit(SalVirtualDevice* pVD);
 VCL_DLLPUBLIC SalFrame* GetSvpFocusFrameForLibreOfficeKit();
 VCL_DLLPUBLIC vcl::Window* GetSalFrameWindowForLibreOfficeKit(SalFrame *pSF);
 
diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m b/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m
index 4092379..75a14e7 100644
--- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m
+++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/TiledView.m
@@ -176,10 +176,8 @@ extern const char *ptyl_test_encryption_pathname;
 
     if (!getenv("DRAW_ONLY_TILE") || tileMatches(getenv("DRAW_ONLY_TILE"), bb)) {
         fprintf(stderr, "+++ rendering to context %p\n", ctx);
-        int rowStride;
         loDocument->pClass->paintTile(loDocument, (unsigned char *)ctx,
                                       tileSize.width, tileSize.height,
-                                      &rowStride,
                                       bb.origin.x/self.scale, bb.origin.y/self.scale,
                                       bb.size.width/self.scale, bb.size.height/self.scale);
     } else {
diff --git a/libreofficekit/qa/lokdocview_quad/lokdocview_quad.c b/libreofficekit/qa/lokdocview_quad/lokdocview_quad.c
index c920f1f..90240064 100644
--- a/libreofficekit/qa/lokdocview_quad/lokdocview_quad.c
+++ b/libreofficekit/qa/lokdocview_quad/lokdocview_quad.c
@@ -109,7 +109,6 @@ void renderDocument( LOKDocViewQuad* pDocView )
 {
     long nWidth, nHeight;
     int nRenderWidth, nRenderHeight;
-    int nRowStride;
     int x, y;
     GdkPixbuf* pTempBuf;
 
@@ -145,7 +144,6 @@ void renderDocument( LOKDocViewQuad* pDocView )
     pDocView->pDocument->pClass->paintTile( pDocView->pDocument,
                                             gdk_pixbuf_get_pixels( pDocView->pPixBuf[0][0] ),
                                             nRenderWidth / 2, nRenderHeight / 2,
-                                            &nRowStride,
                                             0, 0, // origin
                                             nWidth / 2, nHeight / 2 );
 
@@ -155,7 +153,6 @@ void renderDocument( LOKDocViewQuad* pDocView )
     pDocView->pDocument->pClass->paintTile( pDocView->pDocument,
                                             gdk_pixbuf_get_pixels( pDocView->pPixBuf[1][0] ),
                                             nRenderWidth, nRenderHeight,
-                                            &nRowStride,
                                             nWidth / 2, 0,
                                             nWidth / 2, nHeight / 2 );
     pTempBuf = gdk_pixbuf_scale_simple( GDK_PIXBUF( pDocView->pPixBuf[1][0] ),
@@ -172,7 +169,6 @@ void renderDocument( LOKDocViewQuad* pDocView )
     pDocView->pDocument->pClass->paintTile( pDocView->pDocument,
                                             gdk_pixbuf_get_pixels( pDocView->pPixBuf[0][1] ),
                                             nRenderWidth / 4, nRenderHeight / 4,
-                                            &nRowStride,
                                             0, nHeight / 2,
                                             nWidth / 2, nHeight / 2 );
     pTempBuf = gdk_pixbuf_scale_simple( GDK_PIXBUF( pDocView->pPixBuf[0][1] ),
@@ -188,7 +184,6 @@ void renderDocument( LOKDocViewQuad* pDocView )
     pDocView->pDocument->pClass->paintTile( pDocView->pDocument,
                                             gdk_pixbuf_get_pixels( pDocView->pPixBuf[1][1] ),
                                             nRenderWidth / 8, nRenderHeight / 8,
-                                            &nRowStride,
                                             nWidth / 2, nHeight / 2,
                                             nWidth / 2, nHeight / 2 );
     pTempBuf = gdk_pixbuf_scale_simple( GDK_PIXBUF( pDocView->pPixBuf[1][1] ),
@@ -200,11 +195,6 @@ void renderDocument( LOKDocViewQuad* pDocView )
 
 
 
-    // TODO: double check that the rowstride really matches what we expected,
-    // although presumably we'd already be crashing by now if things were
-    // wrong.
-    (void) nRowStride;
-
     //    gtk_image_set_from_pixbuf( GTK_IMAGE( pDocView->pCanvas ), pDocView->pPixBuf );
     for ( x = 0; x < 2; x++ )
     {
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index 013f866..e72c730 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -98,8 +98,7 @@ int main( int argc, char* argv[] )
 
             { // whole document
                 aTimes.push_back(TimeRecord("render whole document"));
-                int nRowStride = 256;
-                pDocument->paintTile(pPixels, 256, 256, &nRowStride,
+                pDocument->paintTile(pPixels, 256, 256,
                                      0, 0, nWidth, nHeight); // not square
                 aTimes.push_back(TimeRecord());
             }
@@ -112,10 +111,9 @@ int main( int argc, char* argv[] )
                 {
                     for (int nY = 0; nY < nHeight / nSplit; nY++)
                     {
-                        int nRowStride = 256;
                         int nTilePosX = nX * nSplit;
                         int nTilePosY = nY * nSplit;
-                        pDocument->paintTile(pPixels, 256, 256, &nRowStride,
+                        pDocument->paintTile(pPixels, 256, 256,
                                              nTilePosX, nTilePosY, 256, 256);
                         nTiles++;
                         fprintf (stderr, "   rendered tile %d at %d, %d\n",
@@ -133,10 +131,9 @@ int main( int argc, char* argv[] )
                 {
                     for (int nY = 0; nY < nHeight / nSplit; nY++)
                     {
-                        int nRowStride = 256;
                         int nTilePosX = nX * nSplit;
                         int nTilePosY = nY * nSplit;
-                        pDocument->paintTile(pPixels, 256, 256, &nRowStride,
+                        pDocument->paintTile(pPixels, 256, 256,
                                              nTilePosX, nTilePosY, nSplit, nSplit);
                         nTiles++;
                         fprintf (stderr, "   rendered tile %d at %d, %d\n",
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 668d6de..b2597d2 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -697,17 +697,14 @@ void renderDocument(LOKDocView* pDocView, GdkRectangle* pPartial)
                 GdkPixbuf* pPixBuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, aTileRectanglePixels.width, aTileRectanglePixels.height);
                 unsigned char* pBuffer = gdk_pixbuf_get_pixels(pPixBuf);
                 g_info("renderDocument: paintTile(%d, %d)", nRow, nColumn);
-                int nRowStride;
                 pDocView->pDocument->pClass->paintTile(pDocView->pDocument,
                                                        // Buffer and its size, depends on the position only.
                                                        pBuffer,
                                                        aTileRectanglePixels.width, aTileRectanglePixels.height,
-                                                       &nRowStride,
                                                        // Position of the tile.
                                                        aTileRectangleTwips.x, aTileRectangleTwips.y,
                                                        // Size of the tile, depends on the zoom factor and the tile position only.
                                                        aTileRectangleTwips.width, aTileRectangleTwips.height);
-                (void) nRowStride;
 
                 if (pDocView->pCanvas[nTile])
                     gtk_widget_destroy(GTK_WIDGET(pDocView->pCanvas[nTile]));
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index 0daf4cd..f720d18 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -104,14 +104,6 @@ void InitSvpForLibreOfficeKit()
     pSalInstance->setBitCountFormatMapping( 32, ::basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA );
 }
 
-int GetRowStrideForLibreOfficeKit(SalVirtualDevice* pVD)
-{
-    SvpSalVirtualDevice* pSalDev = static_cast< SvpSalVirtualDevice* >(pVD);
-    basebmp::BitmapDeviceSharedPtr pBmpDev = pSalDev->getBitmapDevice();
-
-    return pBmpDev->getScanlineStride();
-}
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list