summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
AgeCommit message (Collapse)Author
2021-07-02tdf#143149 fix crash if app exits while print progress is runningCaolán McNamara
dismiss the dialog if its parent goes away, but leave the print job running Change-Id: Ic29ee0300a7d9476ad27a2594a555312e30c74f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118253 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-24tdf#142560 handle cached glpyh items in ImplGlyphFallbackLayoutMark Hung
Fallback layout beyond level1 isn't generated because pre-caculated glyph items does not contain glyph items that needs to fallback, i.e. when calling ImplLayoutArgs::PrepareFallback. Hence it produce no maFallbackRuns and maRuns. The patch changes ImplLayoutArgs::PrepareFallback so that it use pre-caculated glyph items in the next level to create maRuns to ensure the same fallback layouts are genrated as layouts generated without pre-caculated glyph items. Change-Id: I672f3be6c4915892792b3cb968ad4a325465ccc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117105 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com> (cherry picked from commit 10ea27faec115d4cffd6f66cee8f688399e1e0b2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117570 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-06-23disable ligatures for monospace fontsCaolán McNamara
we don't want e.g. a ffi ligature for Courier/Nimbus Mono PS Change-Id: I292c6e2ea217b511b4affcd8dab4a4bda85ab5da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117644 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-11MetaAction::Clone() -> constLuboš Luňák
Change-Id: Ie5785127a1fb202b146710dfedf3838d2a607670 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117035 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-06-11Simplify Sequences initializations (vcl)Julien Nabet
Change-Id: Id93bde17dbc4c71ad93bc094b94408fc9e39ec98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117055 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-06-09Add GradientEx cppunit test to vclpanoskorovesis
The test creates two GradientEx and checks their attributes. In mtfxmldump.cxx the case regarding GradientEx was completed Change-Id: I52f2303fa3123b97fb8a4b0783610c0bae300fc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116819 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-06-04sw HTML export: allow custom DPI for the bitmaps of shapesMiklos Vajna
But leave the CSS pixel size of them unchanged in the HTML markup. Also add some documentation on the various options, so one doesn't have to dig them out from testcases. Change-Id: I6c6ee4e9c98d674f44e7c5835f2e6a6737e13f34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116722 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-06-04sw HTML export: fix pixel size of shapesMiklos Vajna
- the twips logic size was set, but it was consumed as mm100 logic size, so the pixel size was about half of the correct one - the HTML export didn't write a logic size ("CSS pixels size") for shapes Change-Id: I37f6b4acde9d1298fae81f9975e9db95485631ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116691 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-05-28Select svl crypto backend in configure.acJan-Marek Glogowski
And define USE_CRYPTO_* macros to select it in code. This way we can get rid of all the HAVE_FEATURE_NSS and _WIN32 variations. This also reverts 1f6b98f21495f0ecc5ded493cb3273da03852191. Change-Id: I101e4ae2f49cdb127d59bd49a4f1c86304ca2238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116338 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-05-28vcl: handle fallback glyph offset for vertical writing.Mark Hung
When GenericSalLayout::MoveGlyph() is called from MultiSalLayout::AdjustLayout(), new position is calculatd by adding glyph advances ( i.e. glyph items' m_nNewWidth ). To move the glyph, the moving offset should be calculated based on the corresponding position, i.e. m_nXOffset v.s. m_LinearPos.X(). Change-Id: I912d499f49f69f68d8388bc8677e6b47bfb6f066 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115926 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-27no need to allocate these on the heapNoel Grandin
Change-Id: I0740f7194c589d6949a816f365cd54403be72118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116260 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-20move some headers inside modulesNoel Grandin
Change-Id: I2baa9e9334850cf72e8ea1e96a2177a1c052e589 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115868 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-19ImplPlayWithRenderer never checks its OutputDevice against nullptrCaolán McNamara
just pass a reference instead and spread that around to some similar cases Change-Id: Ifb2dee8c7bf02a9f01982b928c90666cbbdd84fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115759 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-18cid#1484905 Dereference before null checkCaolán McNamara
Change-Id: Ia69cb70cda1ba5bc56bec7d480db1f89b7b9200d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115734 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-17vcl PDF export: fix re-exporting PDF images with arbitrary page-level rotationMiklos Vajna
Building on top of commit bd520b177637d4b7d9d93733103cff17a3c91b0a (vcl PDF export: fix re-exporting PDF images with page-level rotation, 2019-11-06), this was already working for 90 degrees, now generalize this to work with 180 degrees as well. Change-Id: I5a5d51662399814d5554d7c2cb86a6c9a2974012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115705 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-05-17split OutputDevice from WindowNoel Grandin
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-13inline some typedefsNoel Grandin
Change-Id: I1608e03ff9f6fbc55987010e88897e034b690b3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-11loplugin:noexceptmoveNoel Grandin
after commit adfd91d24678053b9a1475ad6985eb1fc548706a Date: Mon May 10 20:17:11 2021 +0200 fix leak in SalLayoutGlyphs Change-Id: I495106d9930ce6f2dad8e62fd89bc2970f747088 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-11change usage of boost::hash_combine to o3tl::hash_combineTomaž Vajngerl
Change-Id: I840518a36ac43d36c95f38e09c7bfcfe1a25a525 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114984 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-11gtk4: menu item text seems to be parsed as xml now, so escape the basicsCaolán McNamara
"Zoom & Pan" in impress causing trouble Change-Id: If738eebaa3d9fd9abdd09a4fba4abce600c28743 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115363 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-11fix leak in SalLayoutGlyphsNoel Grandin
we forgot to delete the extra impls vector Also make more use of std::unique_ptr Change-Id: I2c745c0ad2b7ad62d368e9702bd2c32c734442fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115375 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-06cid#1401334 silence Uncaught exceptionCaolán McNamara
Change-Id: I7d0d9324afdfd5e06e2def62919dbefb78abdb3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115173 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-05loplugin:constmethodNoel Grandin
Change-Id: I7913fd8144d521b8293ac43036d0fad82e457cd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115145 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-05vcl: adjust LayoutText() for vertical writing.Mark Hung
Revert 58af692e2814 "tdf#111967 translate offsets so it is relative to vorigin", which use hb_font_add_glyph_origin_for_direction to change the origin for vertical writing. This caused major problem in Y-axis. For X-axis, align the baseline of the vertical run to the center of the rotated horizontal run, by adding "(ascender + descener) / 2. Besides the alignment mentioned above, underlying text rendering code should be able to render properly based on the positions that Harfbuzz API creates. Change-Id: Ic1ef1f734686d0e61c4b2a6bf7feb7c870bba84f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115014 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-03loplugin:stringadd improvement for appending numbersNoel Grandin
I was wrong, the Concat framework already optimised appending numbers by stack-allocating small buffers, so include them in the plugin Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-03vcl: remove MetricVectorChris Sherlock
Change-Id: Ib700887ca79f423c65dfb75eea36bbfd808fa172 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114976 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-05-01Related: cid#1478001 CreateVirtualDevice never passed a null pGraphics argCaolán McNamara
Change-Id: I0701b15a28ab3583586c0c8018c511e100b41a93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114948 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-30simplify WallpaperNoel Grandin
All of it's member fields are already COW types, so it doesn't need the complication Change-Id: I44e402e8e80fe96462fc4e1aa06b9ec6815e3cd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114933 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-29do not apply line dashing in drawinglayer (tdf#136957)Luboš Luňák
basegfx::utils::applyLineDashing() is not as good as the actual VCL backend dashing, and there are some rounding errors because of all the canvas transformation matrices or whatever, which leads to the drawing problem. So use LineInfo to carry the dashing information. As a part of this change, also make LineInfo use doubles instead of ints. The use of transformation matrices means that the values may be fractional and less than one. Change-Id: Ia5ac7d266cab344b7137052c81fbd96c1ce28003 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114710 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-04-29remove support for BITMASK in vcl backendsNoel Grandin
Rather use a proper alpha channel if we need transparency. This is another small step towards merged alpha in our vcl layer. I suspect the intent in a lot of this code was to save memory. Which have been a thing way back then, but these days our backends mostly end up doing a copy-and-convert to a real alpha channel anyway, so the existing code is actually now a pessimisation. Change-Id: I4a2bcbb2f76b841f05bc00580f364492829c69de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114808 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-28use string_view in INetURLObject::encodeNoel Grandin
Change-Id: Ib686c6872388b02c8939d3b65f6bd25cda348bc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27loplugin:stringadd convert chained append to +Noel Grandin
which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27use more string_view in tools/streamNoel Grandin
Change-Id: I2a957cd72d71fea717734488cdb3670e0bcdd6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-26drop mask from BitmapExNoel Grandin
So that we have fewer cases to deal with when we transition to 32-bit bitmaps. (*) rename maMask to maAlphaMask, since now it is only being used for alpha duties. (*) drop mbAlpha and mbTransparent to simplify state management, the only thing we need to check for alpha is if maAlphaMask is non-empty. Change-Id: I06252e38e950e846a94b4c2ba8ea763be17801fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-24Replace list by vector (m_aTransparentObjects in vcl/pdfwriter_impl)Julien Nabet
Change-Id: Ie6679df3426f50b2496b2478ae2ee852f1afff46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114578 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-04-22no need to create temporaries when appending number to O[U]StringBufferNoel Grandin
Change-Id: I36d82423b5f75010552696a66cec7e53ee265ce4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114395 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-15tdf#141269 Incorrect transparency after roundtripCaolán McNamara
Revert "convert internal bitmap formats transparency->alpha" This reverts commit c181e510c5f5e74f1f6824b64637849aace9ae63. and later fix up of Revert "tdf#141504 qt5: ugly images" This reverts commit e7424ff25a724ea5bb54b2282d5c3cbf74c92053. a lot of places are still working int transparency values and not opacity Change-Id: I31342cdb76629acbaebfcdfa385407d3291fe06f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114150 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-12tdf#134736 move nLastBgAction to also include any trailing popsCaolán McNamara
RemoveTransparenciesFromMetaFile is a very fragile thing Change-Id: I8feeb436426d16087ab5fbaddf6b39ac32574e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113981 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-12improve scopingCaolán McNamara
Change-Id: I3f081312cbfccce4982b8df7538d7d64150a0d11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113977 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-03ofz#32843 Invalid-bool-valueCaolán McNamara
Change-Id: I709890b7ad441f11c23389bc6c03f0cc975677ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113553 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-04-02vcl: move Fraction reading/writing to GenericTypeSerializerTomaž Vajngerl
Change-Id: Iccacaa7fd9cffe1d99f76def854c2150bb4d94f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113499 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-02vcl: move MapMode reading and writing to TypeSerializerTomaž Vajngerl
remove usage of ReadMapMode and WriteMapMode and add tests Change-Id: I40e1da8aea5c2171d9dbb6343fbf61912e5b3367 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113498 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-02vcl: remove GetBitCount and GetColorCount from Bitmap{Ex}Tomaž Vajngerl
We can cast the PixelFormat enum to int for the same information and we can use the enum to reduce ambiguity when possible. Change-Id: I6ea648139465568cdeb12e5f5f75c7b609365bf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113188 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-31remove internal 4bit scanline formatsNoel
since we have already removed the 4-bit internal bitmap formats. Change-Id: Ie481aaa8e25642a47e30beb6f37e2d3beda304e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-31drop 4bpp image formatsNoel
on a path to simplifying our internal bitmap stuff, aiming to support a smaller set of image formats, but support them in an accelerated fashion. Change-Id: I5f8bf3cd49abf16ce460771492cdd5f358cb34df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113313 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-28drop operator bool and operator! from Bitmap and BitmapExNoel
IRC chat: <quikee[m]> noelgrandin: doesn't adding operator bool to Bitmap has the same problem as Graphic and the reason why you dropped that commit 7334034ae93b49fc93b5859a3c047a319d138282 "drop Graphic::operator bool" <noelgrandin> quikee[m], hmmm, good point <noelgrandin> maybe I should just drop both operator bool and operator! in favor of IsEmpty <quikee[m]> noelgrandin: I don't remember what the problem is I just remembered we dropped it Graphic :) sure, dropping everything for IsEmpty is probably the best Change-Id: Ieae289cda64f0b8d8fdecd5ea9e6f2bb874ff4cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113163 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-26create operator bool for BitmapNoel
so we can use a more natural syntax than "!!" Change-Id: I8152a0d3ce37115fc83d332a26725ca1d28d959a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113147 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-26vcl: Create 8-bit palette bitmap instead of 4-bit in ImplBmpMonoFncTomaž Vajngerl
Change-Id: I28525e54e4d2b932cfdd6369b72270db81f68214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113136 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-24loplugin:unusedmethodsNoel
Change-Id: Id54e7545b3a69e03c29daf9d372bbf605312f547 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113036 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2021-03-21fix SalLayoutGlyphs caching with MultiSalLayoutLuboš Luňák
Writer's testTdf90069 was failing if there was the documents font actually installed. If glyphs for layout are cached, it is still necessary to do the fallback, and that needs setting the fallback as needed. Change-Id: I32bf453d2e46fd8f1cf53a1298d0bc4195a1b78c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112774 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>