summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-06-04 21:29:30 -0400
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-06-05 10:53:06 -0400
commitafcc01f161a4efd15a8bfd212423ac21f3d02e0c (patch)
tree7670f1f1f68ed30766d923e88671ba0b5aed884d
parentLOK: fast tile rendering (text only) (diff)
downloadcore-private/Ashod/fast-calc-rendering.tar.gz
core-private/Ashod/fast-calc-rendering.zip
LOK: fast tile rendering (graphics and buttons) private/Ashod/fast-calc-rendering
Since embedded graphics and buttons use absolute coordinates, we set the origin to be the top-left corner of the tile. This includes the origin + ScrPos (see previous patch). Then, the coordinates of the graphic is shifted by this amount to make sure it renders in its relative position to the tile. This renders embedded graphics and buttons at their correct position, with some limitations. Tiles large enough to cover a graphic object show the graphic object where it should be. However, rendering a relatively small tile doesn't render the graphic. This seems to be an issue with moving the graphic's coordinate at a later stage than the 2D Processor decides what objects intersect with the 'view area' that is rendered. Another issue is that graphs don't render. What they seem to suffer is incorrect scale and a fix coordinates (they show up as tiny thumbnails at the top-left corner and grow in proportion to the real graph when resized). These shall be addressed in a separate patch. Change-Id: I4b71bf5f2e357d1114d46022bc00905ceed0c2f9
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx20
-rw-r--r--vcl/source/outdev/bitmap.cxx15
2 files changed, 33 insertions, 2 deletions
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index b4d68733a87e..3124346be0b5 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <drawinglayer/processor2d/processor2dtools.hxx>
#include <svx/unoapi.hxx>
+#include <comphelper/lok.hxx>
#include "eventhandler.hxx"
#include <boost/scoped_ptr.hpp>
@@ -167,7 +168,7 @@ namespace sdr
bool bClipRegionPushed(false);
const vcl::Region& rRedrawArea(rDisplayInfo.GetRedrawArea());
- if(!rRedrawArea.IsEmpty())
+ if(!rRedrawArea.IsEmpty() && !comphelper::LibreOfficeKit::isActive())
{
bClipRegionPushed = true;
pOutDev->Push(PushFlags::CLIPREGION);
@@ -291,15 +292,32 @@ namespace sdr
rDisplayInfo.ClearGhostedDrawMode(); // reset, else the VCL-paint with the processor will not do the right thing
pOutDev->SetLayoutMode(TEXT_LAYOUT_DEFAULT); // reset, default is no BiDi/RTL
+ // Save the map-mode since creating the 2D processor will replace it.
+ const MapMode aOrig = pOutDev->GetMapMode();
+ MapMode aNew = aOrig;
+
// create renderer
boost::scoped_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
drawinglayer::processor2d::createProcessor2DFromOutputDevice(
rTargetOutDev, getViewInformation2D()));
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Restore the origin.
+ aNew.SetOrigin(aOrig.GetOrigin());
+ pOutDev->SetMapMode(aNew);
+ }
+
if(pProcessor2D)
{
pProcessor2D->process(xPrimitiveSequence);
}
+
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ // Restore the original map-mode.
+ pOutDev->SetMapMode(aOrig);
+ }
}
// #114359# restore old ClipReghion
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index e845562b27aa..69c7d1b1d4ca 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -35,6 +35,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <boost/scoped_array.hpp>
+#include <comphelper/lok.hxx>
void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap )
{
@@ -1191,12 +1192,24 @@ void OutputDevice::DrawTransformedBitmapEx(
// with no rotation, shear or mirroring it can be mapped to DrawBitmapEx
// do *not* execute the mirroring here, it's done in the fallback
// #i124580# the correct DestSize needs to be calculated based on MaxXY values
- const Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
+ Point aDestPt(basegfx::fround(aTranslate.getX()), basegfx::fround(aTranslate.getY()));
const Size aDestSize(
basegfx::fround(aScale.getX() + aTranslate.getX()) - aDestPt.X(),
basegfx::fround(aScale.getY() + aTranslate.getY()) - aDestPt.Y());
+ const Point aOrigin = GetMapMode().GetOrigin();
+ SAL_WARN("out", "Origin: " << aOrigin << ", destPt: " << aDestPt << ", destSize: " << aDestSize);
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ aDestPt.Move(aOrigin.getX(), aOrigin.getY());
+ EnableMapMode(false);
+ }
DrawBitmapEx(aDestPt, aDestSize, rBitmapEx);
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ EnableMapMode(true);
+ aDestPt.Move(-aOrigin.getX(), -aOrigin.getY());
+ }
return;
}