Commit Graph

90 Commits

Author SHA1 Message Date
Stephan Bergmann
c2ff1b9622 loplugin:nullptr (automatic rewrite)
Change-Id: Ic8d478162bcdcadd068a22c6344e947da3cd1eab
2015-11-10 10:31:16 +01:00
Stephan Bergmann
b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02:00
Miklos Vajna
8e27c68847 basebmp: these headers are not used from other modules
Change-Id: I88c5c341b88a6ea62730e5d3dd1962365c531f70
2015-10-01 08:31:46 +02:00
Caolán McNamara
47d3e82e4f boost->std
Change-Id: I9b4f884c6313a53fea543ea6f93175205351ad14
Reviewed-on: https://gerrit.libreoffice.org/18517
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-13 19:38:08 +00:00
Noel Grandin
c760932fae loplugin:unusedmethods basebmp
Change-Id: I9e89fea4e94a91edbbe355780c2a12d6e6cb6e4a
Reviewed-on: https://gerrit.libreoffice.org/16728
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-06 09:06:47 +00:00
Noel Grandin
94d92d00fa convert basegfx::FillRule to scoped enum
and drop unused NONZERO_WINDING_NUMBER value

Change-Id: If2a8f01934796eaf9a343113387b775fd169ccb9
2015-06-04 08:30:24 +02:00
Noel Grandin
d4917e9970 convert basebmp::Format to scoped enum
Change-Id: I6eb213d6dcf387936967271fba9e2de3879ef479
2015-06-04 08:30:24 +02:00
Noel Grandin
ab377324bb convert DrawMode to scoped enum
Change-Id: Ie4a7705cc3d042d08178e562a2c2ffaf0be3810f
2015-06-04 08:30:24 +02:00
Noel Grandin
404943048e remove unused BASEBMP_NO_NESTED_TEMPLATE_PARAMETER
Change-Id: I631b5fa984f5a59619aef62e38a503239989b253
2015-06-01 14:59:38 +02:00
Stephan Bergmann
6ff2d84ade Various #include <sal/log.hxx> fixups
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx>
(and don't make use of it themselves), but many other files happen to depend on
it.  Cleaned up some, but something like

  grep -FwL sal/log.hxx $(git grep -Elw \
    'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF') -- \*.cxx)

shows lots more files that potentially need fixing before the include can be
removed from rtl/string.hxx and rtl/ustring.hxx.

Change-Id: Ibf033363e83d37851776f392dc0b077381cd8b90
2015-04-22 09:57:47 +02:00
Stephan Bergmann
14a4390b87 Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: I88949a300ebff7c0c37ec147ca50f08695db7775
2015-03-31 13:12:10 +02:00
Stephan Bergmann
a52cf476e7 Clean up template-parameter-dependent C-style casts
Change-Id: Ia1ab134a0afbeeb3ae40264bd4233a47df26b734
2015-03-29 15:13:45 +02:00
Noel Grandin
44790193a7 loplugin:staticfunction
Change-Id: I982ba552579019e4902ae59fddf14a6b34ba5954
2015-03-27 10:51:08 +02:00
Caolán McNamara
cbd48230bb drawing a vertical/horizontal line does not really damage 0 width/height areas
so follow the same logic as drawPixel which equally does not damage a 0
width and height point

Change-Id: Ie2c400caf1ad2e3a874f92c6f90f5f071f9c95e3
2015-03-23 16:35:59 +00:00
Caolán McNamara
940914489c rename BGRU to BGRX
Change-Id: I0f28b986542b4d30c0a2cb75e15fb258af98e9cd
2015-02-25 17:06:15 +00:00
Caolán McNamara
daf248bf85 rename BGRX32 etc to BGRA32
Change-Id: I60e1951fe56e4b00ee0caa142eb0e19dcb6d12b7
2015-02-25 17:06:15 +00:00
Caolán McNamara
4b06c351bd give basebmp a cairo compatible 24 bit surface
where each unit is actually 32bit with unused upper 8bit.

Change-Id: I5c406cebe406d2db6fda73d744dfd22a99b80ba3
2015-02-25 14:56:25 +00:00
Caolán McNamara
efe28833d4 make ScanlineStride an argument to createBitmapDevice
so we could create bitmap devices that have the same stride that cairo expects,
provide getBitmapDeviceStrideForWidth to get a default value

