Commit Graph

138 Commits

Author SHA1 Message Date
Mox Soini
0c87f8bf42 Cleanup crossplatform cairo
Mac / Win cairo is not built / used, this cairo code can be removed to
reduce code bloat.

4th Revised version with Android fixes

Change-Id: I6e56850f535ca13b77839b7d67e227c5f39d388e
Reviewed-on: https://gerrit.libreoffice.org/16218
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-06-11 08:35:09 +00:00
Noel Grandin
d4917e9970 convert basebmp::Format to scoped enum
Change-Id: I6eb213d6dcf387936967271fba9e2de3879ef479
2015-06-04 08:30:24 +02:00
Noel Grandin
5ad3886ec8 convert EXTTEXTINPUT constants to scoped enum
Change-Id: I1bb4ff2c13eaa2a9da3e32963ac0802e947e18d9
2015-05-27 11:14:25 +02:00
Noel Grandin
b13fbd19b7 convert BMP_SCALE constant to scoped enum
Change-Id: Ibc9f88d2588c028cd71aa86c26d970a73025ef22
2015-05-06 09:01:30 +02:00
Noel Grandin
e9cb5577f4 loplugin:staticmethods
Change-Id: Ibf0c73ac17ec19ed672f66907db47057920babca
2015-04-02 09:38:29 +02:00
Caolán McNamara
e510a208b0 move cairo helpers to vcl and make per-plug
Change-Id: I4de4d5c3a191784598e93a8cf70e45a3f59ae857
Reviewed-on: https://gerrit.libreoffice.org/14907
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-23 11:42:28 +00:00
Tor Lillqvist
ff0c2916f0 No need for svp_create_SalInstance to be extern "C"
Change-Id: I29eb3dfee751c5f40690f604eaff9bd1f18cf046
2015-03-20 18:36:21 +02:00
Tor Lillqvist
41c6631288 The 'svp' "plug-in" library is empty so don't build it at all
Its code is in the vcl library nowadays.

Change-Id: Idb659e541226724004660102f6641c38a2312c27
2015-03-20 17:55:08 +02:00
Tor Lillqvist
a84456142a Don't include vcl's private include files in desktop
Introduce a handful of small public wrapper functions.

Change-Id: I80e1e35d09675112d67b831f3efda483e709b540
2015-03-20 12:52:31 +02:00
Caolán McNamara
6c80674942 reorganize resizing surfaces logic
the only case where we don't just create a new surface is the X11 case

Change-Id: I98a3c8f227e208ac9db969ed7711e293fb237c2e
Reviewed-on: https://gerrit.libreoffice.org/14902
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-19 13:17:46 +00:00
Noel Grandin
062e40c76b loplugin:constantfunction: vcl
Change-Id: I985b781a8d53190505fcb1182749cdaf5cd0f8d0
2015-03-19 10:45:00 +02:00
Caolán McNamara
6ef1cb0c57 move the cairo resize hack into vcl
Change-Id: I41868da3901d9c3fff69c11da467952176e58f09
Reviewed-on: https://gerrit.libreoffice.org/14897
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-19 00:34:30 +00:00
Caolán McNamara
3d49571225 revert work in progress
Change-Id: I1387b0ed7b2d8bb9df801c03cf59efc9c0e1cfd3
2015-03-18 17:43:03 +00:00
Caolán McNamara
2beb8b2e6a more thinking
Change-Id: Ie349bd35b1fc92b77cc15f51eb886a1c9c92cbe1
2015-03-18 17:24:04 +00:00
Caolán McNamara
dce032e3ac thinking
Change-Id: Ib1a086bed7f70e244db2a0bd32819560c6949d51
2015-03-18 17:24:04 +00:00
Caolán McNamara
f59345721b move the cairo resize hack into vcl
Change-Id: Ifd1817a28f4fb7ddcc85447fd3388fd0efd86476
2015-03-18 17:24:03 +00:00
Caolán McNamara
34dc97c791 move IsCairoWorking to vclplug level and rename
Change-Id: Id31de932afa61df6933d61ddba971f5d7060f0c1
2015-03-18 12:32:30 +00:00
Caolán McNamara
924b2923b8 V801: Decreased performance
Change-Id: I9e9a00acf9503980f0c6c7cd0a20378e5ca7390d
2015-03-09 20:56:26 +00:00
Caolán McNamara
7c065a13e1 GtkSalGraphics never operate on virtual devices
the VirtualDevice is a SvpSalVirtualDevice and it
uses its own SvpSalGraphics to render to itself,
so we don't have to worry about being asked to
render to a VirtualDevice

i.e. Revert "just in case, fallback if not cairo-surface"

This reverts commit 756b2c9451.

Conflicts:
	vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx

