summaryrefslogtreecommitdiff
path: root/vcl/quartz/salbmp.cxx
AgeCommit message (Collapse)Author
2023-01-30Fix iOS build errorsPL
Recent code reorganization and macOS changes caused the iOS build to fail. This change fixes the build errors and updates the iOS code to use the same headless data structures as other headless builds. Change-Id: I9c5329eb6376120d6789447f991c93eb9839d595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146265 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2022-12-29Related: tdf#146842 Eliminate temporary copies of SkiaSalBitmap when printingPatrick Luby
Commit 9eb732a32023e74c44ac8c3b5af9f5424273bb6c fixed crashing when printing SkiaSalBitmaps to a non-Skia SalGraphics. However, the fix almost always makes two copies of the SkiaSalBitmap's bitmap data: the first copy is made in SkiaSalBitmap::AcquireBuffer() and then QuartzSalBitmap makes a copy of the first copy. By making QuartzSalBitmap's methods that return a CGImageRef pure virtual, a non-Skia SalGraphics can now create a CGImageRef directly from a SkiaSalBitmap's Skia bitmap data without copying to any intermediate buffers. Change-Id: If6ab7f175889cb4839d8a2461b7be7671e575c08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144856 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-12Fix typoAndrea Gelmini
Change-Id: Ifd46201254b8a5db1d21d99d469d331688e8731c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143952 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2022-12-11Related: tdf#146842 Convert SkiaSalBitmap to QuartzSalBitmapPatrick Luby
Commit de3f13e2175564316eb5a62dee65e9ff8f31b460 disabled Skia for printing. However, since all SalBitmaps created are either all QuartzSalBitmaps or all SkiaSalBitmaps, a crash occurs whenever a SkiaSalBitmap is passed to a printer's SalGraphics instance which is now always non-Skia. Change-Id: I7c1b0e1a9993e21db18ba5695a106cb10cc4088a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143939 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-21remove 4-bit bitmap bits that were still present in QuartzSalBitmapTomaž Vajngerl
Change-Id: I3a363f9b382e298422e3a4bd6b58504cbaba077e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137286 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-01-14VCL drop m_pInstance from *nix SalDataJan-Marek Glogowski
AKA the "*nix SalData untangling" commit. The original plan was to get rid of vcl/inc/saldatabasic.hxx and even SalData for all the *nix backends. But after many backs and forths, reinspecting the code and imagining the resulting code, I decided against that plan. All these variants would have resulted in reinterpret_cast calls, I wanted to prevent. And they would have required larger renames for no benefit. An other, related idea was to include all SalData implementations in the vcl/inc/svdata.hxx header, but that seemed like an include explosion, so was also dropped. I tried to untangling iOS from using GenericUnixSalData, as it doesn't use any of it's features. The new, minimal SalData should be sufficient. I'm leaving the easier drop of mpInstance from the Windows and MacOSX backend as a minimal interesting EasyHack. Change-Id: I5be01c1f42131a7e31cb30899392308e1e2de53b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128402 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-04-06vcl: quartz - use ScanlineTransformer instead of local converterTomaž Vajngerl
ScanlineTransformer was created because there are multiple impl. of the same tool (ImplPixelFormat), but it never replaced those duplications. This change removes one of the duplications - the one in Quartz backend. Change-Id: I637433ae59e7577022b86e582eb4a8a64f3055f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113610 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-04-06vcl: use PixelFormat enum in SalBitmap interface and backendsTomaž Vajngerl
This changes all backends to use PixelFormat as the input to the SalBitmap::Create method (and all the backends). This is the first part as we need to make sure to also limit the use of GetBitCount method and also use of it in SalGraphics. Change-Id: I8d2b6adfcb8fe3dd78010538411f338c9a1c3996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113603 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-01-18Clean up includes a bit for iOS and macOSTor Lillqvist
Change-Id: I1dc6256968503ee3865f90e3693acce911a1d65c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109485 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-01-17tdf#138122: Fix vcl for iOS after 1a167625314bf36b735176ed488e6ba9b5e9b675Tor Lillqvist
Make vcl compile again for iOS and make the Collabora Office iOS app work again when built against a master build of core. For now, keep the old versions of the functions touched by 1a167625314bf36b735176ed488e6ba9b5e9b675 in vcl/ios/salios.cxx, and move the modified versions to the new file vcl/osx/salmacos.cxx. Keep the functions as they were except that ifdefs for MACOSX or IOS are expanded. Keep the formatting as it was to make comparisons easier. Thus add the new files to the clang-format exclusion list. While at it, also move vcl/quartz/salgdiutils.cxx to vcl/osx as it is compiled only for macOS anyway. Change-Id: I990ef678f2263031d4a5af8cc547fffe185d17c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109480 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-01-17tdf#138122 Add window scaling for retina displays on macOSThorsten Wagner
(1) Remove hack to make application look as if being linked against SDK 10.13 (2) Use quad storage size on virtual devices for displaying on retina displays thereafter (3) Apply workaround to downsample bitmaps from scaled layers (to be implemented) (4) Disable dark mode (to be implemented) (5) Provide new environment variables: VCL_MACOS_FORCE_WINDOW_SCALING: window scaling on non retina displays VCL_MACOS_FORCE_DARK_MODE: enable dark mode (macOS 10.14, iOS 13 and newer) VCL_MACOS_USE_SYSTEM_APPEARANCE: use light mode or dark mode (macOS 10.14, iOS 13 and newer) as configured by system preferences Change-Id: I99877cd62a98cb91bcbf27af62b043c31c5f5fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109072 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-01-04Don't use m prefix for a local variableTor Lillqvist
Change-Id: I73e106923d463215078a465f9ff933ea3c89255f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108665 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-12-29vcl: move local bitmap headers to inc/bitmap directoryChris Sherlock
Change-Id: I72cc28d4df8031e322daa50d79666cabcb6421a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108040 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-07-21Improved oplugin:staticanonymous -> redundantstatic redux, macOSStephan Bergmann
Change-Id: I221351bdc43b48e714acca89bc84db007258299e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99115 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-30differentiate between 8bit and any-bit grey palette (tdf#121120)Luboš Luňák
Only the grey palette with 256 colors means that pixel values map directly to color values. Tdf#121120 has an image with 2-bit palette where color index 1 is (255,255,255), but that means the pixel value 1 cannot be just treated as color. Change-Id: Ifbd953af7f291e4fb8032ea0f4c33c0514770856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97283 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-06-11loplugin:simplifypointertobool (macOS)Stephan Bergmann
Change-Id: I414eaf0e61be09ccf12d04577c89dbcdb845f85f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96117 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-28loplugin:simplifypointertobool (macOS)Stephan Bergmann
Change-Id: Ie26580277fa6d0734b8af1eb029e0883a3c6f886 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95064 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-06loplugin:external (macOS)Stephan Bergmann
* OldEntry in fpicker/source/aqua/resourceprovider.mm was apparently unused ever since it got introduced with 00657aef09d854c74fb426a935a3e8b1fc390bb0 "migrate to boost::gettext" * impl_throwError is used from multiple TU, connectivity/source/drivers/macab/MacabStatement.cxx just missed the relevant #include Change-Id: Iba131da57aa20085bb1c634ba9a3a59566070abd Reviewed-on: https://gerrit.libreoffice.org/84653 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-26remove internal use of 16-bit packed formatsNoel Grandin
none of our supported hardware uses these any more Change-Id: Ic95d6df619a05df0bec1f5870596cb2bb3bcc6cb Reviewed-on: https://gerrit.libreoffice.org/79476 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-23loplugin:fragiledestructor (macOS)Stephan Bergmann
Change-Id: I8ac1f67999ccbb6c411359ac6fd4c473dc339d44 Reviewed-on: https://gerrit.libreoffice.org/79398 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-07remove some unnecessary castsNoel Grandin
Change-Id: I16aa2cdc3e92c3ea2661ebf0a528f72cbe193df9 Reviewed-on: https://gerrit.libreoffice.org/78716 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-30tdf#62699 Drop (now) pass-through header include/vcl/salbtype.hxxGabor Kelemen
Change-Id: I2e2093ac3c8c6833b70d4932bc12a82a4483bde5 Reviewed-on: https://gerrit.libreoffice.org/76499 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-16loplugin:simplifyconstruct (macOS)Stephan Bergmann
Change-Id: Ifad405b05142ce61673f22ec3160f50314419ce7 Reviewed-on: https://gerrit.libreoffice.org/75680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-07Bin the much too verbose SAL_INFO() calls for the "vcl.cg" tagTor Lillqvist
Quikee agreed that they aren't really useful. Doing even the simplest things causes such a huge amount of logging that it is questionable whether anybody could have any use of it. Parts of it might be useful to restore later, if need arises. Like the mnContextStackDepth logging in vcl/inc/quartz/CGHelpers.hxx. Change-Id: If635e6492a50e5955c56c54fa310e7c0ab2986ae Reviewed-on: https://gerrit.libreoffice.org/73639 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-05-18use CGContextHolder in AquaSalBitmapTomaž Vajngerl
Change-Id: I87f5a1bc2c41c58cff747bbad82867d53ea92ce7 Reviewed-on: https://gerrit.libreoffice.org/72442 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-05-18Wrap CGLayer into a CGLayerHolder class and move code to use itTomaž Vajngerl
Change-Id: I52539f6582d099ef80048d9a25266c88e1f6d783 Reviewed-on: https://gerrit.libreoffice.org/72439 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-05-13Make BitmapColor inherit from / merge into ColorJan-Marek Glogowski
BitmapColor itself is kept to distingish the Color usage as part of a color palette, which continues to store the offset in the blue value. The original special mbIndex handling is long gone since commit 1fefdd6f3b41 ("Alpha channel in BitmapColor - change bIndex to alpha"), so there is no data difference. This also results in the following changes: * now has a basic_ostream<charT, traits>& operator<< (that was my actual starting point... for an other bug fix) * there is a minimal difference for GetLiminance BGR(29,151,76) => BGR(28,151,77) * no more return values for Merge and Invert (previously returning *this) * replaces all GetBlueOrIndex with GetIndex This leaves one "problematic" part: the GetColorError handling. At first glance it should probably be virtual. The Color variant is less strict then the BitmapColor one - for whatever reason. BitmapColor is always used to search for the best match in a Palette. Currently I'm simply leaving both variants. Would be nice to have an explict for functions here. Change-Id: I251ba3024a1d60f2a9d9fde9cd0a60f08e8322a7 Reviewed-on: https://gerrit.libreoffice.org/72181 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-05-08Add some comments to macOS backend impl. of SalBitmapTomaž Vajngerl
Change-Id: Idfefe7598df0b2e382be84aa5bfc8b60201768a7 Reviewed-on: https://gerrit.libreoffice.org/71991 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-08o3tl::make_unique -> std::make_unique in tools..xmloffGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Ib3201f865d43f372007cdf381c7e244e9cbeae26 Reviewed-on: https://gerrit.libreoffice.org/67474 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-26The macOS+iOS-specific BitmapSystemData::rImageContext was not used anywhereTor Lillqvist
Change-Id: I7190a44d4857fd337fb49e689cd71ffb78b86b9d
2018-12-26Add some pondering about code of questionable provenance in a commentTor Lillqvist
Change-Id: I20b3c8ba0ae4018307a97150440c708cfa3edc40
2018-12-21Add a bit more information to a SAL_WARNTor Lillqvist
Change-Id: Iea825271825119bddfdaa79af3b111659f084d0b
2018-11-19tdf#42949 Fix IWYU warnings in include/vcl/[ab]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If18c80fc64e55d797953e24e40e5d5e62bd9c625 Reviewed-on: https://gerrit.libreoffice.org/63453 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-10-09Bin horribly verbose image saving on iOS for debug purposesTor Lillqvist
Not really that useful any longer. Change-Id: Idf29b9c3eeafd1b1cc7a2baa87205f7064681a23
2018-10-03We need to include <o3tl/make_unique.hxx> hereTor Lillqvist
Change-Id: I9670407cd9e848d208f844f6d0879a5a19b86f4c
2018-09-20loplugin:useuniqueptr in ImplPixelFormatNoel Grandin
Change-Id: If116578f68438550bddab5d2257b9af4ec8a69b0 Reviewed-on: https://gerrit.libreoffice.org/60705 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-20loplugin:useuniqueptr in QuartzSalBitmap::CreateColorMaskNoel Grandin
Change-Id: I7fbebf3730aa79209a3ad954522ad8695e5d8c24 Reviewed-on: https://gerrit.libreoffice.org/60704 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18loplugin:external (macOS)Stephan Bergmann
Change-Id: Ib06572a844d2999e9ecd91e26abd98ecec06a0ae Reviewed-on: https://gerrit.libreoffice.org/60665 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-29replace rtl_allocateMemory with std::mallocNoel Grandin
where used directly, since rtl_allocateMemory now just calls into std::malloc Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad Reviewed-on: https://gerrit.libreoffice.org/59685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-17loplugin:redundantfcastStephan Bergmann
Change-Id: Ife2d609403c753b917f29fa00bc5f5f1a520503d Reviewed-on: https://gerrit.libreoffice.org/59238 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-31Add missing sal/log.hxx headersGabor Kelemen
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. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory vcl Change-Id: I205fe0f4e80a66cd9c3b19f7e9716411da1d1cf5 Reviewed-on: https://gerrit.libreoffice.org/58221 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-29tdf#117335 Fix displaying GIF imagesBartosz Kosiorek
To fix regression the sal_uInt16 was used instead of sal_uInt8. Verified on macOS High Sierra 10.13.5. I also checked if with this fix, there is no issue with displaying EMF (tdf#113197) Sample document from tdf#113197 is displaying correctly. Change-Id: I6504717d831a193b0a878ced2f335d34a993aed6 Reviewed-on: https://gerrit.libreoffice.org/56578 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-04-17tdf#113197 Add MaskPrimitive (clip) to EMF/WMF if neededArmin Le Grand
Added code to quartz vcl implementation that takes care when BitmapPalette.count != (depth^^2)-1 - which may be the case anytime. If then a bitmap value exists that goes beyond that count, a invalid access was executed Change-Id: Iab332c91b8753aab85e9d365323f5c9e531efab2 Reviewed-on: https://gerrit.libreoffice.org/44058 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Jenkins <ci@libreoffice.org>
2018-04-16push logic from ImpBitmap::ImplReleaseBuffer downNoel Grandin
in preparation for removing ImpBitmap Change-Id: Icae48c081d821518103d08a7b62bcb4d64654c35 Reviewed-on: https://gerrit.libreoffice.org/52939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-26replace SalColor with ColorNoel Grandin
Change-Id: I615640a378a61cf6e44e84a647ce06bdd8a52807 Reviewed-on: https://gerrit.libreoffice.org/51239 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-21Don't initialize data for --enable-dbgutil onlyStephan Bergmann
This had originally been introduced with 0f6149593129c3d208f07d0d017dec0c71760778 "Make it easier to catch code that assumes SalBitmaps are created pre-cleared". But it only made it harder to find the issue reverted with ebe247642d85d39b6e1ffae3cf92c31748f2e983 "Revert 'tdf#116213 OS X and OpenGL bitmap scaline sizes are not 32-bit aligned'". Change-Id: I344e1ab4b390baa8364ade5fd2737a12708facdc
2018-03-21Revert "tdf#116213 OS X and OpenGL bitmap scaline sizes are not 32-bit aligned"Stephan Bergmann
This reverts commit 460f39e687393b3a8906d2adc3e8f7a0c749851a. For one, it had started to make bitmap checksum equality check in svx/qa/unit/XTableImportExportTest.cxx, CppunitTest_svx_unit, fail most of the time in macOS --disable-dbgutil builds, as the bitmap checksum is now computed also over padding bytes containing random values (but --enable-dbgutil initializes those bytes). And why would fixing tdf#116213 for Windows require touching the macOS-specific code, anyway? For another, tdf#116213 comments 6 and 7 report further problems that are likely linked to this commit. Change-Id: I3e158813ab89a1ead3780abbf6b120ec52660231
2018-03-16tdf#116213 OS X and OpenGL bitmap scaline sizes are not 32-bit alignedChris Sherlock
Change-Id: I92b43ae2f034bf63cc3f212ec8728c5c6b5e8934 Reviewed-on: https://gerrit.libreoffice.org/51222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-03-09drop getColor() method of ColorNoel Grandin
no longer necessary Change-Id: I9e0fcea1134e8c5e27f9effbb5eb79fe5446e33d Reviewed-on: https://gerrit.libreoffice.org/50925 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>