Change-Id: I7ecc6f54a734b3f6bed59c699ac3b482c4ad7c47
2015-02-24 18:38:11 +00:00
Stephan Bergmann
931ec049e0 Some more loplugin:cstylecast: basebmp
Change-Id: I7e1e37110b9bd53a5eae543c854cc2c434a6b678
2015-01-20 09:06:45 +01:00
Michael Meeks
578fd01ee9 basebmp: accelerated method to create a clipping device.
This was some staggering proportion of tiled rendering documents
with complex clipping; it seems 'clear' is not what memset is for
1bit clip masks.

Change-Id: I9142ffb7d7016603feb7782d6f03b9992b9494e3
2014-10-14 12:04:13 -03:00
Caolán McNamara
35412949a2 keep nScanlineStride number sane
bff + valgrind

Change-Id: I255a052251a6a0f1e4005b9cfb3b6ce00c6653ee
2014-08-28 09:24:17 +01:00
Chris Sherlock
52f296ac1a Remove gcc3 workaround for bug long since fixed in gcc
Change-Id: Ieb1c41481a79ab8713663caee3d5373640ff0ec8
Reviewed-on: https://gerrit.libreoffice.org/9102
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-04-19 05:39:01 +00:00
Stephan Bergmann
70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01:00
Alexander Wilms
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
Caolán McNamara
c1b7a2feb4 coverity#1078535 Division or modulo by zero
Change-Id: Iab9bb56ce7646955d2592d7e9abdaf829ee1ec78
2014-01-27 14:38:40 +00:00
Norbert Thiebaud
e642609a79 basebmp: include <> for external includes
Change-Id: I6f1f573662d5e759694c401598408df9fbb20be8
2013-11-11 22:37:25 -06:00
tsahi glik
91caa3dbe2 Hanlde TopDown -> BottomUp conversion in basebmp DirectCopy logic
Change-Id: Ic6b94e8f01c0151741626f8b50d69597cc401852
Reviewed-on: https://gerrit.libreoffice.org/6155
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2013-10-08 19:57:25 +00:00
Stephan Bergmann
e139ad433b Off-by-one error
Change-Id: I84749158fb8dee3fec10869e0955177bbd917d59
2013-09-27 17:52:42 +02:00
tsahi glik
3ea2ce9dac Improve performance of copyArea(), especially relevant for mobile devices.
vigra::copyImage89 does not handle copy areas in the same image so the
code checks whether the src and dst are same buffer and directs it to
scaleImage() which is very slow. The whole concept of pixel accessors
is a huge overhead in the case of direct pixel copy (vigra::copyImage
is also using pixel accessors). The idea here is to identify when
direct memory copy is applicable (when the format is an integral
number of bytes per pixel, src.size==dst.size, and
src.format==dst.format) and use direct memory block copy and not
pixel-wise copy. The result is 100x faster than the vigra
implementation. This direct copy is also handling the case when the
src and dst are same buffer by copy it from bottom to top when needed
and using memmove() instead of memcpy().

Change-Id: I8ec589463d6386db82777a916371a5ebbf9e2d50
Reviewed-on: https://gerrit.libreoffice.org/5707
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2013-09-27 14:47:10 +00:00
Jelle van der Waa
8ac71b29ee fdo#62475 removed pointless comments
Change-Id: I85bee68e89c41642b2da72e11b695588b3dfe346
2013-07-18 14:53:46 +01:00
Caolán McNamara
37a3f96383 WaE: assuming signed overflow does not occur when assuming...
that (X + c) < X is always false [-Wstrict-overflow]

Change-Id: I63880bf27ab7e34eb9e0be682b39b80b71d65103
2013-07-18 09:44:57 +01:00
Stephan Bergmann
d8dbf1b5db Turn basebmp::Format into a proper enum
Change-Id: I4067c5039c7b5c74a1c144721dd7260de54dd2bf
2013-07-12 14:41:35 +02:00
Tsahi Glik
31b35ed6bb Detect copyArea trying to operate on overlapping memory.
Equality test also needs to check if disjunct BitmapDevice instances
might not actually share the same memory buffer.

Change-Id: I09a93cb092a0039353be211ed053e991e7fe66f0
2013-06-04 20:38:09 +02:00
Tor Lillqvist
3f9acb7f9c Nah, I don't need a getOffset(), but I do need a getBufferSize()
To properly handle subsetted BitmapDevices in the iOS vcl backend I
seem to need to know what the size of the full BitmapDevice is.

I wasted at least one day on desperate hacking and debugging, trying
to wrap my head around a misunderstanding of what a subsetted
BitmapDevice is. I thought it involved coordinate offsetting...

