Commit Graph

251 Commits

Author SHA1 Message Date
Tor Lillqvist
dc3d621411 Assertions should tell the line number where the problem is
Let's not hide the assert() in a function whose sole purpose is to
call assert().

Change-Id: I7a8a04aad560b0f22398daabf12d00bbe58e89f1
2015-06-18 11:43:19 +03:00
Noel Grandin
42f771d6e9 convert B2DLineJoin to scoped enum
Change-Id: I4fb8f2c9e2080e3aa542d2ccf838e6784baa8429
2015-06-04 08:30:24 +02:00
Caolán McNamara
7e5d98c427 masses of coverity FORWARD_NULL warnings from copied assert
Change-Id: I8f698bbcf4d53a4477cc0ee0c3f2c7f08e521f8a
2015-06-01 17:41:20 +01:00
Jan Holesovsky
918886e43d rendercontext: Position the double-buffered subwidgets correctly.
Change-Id: I707ff09ac2b7b610f0f13440a215abf083f9815d
2015-05-22 15:08:43 +02:00
Noel Grandin
23b439a664 convert DEFAULTCONSTANT constant to scoped enum
Change-Id: I5ebd77edfa29d6c6c7acea37e826ef1d625916c3
2015-05-20 09:52:09 +02:00
Noel Grandin
49e13aa418 convert FONT_SUBSTITUTE constants to scoped enum
Change-Id: I8312f0117f33349218a09ccdfea946c66ceb1b3e
2015-05-20 09:52:09 +02:00
Noel Grandin
456c379ffd convert ANTIALIASING constants to scoped enum
Change-Id: I175b8ea4e8bc01c3cdd3dd90506eba01b35e0085
2015-05-20 09:52:09 +02:00
Noel Grandin
3cbdf64ad5 convert DRAWMODE constants to scoped enum
Change-Id: I36cbe8057d09226f8b302963bdd94dc5600b686f
2015-05-20 09:52:08 +02:00
Noel Grandin
662700703b convert GRID constants to scoped enum
Change-Id: I73ae63bc5f41f38d1a4e396152808b22e88681d8
2015-05-20 09:52:08 +02:00
Noel Grandin
dcefc97c8b convert IMAGE_DRAW_ constants to scoped enum
Change-Id: I75619eeb902af4953a5ac1525605cf3f0f15e2c0
2015-05-20 09:52:08 +02:00
Noel Grandin
953f327818 convert COPYAREA constant to bool flag
since there is only value in this flags thing

Change-Id: I86d7a3a358c467a9748b00e1ba8c09106f282947
2015-05-20 09:52:08 +02:00
Noel Grandin
25a47c5cd5 convert TEXT_DRAW constants to scoped enum
Change-Id: Ic0f7f8fa236bb478b3598ae3fd3c1b30ebbf1a01
2015-05-20 09:52:08 +02:00
Noel Grandin
7a0af37989 convert SAL_LAYOUT flags to scoped enum
Change-Id: I0aeea1f32136e43e90a1afb0ea84dbaff2b77587
2015-05-20 09:52:08 +02:00
Tomaž Vajngerl
b4bbb5e5d7 refactor how font, fg. and bg. are applied in widgets/controls
- Move vcl::RenderContext to outdev.
- Change some methods on vcl::Window to accept RenderContext
  as parameter.
- Add ApplySettings to vcl::Window - This method is called before
  painting. Refactor existing classes that use InitSettings to
  have ApplySettings or mark the classes to be refactored later.
- Add RenderSettings for adding defered settings to rendering.
  This is similar to ApplySettings but for more ad-hoc calls.

Change-Id: I4ea58461f3b6b08ccfa3e0ddd1a4a3e04f8c4f45
2015-05-18 11:22:49 +09:00
Noel Grandin
ad0c5e6c66 convert META_*_ACTION constants to scoped enum
Change-Id: I8ecfbfecd765a35fafcbcc5452b0d04a89be2459
2015-05-15 10:05:03 +02:00
Michael Meeks
9a744dea1d vclptr: assert that we have a >0 ref-count in acquire as well.
Change-Id: Ia2286661a8f62e8a46c44c390ab1a8a5dffe81d0
2015-05-08 22:50:41 +01:00
Noel Grandin
662fc8eaa9 convert BMP_MIRROR constants to scoped enum
and fix bug in svx/source/xoutdev/_xoutbmp.cxx,XOutBitmap::MirrorGraphic
where it was not correctly translating between different flags types.

