diff options
author | Jan Holesovsky <kendy@collabora.com> | 2013-10-25 20:44:06 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2013-11-15 16:51:53 +0100 |
commit | bd7d704025d78c4a448c555b6e7735f4ad02bf27 (patch) | |
tree | b52a931142fcf2680da27eeefaa498c4665def0f /sw/qa/tiledrendering | |
parent | 5c31a30f84edc432a85961aff948fcb07fa1e05d (diff) |
Tiled rendering: Use VirtualDevice, and set the MapMode correctly.
Change-Id: I79394beff70e5f1db3ec2e6995c9a8fd666d00a5
Diffstat (limited to 'sw/qa/tiledrendering')
-rw-r--r-- | sw/qa/tiledrendering/tiledrendering.cxx | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx index 3adbf83515b9..9d168d892020 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 |