Change-Id: I83bf1a7d75ce192aaf21f1e408008e362fd6c6e6
2013-04-12 02:24:12 +03:00
Tor Lillqvist
3ddd6cb388 Add an accessor to get the offset of a subsetted BitmapDevice
Change-Id: I8a4a588287a90c6953b367bb02e075ea58f13a96
2013-04-11 19:14:49 +03:00
Tor Lillqvist
2729a77b49 Add debugging printout of subsetting information
Change-Id: I6c37885823f14dcfbe750691dad27e094f46e66e
2013-04-11 19:14:45 +03:00
Tor Lillqvist
89d9b9e252 Log also corresponding destructions of BitmapDevice
Change-Id: Ic74032b430691215482172c3c5f834374d47873d
2013-03-26 19:01:59 +02:00
Tor Lillqvist
6d12b76b2c Add some debugging printout
Change-Id: Iea0decde41be8b9325b19651433f1b3b79f851a9
2013-03-25 09:26:15 +02:00
Arnaud Versini
36a2db3722 Replace usage of rtl_*Memory with equivalent from string.h
Change-Id: I50ffc10f007f03c3252ef0196b59b881429cc159
Reviewed-on: https://gerrit.libreoffice.org/734
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-10-01 18:48:05 +00:00
Michael Meeks
cf342fe928 re-base on ALv2 code. Includes:
reportbuilder, license file not needed.
    Patch contributed by Armin Le Grand
    http://svn.apache.org/viewvc?view=revision&revision=1305814
    Adapting extras/ to our wordbook setup.
2012-07-18 15:00:25 +01:00
Tor Lillqvist
fd3c83d5f2 Add two new 32bpp formats and add helpful comments
For Android (and perhaps iOS) we need a 32bpp format with channels in
RGBA order.

Rename the (basebmp-internal) 32bpp PixelFormatTreats_* typedefs so
that the channel order in their names matches the memory order of the
channels.

Change-Id: Ia8a74f6d44e0a2cffdf66a05ddf8fc7d6ae2a263
2012-06-07 21:54:19 +03:00
Caolán McNamara
9ff94ae0fa png parsing regression test 2012-04-17 16:46:14 +01:00
Stephan Bergmann
38747916d6 Make LineTest::testCornerCases succeed again after last basebmp fix.
Though it looks wrong that rtl_allocateMemory(0) == 0.
2011-12-13 17:08:33 +01:00
Michael Meeks
cefb414b37 handle failed bitmap storage allocation gracefully 2011-12-13 15:54:28 +00:00
Thorsten Behrens
a6a391da8d Put BitmapDevice::getPixelData() back.
Slight tweak of d0d62edf3f - getPixel()
and getPixelData() are complementary functions, similar in spirit
to const and non-const getters. Added unit test for it to avoid
flagging it for removal again.
2011-11-04 10:40:08 +01:00
Joseph Powers
d0d62edf3f Cleanup basebmp a little
I removed 2 unused headers.

I also stopped delivering a lot of headers that no one outside of basebmp
cared about.

I also removed the unused methods:
  basebmp::BitmapDevice::getPaletteEntryCount() const
  basebmp::BitmapDevice::getPixelData(basegfx::B2IPoint const&)
2011-11-03 20:46:00 -07:00
Thorsten Behrens
f7975d2335 Fix one more subtlety around B2IBox / B2IRange changes.
The Cohen/Sutherland clip flag routine was not aware of B2IBox,
thusly yielding incorrect line clipping for BitmapDevice software
rendering. Cleaned that up, added some more unit tests around the
problem, and removed the now-extraneous maLineClip member from the
bitmap device.
2011-11-03 15:02:00 +01:00
Thorsten Behrens
1e297aef53 Move BitmapDevice to use B2IBox instead of B2IRange.
Semantically, B2IBox represents a pixel rect much better than
B2IRange - replaced all occurences in and around the software
renderer, and client code.
2011-11-02 23:58:28 +01:00
Thorsten Behrens
3c1b4b6ef7 Keep basebmp free of naked ptrs.
Moved the implementation detail that SalFrames lifetime is handled
manually in vcl out of basebmp & into vcl. Added lightweight wrapper
class to decouple damagetracker lifetime from GtkFrame lifetime.
2011-11-02 23:58:27 +01:00
Thorsten Behrens
207bcfc5b9 Revert "basebmp: B2IRange::isEmpty is surprisingly, unhelpfully lame - workaround"
This reverts commit 69e4dd1206.
2011-11-02 23:58:27 +01:00