Kaydet (Commit) 7edd92c5 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Drop paintTile's row stride output parameter that nobody is interested in

Change-Id: I166b4b713c2ea52c62c52045bb2073b6d84c1547
üst 3925b8ac
......@@ -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;
......
......@@ -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
......
......@@ -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,
......
......@@ -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);
}
......
......@@ -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);
......
......@@ -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 {
......
......@@ -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++ )
{
......
......@@ -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",
......
......@@ -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]));
......
......@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment