Commit graph

29 commits

Author SHA1 Message Date
Noel Grandin
cd8dd48bf8 tdf#119282 Area tab, Pattern color change
regression from

    commit ccd316d1cb
	use VirtualDevice in createHistorical8x8FromArray

Move the code inside vcl so we don't need to expose BitmapWriteAccess.

I tried to detect this thing by counting the number of independent
colors in the bitmap, but that didn't work. It is used from more than
one place, and appears to be very determined that it needs a 2-color
palette to work properly.

Change-Id: Id11dd9ea78e5e522a6083d6a799e801cac81fd5b
Reviewed-on: https://gerrit.libreoffice.org/59331
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins
2018-08-21 21:06:24 +02:00
Noel Grandin
b9f9f8253f loplugin:constparams
Change-Id: I3d1b88dbd0ff73fddc08d52f50e0efb42daab89b
Reviewed-on: https://gerrit.libreoffice.org/52756
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-17 08:13:06 +02:00
Caolán McNamara
40bc6c1380 ofz#7365 Integer overflow
Change-Id: If56db771976a82399dc49fd90845e6569cbd2e8e
Reviewed-on: https://gerrit.libreoffice.org/52400
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-04-05 00:24:53 +02:00
Noel Grandin
290a954a35 tdf#116646 Slideshows with transitions page swap rendering issues
regression from
    commit 5b75a16972
    move cairo extract bitmap code from canvas to vcl

Change-Id: Ic8d7cd9d54010ae272073877da18a985e931e22a
Reviewed-on: https://gerrit.libreoffice.org/52005
Tested-by: Jenkins <ci@libreoffice.org>
Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28 22:16:29 +02:00
Noel Grandin
09cf2f4242 move bitmap copy code from CanvasBitmapHelper to vcl
part of making GetAlpha/GetMask an internal detail of vcl

Change-Id: Ie1740df3d6435d9f0f2de3297e7f224d2c6b3cc5
Reviewed-on: https://gerrit.libreoffice.org/51436
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-19 07:36:28 +01:00
Noel Grandin
5b75a16972 move cairo extract bitmap code from canvas to vcl
part of making GetMask/GetAlpha an internal detail of vcl

Change-Id: I45c2e9fdae08d7f444a64e8e04a6f65bb525cbd1
Reviewed-on: https://gerrit.libreoffice.org/51417
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-16 19:25:48 +01:00
Noel Grandin
e568d233a3 move framework/toolkit use of BitmapEx::GetMask inside vcl
Change-Id: I2a942377d6e9b8b09673e5ad2804e0e7fb2bb943
Reviewed-on: https://gerrit.libreoffice.org/51387
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-16 11:45:19 +01:00
Noel Grandin
16b7ec7b2e move emf code to vcl
part of making ScopedWriteAccess an internal detail of vcl

Change-Id: If66de7c248d442a860508bbddf68e390983da240
Reviewed-on: https://gerrit.libreoffice.org/51309
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-03-15 11:08:58 +01:00
Noel Grandin
14d49662d3 move some GDI import code from svx to vcl
part of making ScopedWriteAccess an internal detail of vcl

Change-Id: I916f2ca05c9d7c17b62c91e113df6d8454bb4351
Reviewed-on: https://gerrit.libreoffice.org/51283
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
2018-03-15 07:30:47 +01:00
Noel Grandin
1b61d0417b loplugin:unusedmethods
Change-Id: I7c780be3e2740fd9b03c39ebe16935d61caf4f7e
Reviewed-on: https://gerrit.libreoffice.org/51257
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-14 13:21:49 +01:00
Noel Grandin
a93d940186 make transformBitmap code from canvas to vcl
part of making ScopedWriteAccess an internal detail of vcl

Change-Id: Ida03bc73fe746cde97f6fcb5cde2f066b63d92e9
Reviewed-on: https://gerrit.libreoffice.org/51216
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
2018-03-13 15:32:42 +01:00
Noel Grandin
676024b001 move canvas helper code into vcl
part of making BitmapWriteAccess an internal feature of vcl

Change-Id: Iee94f47e120d82a23e57342952d04e9b2792cd1a
Reviewed-on: https://gerrit.libreoffice.org/50999
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
2018-03-10 12:04:19 +01:00
Noel Grandin
3d40032191 tdf#116001 Incorrect Colors in Chart Wall Area
regression from

    commit b10c7022f1
    "use RawBitmap in BPixelRasterToBitmapEx"

we need to implement alpha support in vcl::bitmap::CreateFromData

Change-Id: I68bebbe1dd15e3bb04de312309c1631d6bb7fe2d
Reviewed-on: https://gerrit.libreoffice.org/50556
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-01 12:40:03 +01:00
Noel Grandin
380da094b0 ofz#6372 fix bitmap decoding of pattern in LwpBackgroundStuff
after
    commit b90e098a35
    use BitmapEx in LwpBackgroundStuff

<caolan> maybe the lotuswordpro original stride is really 4 after all
(as a common stride), with the first byte on each line containing the
8bits for each row

The original code in GetPattern() looked pretty dodgy since it was
copying 32-bytes into an 8 byte buffer.
Assume that the reversing part is right, and that the format is really a
1bit packed 8x8 image.

Also fix the decoding of such a image in CreateFromData to assume packed
format, which is more predictable.

Also fix the bug in createDefaultCross_3x3 which changing the assert
revealed.

Change-Id: I7196ae601429bbe0f842399df61c8b858e022d3e
Reviewed-on: https://gerrit.libreoffice.org/49808
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-15 18:34:09 +01:00
Noel Grandin
32d8a32dcf move cairo surface code from canvas to BitmapTools
part of making Bitmap an implementation detail of vcl/

