sw/qa/tiledrendering/tiledrendering.cxx | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)
New commits: commit 75878a5a406858bf2a8f852a756f9e63d8df2ada Author: Jan Holesovsky <ke...@collabora.com> Date: Fri Oct 25 20:44:06 2013 +0200 Tiled rendering: Use VirtualDevice, and set the MapMode correctly. Change-Id: I79394beff70e5f1db3ec2e6995c9a8fd666d00a5 diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx index 3adbf83..9d168d8 100644 --- a/sw/qa/tiledrendering/tiledrendering.cxx +++ b/sw/qa/tiledrendering/tiledrendering.cxx @@ -119,29 +119,24 @@ IMPL_LINK ( TiledRenderingDialog, RenderHdl, Button *, EMPTYARG ) // SystemGraphicsData aData; // [setup the aData] // VirtualDevice aDevice(&aData, [color depth]); -/* - // FIXME don't use pViewShell()->GetOut() directly, we need an own - // device here, something like -#ifdef IOS - VirtualDevice aDevice(8); -#else - VirtualDevice aDevice(1); -#endif - - aDevice.SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1); + VirtualDevice aDevice; + MapMode aMapMode(aDevice.GetMapMode()); aMapMode.SetMapUnit(MAP_TWIP); + aMapMode.SetOrigin(Point(-tilePosX, -tilePosY)); aDevice.SetMapMode(aMapMode); - aDevice.SetOutputSizePixel(Size(contextWidth, contextHeight)); -*/ + aDevice.SetOutputSizePixel(aDevice.PixelToLogic(Size(contextWidth, contextHeight))); + + // draw + pViewShell->PaintTile(&aDevice, Rectangle(Point(tilePosX, tilePosY), Size(tileWidth, tileHeight))); - pViewShell->PaintTile(pViewShell->GetOut(), Rectangle(tilePosX, tilePosY, tileWidth, tileHeight)); - // FIXME pViewShell->PaintTile(&aDevice, Rectangle(tilePosX, tilePosY, tileWidth, tileHeight)); + // debug + // aDevice.SetFillColor(Color(COL_RED)); + // aDevice.DrawRect(Rectangle(1000, 1000, 2000, 2000)); // copy the aDevice content to mpImage - // FIXME BitmapEx aBitmap(pViewShell->GetOut()->GetBitmapEx(Point(0,0), aDevice.PixelToLogic(Size(contextWidth, contextHeight)))); - BitmapEx aBitmap(pViewShell->GetOut()->GetBitmapEx(Point(0,0), pViewShell->GetOut()->PixelToLogic(Size(contextWidth, contextHeight)))); + Bitmap aBitmap(aDevice.GetBitmap(aDevice.PixelToLogic(Point(0,0)), aDevice.PixelToLogic(Size(contextWidth, contextHeight)))); mpImage->SetImage(Image(aBitmap)); // update the dialog size _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits