Kaydet (Commit) f2c3fcc3 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Tiled rendering: Very crude way to "show something".

We are reusing the ViewShell's output device; instead we should provide an
own, and draw to that one - to be continued...

Change-Id: I4ed1bffbbcedeefa955db1d59eb4b252f4a25a64
üst 637e8970
...@@ -125,13 +125,29 @@ IMPL_LINK ( TiledRenderingDialog, RenderHdl, Button *, EMPTYARG ) ...@@ -125,13 +125,29 @@ IMPL_LINK ( TiledRenderingDialog, RenderHdl, Button *, EMPTYARG )
// SystemGraphicsData aData; // SystemGraphicsData aData;
// [setup the aData] // [setup the aData]
// VirtualDevice aDevice(&aData, [color depth]); // VirtualDevice aDevice(&aData, [color depth]);
VirtualDevice aDevice; /*
// 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);
MapMode aMapMode(aDevice.GetMapMode());
aMapMode.SetMapUnit(MAP_TWIP);
aDevice.SetMapMode(aMapMode);
aDevice.SetOutputSizePixel(Size(contextWidth, contextHeight)); aDevice.SetOutputSizePixel(Size(contextWidth, contextHeight));
*/
pViewShell->PaintTile(&aDevice, Rectangle(tilePosX, tilePosY, tileWidth, tileHeight)); pViewShell->PaintTile(pViewShell->GetOut(), Rectangle(tilePosX, tilePosY, tileWidth, tileHeight));
// FIXME pViewShell->PaintTile(&aDevice, Rectangle(tilePosX, tilePosY, tileWidth, tileHeight));
// copy the aDevice content to mpImage // copy the aDevice content to mpImage
BitmapEx aBitmap(aDevice.GetBitmapEx(Point(0,0), aDevice.GetOutputSizePixel())); // 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))));
mpImage->SetImage(Image(aBitmap)); mpImage->SetImage(Image(aBitmap));
// update the dialog size // update the dialog size
......
...@@ -1754,17 +1754,18 @@ void SwViewShell::PaintTile(OutputDevice *pOut, const Rectangle &rRect) ...@@ -1754,17 +1754,18 @@ void SwViewShell::PaintTile(OutputDevice *pOut, const Rectangle &rRect)
{ {
assert(pOut); assert(pOut);
pOut->SetPixelOffset(Size(-rRect.TopLeft().X(), -rRect.TopLeft().Y())); pOut->SetPixelOffset(Size(rRect.TopLeft().X(), rRect.TopLeft().Y()));
// TODO make the tileWidth/Height fit the width/height of the pOut device // TODO make the tileWidth/Height fit the width/height of the pOut device
// now we need to setup the SwViewShell's output device // now we need to setup the SwViewShell's output device
// TODO clean up SwViewShell's approach to output devices // TODO clean up SwViewShell's approach to output devices
OutputDevice *pSaveOut = mpOut; OutputDevice *pSaveOut = GetOut();
mpOut = pOut; SetOutDev(this, pOut);
Paint(rRect); Paint(rRect);
mpOut = pSaveOut; SetOutDev(this, pSaveOut);
} }
#if !HAVE_FEATURE_DESKTOP #if !HAVE_FEATURE_DESKTOP
......
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