Change-Id: Ic4b8d114a8091041374a083b3b7ca2fa68757ab1
Reviewed-on: https://gerrit.libreoffice.org/49719
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-15 11:14:12 +01:00
Noel Grandin
2168d70980 use RawBitmap in PSDReader
part of making Bitmap an internal detail of vcl

Change-Id: Icdb7a7474b19e304950fcf75ef2b85006b7755e9
Reviewed-on: https://gerrit.libreoffice.org/49664
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-14 07:28:33 +01:00
Noel Grandin
83330a608d use Color, not BitmapColor in RawBitmap
because we don't want palette images

Change-Id: If087e51503714bf8474ae320381f80196092ceb0
Reviewed-on: https://gerrit.libreoffice.org/49662
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-14 07:28:01 +01:00
Noel Grandin
3bc228a1dd use RawBitmap and BitmapEx in DffPropertyReader
part of making Bitmap an internal feature of vcl

Change-Id: I2945005b9070bc13844c02f8ecaa349920d151fe
Reviewed-on: https://gerrit.libreoffice.org/49579
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-13 07:37:13 +01:00
Noel Grandin
457204cfce fix pixel address calculation in RawBitmap
Change-Id: I42476a8049330ff02c555ecba49b49f3cf012086
Reviewed-on: https://gerrit.libreoffice.org/49599
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-12 18:29:47 +01:00
Noel Grandin
ac98ff5e86 use RawBitmap and BitmapEx in icgm filter
Change-Id: Icaffda666c27f733c0d490905e91a68b72073bcb
Reviewed-on: https://gerrit.libreoffice.org/49502
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-10 17:57:09 +01:00
Noel Grandin
e1d1bce72b move Bitmap::SetToData to BitmapTools
Change-Id: I0fc62d29d2044c2aa8af3742d4aeb9d782793713
Reviewed-on: https://gerrit.libreoffice.org/49280
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-07 10:58:21 +01:00
Noel Grandin
6a3413a233 loplugin:countusersofdefaultparams in include/oox..vcl
Change-Id: If831bce4cd1fe2c5233159b31c239b813629e0de
Reviewed-on: https://gerrit.libreoffice.org/45420
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-29 10:01:45 +01:00
Caolán McNamara
5b214d0ee3 loadFromResource is now unused
Change-Id: Ibea3defdf8d2642c4ba523db7f4fc8fbc2473488
2017-04-27 13:29:57 +01:00
Tomaž Vajngerl
bf5f6df9e4 vcl: separate ImplImageTree - ImageTree singleton and public iface
ImplImageTree was used outside of VCL which is not consistent with
the name and the header also contains a lot of implementation
detail. This separates the implementation to ImplImageTree and
the public interface and singleton to ImageTree only.

Change-Id: I3a26444f0f6971a6b1d83472e9cef19c93192d3e
Reviewed-on: https://gerrit.libreoffice.org/32134
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-12-19 07:26:24 +00:00
Tomaž Vajngerl
681c2c3f59 split markers for galaxy theme, when scaling use splitted markers
For markers (resize markers, anchors,...) we contain them all in
one image atlas. This was generally done because of resource
limitiations in Windows 95/98 which aren't a problem anymore in
present systems.

This is however problematic in HiDPI as we scale the image and
the coordinates of aren't correct anymore. Another problem is
that it uses its own cache instead of common cache in
ImplImageTree. So this commit extracts all the markers into its
own images for galaxy theme and uses them when we scale.

In the future when we extracted all the markers to its own
images for all icon themes we can remvoe the old code with the
image atlas.

Change-Id: Ibee181b529d30e20050df8cd396d338bd53532c0
2016-12-09 23:47:59 +01:00
Tomaž Vajngerl
4a4fd38c87 vcl: add bitmap::loadFromResource with additional flags
Sometimes we want to surpress automatic scaling and converting
for dark theme. This adds a loadFromResource function with
additional flags which makes this possible.

Change-Id: I893cee82ad6942644755f0c5b772fb5f073bbf00
Reviewed-on: https://gerrit.libreoffice.org/30341
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-29 18:15:04 +00:00
Tomaž Vajngerl
5bb5463efe tdf#51733 support SVG icon theme, disk cache and scaling / darken
Also resolves tdf#92248

This extends icon name resolving so that is in addition tries to
find an icon with the "svg" extension and load that instead of
stated (mostly "png") extension. If the filename extension is
"svg" we load the icon with the SVG filter instead.

This also adds icon scaling and conversion for HiDPI or when a
dark theme is wanted. If the SVG icon is available, we render it
at a higher resolution instead of scaling

As loading of SVG icons can be computatunally expensive, a icon
disk cache was added. This saves the rendered SVG as a PNG image
into the "cache" folder. The same caching is also used for HiDPI
and dark theme converted icons so we don't always scale or
convert the icons.

In addition some style changes and DRY fixes were made to the
ImplImageTree source code.

Change-Id: I9e421395a342ffe8da9facea7ea06e5db2778b26
Reviewed-on: https://gerrit.libreoffice.org/30339
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-10-29 18:14:01 +00:00
Noel Grandin
f23c0dbe00 loplugin:unuseddefaultparms in include/vcl (part2)
including a fix for a rather glaring bug in BitmapTools.cxx

Change-Id: Id9db990b993cfeea9039c5fbaaa91996adeae22a
Reviewed-on: https://gerrit.libreoffice.org/22713
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-26 10:53:28 +00:00
Tomaž Vajngerl
dca73ef8cf support to load SVG images when loading from Image resource
Change-Id: Ieda1c334d8d995c774381c52fa1d9aa11751c5ef
2015-11-08 23:03:49 +01:00