Change-Id: I78b4965544da2aa54b67ec18307fa54c8ffc3aee
2015-05-06 09:01:31 +02:00
Noel Grandin
bfcb2a1a75 convert DEFAULTFONT_ constants to scoped enum
Change-Id: Ia33e957f6cf530e2639b3c86d9482f642652cb46
2015-05-06 09:01:29 +02:00
Tor Lillqvist
d883c12556 Get rid of the initial :: for the vcl namespace
We used it all over the place without leading :: already anyway, even
in many files in include. So let's be consistent. In the majority of
cases, prefer the easier-on-the-eyes choice, not the "safe" one.

In those files in include where *all* existing uses of ::vcl:: indeed
used the :: prefix, there let's keep it for consistency.

Change-Id: If99cb41d3bf290d38c601d91125c3c8d935e61d0
2015-04-30 07:27:52 +03:00
Noel Grandin
ed48a8af3f loplugin:redundantcast
Change-Id: I62aa8ca0f07dce9a820527ac1aef9c44cd70223a
2015-04-10 15:05:52 +02:00
Michael Meeks
9d35e6df66 Nothing really that wrong with acquiring a disposed reference, for now.
Emitting events acquires and passes references conservatively, and the
VCLEVENT_OBJECT_DYING event hit this hard.

Change-Id: If86991ead63b05425a237bf213583c020ba4e582
2015-04-10 13:07:17 +01:00
Noel Grandin
a6e5ac3be1 vclwidget: add some safety net asserts
Change-Id: I5fa19ec6161ab97eb7df8b52a268917f41ae2205
2015-04-10 13:07:04 +01:00
Michael Meeks
0e491a7a2a vclptr: add isDisposed method - and assert for it here & there.
Change-Id: I2b154e0ed9eee0a45900ada7f805a1d444a31bc0
2015-04-10 13:06:20 +01:00
Noel Grandin
820576af4f start wrapping OutputDevice in VclPtr
Change-Id: If3ecbb0599b50d50ce6b3997ca7892200c332ffe
2015-04-10 12:10:43 +01:00
Michael Meeks
bc139dde60 vclptr: move down impl. to OutputDevice
Ultimately we will want to ref-count & VclPtr OutputDevice instances
separately from Window - but for now merge. This helps fix the amazing
lifecycle foo in toolkit/

Change-Id: If40ee9f645c87aff08815926205e908205bdd67a
2015-04-10 11:03:10 +01:00
Noel Grandin
3e672693e3 loplugin:staticfunction
Change-Id: I909cf7e77f9d7194575636248196fda311fffdb6
2015-04-01 10:37:02 +02:00
Michael Stahl
b9782a2b59 tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo
When a SwTxtFormatInfo is created to format a paragraph, pre-compute the
result of vcl::ScriptRun::next() and cache it for future calls to
OutputDevice::GetTextBreak() and GetTextWidth().

This requires adapting a bunch of methods to pass the additional
parameter, and some classes to backup and restore the cache when they
replace the text of the SwTxtFormatInfo.

There is some code in vcl OutputDevice::ImplPrepareLayoutArgs()
to modify the passed string and replace digits depending on
"meTextLanguage" member; try to set it to the correct value when
creating the layout cache (unfortunately it's not possible if the user
sets the CTL Numerals config to the non-default "Context" value).

Another issue is the check in OutputDevice::ImplLayout() if there is
a mpConversion member on the font; apparently this is used to translate
between different Symbol fonts, so not very important; just ignore the
cache in this case.

This reduces vcl::ScriptRun::next() from 11 to 0.36 billion callgrind
cycles when built with GCC 4.9.2 -m32 -Os (which is still 16% of the
formatting).

Change-Id: I61fb8530333f2e7a9199f767c00cf2181ba49951
Reviewed-on: https://gerrit.libreoffice.org/14732
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-31 20:08:35 +02:00
Norbert Thiebaud
3c6fd5a59b Revert "tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo"
This reverts commit 1efe5fe380.
which broke windows.
2015-03-28 20:38:22 -05:00
Michael Stahl
1efe5fe380 tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo
When a SwTxtFormatInfo is created to format a paragraph, pre-compute the
result of vcl::ScriptRun::next() and cache it for future calls to
OutputDevice::GetTextBreak() and GetTextWidth().

This requires adapting a bunch of methods to pass the additional
parameter, and some classes to backup and restore the cache when they
replace the text of the SwTxtFormatInfo.