Change-Id: I3bd3ce42e7c943f8cfca1cc1d2ea6e5eb51bb349
2015-03-04 13:08:08 +00:00
Caolán McNamara
756b2c9451 just in case, fallback if not cairo-surface
Change-Id: I5c185f9306f73f787f38566ba5335b5a8f51ee1d
2015-03-03 09:44:23 +00:00
Caolán McNamara
7b4c2d8364 render text with cairo under gtk3, not headless solution
Change-Id: I309eaef08f597658c068170875733e5e1daa56ef
Reviewed-on: https://gerrit.libreoffice.org/14715
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-03 09:42:36 +00:00
Caolán McNamara
6efb7f65ee if you link vclplug_svp to desktop you end up with duplicate font caches
so how about we just move all of the svp "headless" stuff into vcl
proper

Change-Id: Ibf4ab0b0698ef031ffeeb05ef9bbcf3b89144010
Reviewed-on: https://gerrit.libreoffice.org/14714
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-02 17:34:59 +00:00
Michael Meeks
4530643175 tdf#89482 - return size of system virtual device resource at construction.
Change-Id: I832a5626b52935180f24857e56297840667eec2a
Reviewed-on: https://gerrit.libreoffice.org/14678
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2015-02-28 14:23:31 +00:00
Caolán McNamara
dd179370e0 seperate headless textrendering into its own class
and forward calls to it from the SvpGraphics

Change-Id: I6d1fbc8919596d5f47661b3471570fcb7e14bc3e
2015-02-27 13:51:06 +00:00
Caolán McNamara
46ce83541b Restore "Use the cairo-compatible basebmp surface for headless"
as it now works again after ancient emf import bug is fixed by

commit 5e5b90c128
Date:   Thu Feb 26 13:47:58 2015 +0000
    in BITFIELDS mode (3) there are *3* pal entries not 12

and two writer qa tests adapted to test for the actual pixel color vs the
underlying pixel data

This reverts commit 3c4f7704e0.

Change-Id: Id94f98f9c620c90fda097fa97fc34c9ee957c483
2015-02-26 20:59:24 +00:00
Stephan Bergmann
3c4f7704e0 Revert "Use the cairo-compatible basebmp surface for headless"
This reverts commit a785df6a5f plus follow-up
3594c9ce1c "presumably destroy flushes" and
b5b19508da "WaE: -Werror=unused-variable," as it
triggered the assert(nLen <= 8) in ColorMask::ImplCalcMaskShift
(include/vcl/salbtype.hxx) in various tests.

Change-Id: Ic5433522fcd9b8cc7c4e82704cebe7d9bbcea586
2015-02-26 13:58:22 +01:00
Caolán McNamara
a785df6a5f Use the cairo-compatible basebmp surface for headless
That way the conversion from basebmp to cairo becomes unnecessary on blitting
the thing onto a cairo surface for gtk3 and opens a route to using cairo, e.g.
especially for text, to render to basebmp surfaces.

Change-Id: I1d11f503410af9c92a97018e9ee20045412b157e
2015-02-25 17:06:15 +00:00
Caolán McNamara
911f3a122a these are const inputs, we fill widths from pGlyphIds via pEncoding
Change-Id: I32d8bbc5083223b540f76a928de505d611627957
Reviewed-on: https://gerrit.libreoffice.org/14196
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-01-27 15:22:32 +00:00
Michael Stahl
5183910a90 rhbz#1177022: vcl: fix PDF embedding of Type 1 fonts
Problem is that for the "CM Typewriter" font the Width for "space" (32)
is exported as 0 instead of 525, which is the correct value in the AFM.

The reason is that PDFWriterImpl::emitEmbeddedFont() has various arrays
to map from font code points to Unicode code points, and there are
duplicate mappings, so the 160->32 mapping overrides 32->32.

The PrintFontManager::PrintFont::readAfmMetrics() actually creates a
Unicode to font code mapping (which may legitimately be n:1) that is
then inverted; add an additional hack to store a set of "preferred"
Unicodes so that PDFWriterImpl can pick the right Unicode.

Presumably the code that is stored explicitly via "C" or "CH" in the
AFM should take priority over more generic mappings.

Change-Id: Id4205a1cd45ba6a0a5facee1e39f70c3535e7dd4
2015-01-27 14:42:13 +01:00
Caolán McNamara
dbf15c9044 add a length arg to GetEmbedFontData
for the cases where we don't want the full result
and mark some ultra-dubious code with a TODO

Change-Id: I7cf57b8d44bbad2a6db86a8b862a757ae5062c50
Reviewed-on: https://gerrit.libreoffice.org/14189
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-01-27 10:45:20 +00:00
Noel Grandin
b44cbb26ef new loplugin: change virtual methods to non-virtual
Where we can prove that the virtual method is never overriden.

In the case of pure-virtual methods, we remove the method entirely.
Sometimes this leads to entire methods and fields being
eliminated.

Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2015-01-26 08:42:28 +02:00
Miklos Vajna
8de3943524 Add lok::Office::postKeyEvent()
Change-Id: Ib80a8dd433b22a5e88aaab8e11d5c42ced8097ae
2015-01-12 11:06:41 +01:00
Michael Stahl
2f69e16c72 override the overloading of "overload" to decrease cognitive (over-)load
Change-Id: I4d0e1de89d0bbdbea23bc5a46bf75ae0ce4e2796
2015-01-09 00:00:47 +01:00
Noel Grandin
8aa3cb98ad fdo#84938: convert VCL_INPUT_ #defines to 'enum class'
Change-Id: I155e45f58974a2b946c4a7703b350bcbfbad342e
2015-01-07 11:20:43 +02:00
Noel Grandin
079590c909 fdo#84938: convert INDICATOR_ #defines to 'enum class'
and replace SalIndicatorState, it serves the same purpose

