diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-06-04 21:29:30 -0400 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-09-16 08:03:00 -0400 |
commit | 11ab43d83615df6e08b7e8061e2fd25c6609b30e (patch) | |
tree | fe4e9b32bc59ed533edbb34f65c90ba7ac4d2fa9 /vcl/source | |
parent | 34b9cbf6640a9c8ea812bfc7c7f31c95acd2e495 (diff) |
LOK: fast tile rendering (graphics and buttons)
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.
Reviewed-on: https://gerrit.libreoffice.org/26204
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 5f01d80f75dc86b393cc2fdb66b94aece964c674)
Change-Id: I4b71bf5f2e357d1114d46022bc00905ceed0c2f9
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 01b6cb8cce52..0e2dd19aa21d 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -35,6 +35,7 @@ #include <basegfx/matrix/b2dhommatrixtools.hxx> #include <memory> +#include <comphelper/lok.hxx> void OutputDevice::DrawBitmap( const Point& rDestPt, const Bitmap& rBitmap ) { @@ -1187,12 +1188,23 @@ 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(); + 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; } |