There is some code in vcl OutputDevice::ImplPrepareLayoutArgs()
to modify the passed string and replace digits depending on
"meTextLanguage" member; try to set it to the correct value when
creating the layout cache (unfortunately it's not possible if the user
sets the CTL Numerals config to the non-default "Context" value).

Another issue is the check in OutputDevice::ImplLayout() if there is
a mpConversion member on the font; apparently this is used to translate
between different Symbol fonts, so not very important; just ignore the
cache in this case.

This reduces vcl::ScriptRun::next() from 11 to 0.36 billion callgrind
cycles when built with GCC 4.9.2 -m32 -Os (which is still 16% of the
formatting).

Change-Id: I61fb8530333f2e7a9199f767c00cf2181ba49951
Reviewed-on: https://gerrit.libreoffice.org/14732
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-28 15:34:34 +00: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
Miklos Vajna
35cf00e20a OutputDevice::LogicInvalidate: take a Rectangle
At the end this gets exported in the LOK API as a rectangle anyway, so
better to convert the vcl::Regions into a Rectangle, and not the other
way around.

Change-Id: I81fede6e30af112d17bb74328801915d90474863
2015-03-23 09:19:07 +01: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
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
Miklos Vajna
b3fd1d5e56 Use SdrModel::isTiledRendering()
It turns out that in case the is-tiled-rendering flag is part of the sdr
model, then that's enough for all the places where so far used a flag on
the output device for this purpose, so change the two users of that
method to use SdrModel::isTiledRendering(), and clean up the now unused
one.

Change-Id: Ife6d3d7e093c04b707497d9588942b38bcd8742d
2015-02-23 10:10:28 +01:00
Miklos Vajna
2af65ff30e Add OutputDevice::isTiledRendering()
This is similar to SwViewShell::isTiledRendering, but while SwViewShell
describes a state of the application, this one describes a state of the
output device. The output device may be created by LOK client code,
while the view shell may not be accessible from lower layers of the
stack, so we need both.

Change-Id: I82f7755eb73603bd79283272fba4970dccae8784
2015-02-23 10:10:27 +01:00
Caolán McNamara
a1ceacc17e boost::foo_ptr->std::foo_ptr
Change-Id: I9219619b538b6530a89f5932ac51eb3b62eb396a
2015-02-16 12:54:44 +00:00
Noel Grandin
f61dbc3029 followup code removal after changing virtual methods to non-virtual
This cleanups up indentation and removes dead classes.

This is a followup patch to commit
272b1dd55797aacf511fb4342b0054e3697243f6
"new loplugin: change virtual methods to non-virtual"

Change-Id: I1c2139589cf8cb23bb9808defe22c51039d38de1
2015-01-26 08:42:29 +02: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
Caolán McNamara
20142afafc font cache gets broken on adding an embedded font
Change-Id: I665cde5d4c89443238efb283c86277dedf621197
2015-01-20 13:32:32 +00:00
Tomaž Vajngerl
009c1752b1 Extract slow path of DrawDeviceAlphaBitmap into its own method
Additioanlly cleanup and use ScopedReadAccess

Change-Id: Ia3365f4dc968368bdd90d4398188bffe2d56e89b
2015-01-19 00:07:24 +09:00
Miklos Vajna
0137974abd vcl: add OutputDevice::LogicInvalidate()
This way subclasses may know when and what is invalidated.

Change-Id: Ie4aa843fcf45b2643b24ca49534627fbf43afd94
2015-01-06 20:55:24 +01:00
Caolán McNamara
e2883ca86f Resolves: fdo#82219 color graphics as black and white
i.e. revert

commit bb5c7d6a79
Date:   Sun Apr 13 01:42:27 2014 +1000

    fdo#38844 Reduce XOR clipping for gradients

    Removed XOR clipping version of ClipAndDrawGradientMetafile. Because it
    has been removed, the other version isn't really needed in it's own
    function so I've moved it back into DrawGradient.

    Change-Id: Ib1519a019061c8c71183db63e5c11681bcad4cc4

Change-Id: Iff1cb48cb8fa6d29937cf228a57aea9e8072110c
2015-01-06 16:59:41 +00:00
Kohei Yoshida
96422e999f Remove ptr_deque.hpp header include from vcl/outdev.hxx.
This header is also a very high impact header.

Change-Id: Iab63f2ec2edebc14b47820c6377a7f83131cfd06
2014-11-25 21:14:46 -05: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
Chris Sherlock
11f041408a vcl: remove commented out friend class from outdev.hxx
Change-Id: I6064a9017effe49fc7727868398ad73140379708
2014-11-22 22:43:17 +11:00