Change-Id: I618b8946b8e2527883eecb13060b2256abc505b6
2015-01-07 11:20:43 +02:00
Caolán McNamara
fd1372ba8b boost::unordered_map->std::unordered_map
you can get debug stl this way

Change-Id: Ia70a3e7c7c452390e8bee34975d296c9318e4a19
2015-01-02 16:14:36 +00:00
Louis-Francis Ratté-Boulianne
83861ce123 vcl: Add BitmapInfoAccess for bitmaps' metadata access
Change-Id: Iec9f8c7d8f7cded0aef9e017373e44387dc0b05c
2014-12-11 07:57:27 +01:00
Louis-Francis Ratté-Boulianne
cf3ba35615 vcl: Add dummy Replace to SalBitmap implementations
Change-Id: I2f8b11a3f7cb8872a1d8f6eeeae8ce3f30223496
2014-12-03 14:05:36 +01:00
Matúš Kukan
58824d6f55 Add dummy Erase to SalBitmap implementations
Change-Id: I5790deb9ab5af6f8678c964af5321264d3bce733
2014-12-03 14:05:35 +01:00
Michael Meeks
c31ed7004d vcl: create a GeometryProvider interface.
Implemented by both SalFrame and SalVirtualDevice, to help us to
un-tangle code that needs to operate on resources associated with
both of these without special cases.

Change-Id: If681a002647e20c57186577fe039d4ac85bba872
2014-12-02 08:34:52 +01:00
Michael Meeks
c22d5338fa vcl: remove SalVirtualDevice::GetWidth
It is presumed that #i59315# is fixed already, and that this is no
longer necessary.

Change-Id: Ifb2f6550fac2481c4fec269b38d6e806753cb53e
2014-12-02 08:34:51 +01:00
Chris Sherlock
c9271bd507 vcl: remove IOS/OSX only code
Change-Id: I83fd835a8a198ff469cfaa0441c938acf9433862
Reviewed-on: https://gerrit.libreoffice.org/13206
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-30 08:38:12 +00:00
Markus Mohrhard
7514dc3424 move the iOS SalGraphics code back into the OSX one
Conflicts:
	vcl/inc/headless/svpgdi.hxx

Change-Id: I4cd9163bcbb8cdee21e5bce3303894923c4238d6
2014-11-30 05:16:11 +01:00
Louis-Francis Ratté-Boulianne
4b6feefa51 vcl: Add support for backend-dependent blending of bitmaps (mask and alpha)
Change-Id: Iba64eb42965c86ca5655b9a105ef3f397e033ecf
2014-11-22 20:14:16 +01:00
Matúš Kukan
72f1d57b86 Add dummy Crop to SalBitmap implementations
Change-Id: Ib402395f5523a980c9ca098dcd2d8e1ecbbfa7c0
2014-11-19 07:52:55 +01:00
Louis-Francis Ratté-Boulianne
aa9dfcee50 vcl: Implement copyBits in the OpenGL backend
Change-Id: I101afd11394d3d024d38519afd61d700114702ac
2014-11-15 12:17:42 +01:00
Louis-Francis Ratté-Boulianne
f433825259 vcl: Use single-buffer rendering and only flush when necessary
Change-Id: I832dd6f3647fbb423975fa928a5ec32447225e85
2014-11-13 07:54:14 +01:00
Louis-Francis Ratté-Boulianne
73b1ef159b vcl: Add method to swap buffers after painting window
Change-Id: Icdf691e7e9e83d039e33d2095270290dc31f2efa
2014-11-10 07:59:02 +01:00
Louis-Francis Ratté-Boulianne
d8d9948b61 vcl: Allow SalBitmap implementation to do scaling
Change-Id: If4431fb276c9c2629acbc95aeff2ef7c4a683d86
2014-11-10 07:58:57 +01:00
Chris Sherlock
ad6d94009c vcl: Allow SalGraphics to draw gradients natively
The aim of this patch is to allow for native gradient rendering in
SalGraphics (i.e. let OpenGL do this natively). It is a two step
process:

1. I need to allow gradient draw into SalGraphics, however the current
completely intertwined with the metafile code in OutputDevice. I am
seperating the gradient metafile code from the gradient drawing code.

2. After splitting the metafile stuff from the actual gradient drawing,
I am now able to call on SalGraphics::DrawGradient(). This just
calls on SalGraphics::drawGradient() which returns false if there is
no way of drawing native gradients, and true if there is. If false,
then we use OutputDevice's DrawGradient() functionality.

Change-Id: Ibaaabe13b76a8e7a037d9f751b5f662653a50566
Reviewed-on: https://gerrit.libreoffice.org/12119
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-11-03 22:54:14 +00:00