summaryrefslogtreecommitdiff
path: root/vcl/quartz
AgeCommit message (Collapse)Author
2019-11-19tdf#128434 correctly release fonts in destructorsJan-Marek Glogowski
This adds ReleaseFonts() calls to all destructors of SalGraphics and TextRenderImpl derivated classes, which implement SetFont. During destruction a base class can't call into derivated classes, as these are already destructed, so we have to spread these calls manually. Change-Id: Ia57db04f7df665e5205212ce512119e2f60e3379 Reviewed-on: https://gerrit.libreoffice.org/82967 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit f8e1f8652255cadd80a991aa3e059ee631b333b8) Reviewed-on: https://gerrit.libreoffice.org/83149
2019-10-14Fix method name origin in SAL_WARN_IF(vcl/quartz/salgdi)Julien Nabet
Change-Id: I7fff6af5e521318324df63b32d4be7b0e0f12771 Reviewed-on: https://gerrit.libreoffice.org/80803 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-08-28loplugin:returnconstval (macOS)Stephan Bergmann
Remove the spurious "const" that dates back to a poor change in 9177329a425cf70b515d1f266132838894fe54c6 "vcl: FontCharMap to use intrusive_ptr ImplFontCharMap": > --- a/vcl/inc/quartz/salgdi.h > +++ b/vcl/inc/quartz/salgdi.h > @@ -73,7 +73,7 @@ public: > CoreTextStyle* CreateTextStyle( const FontSelectPattern& ) const; > int GetFontTable( const char pTagName[5], unsigned char* ) const; > > - const ImplFontCharMap* GetImplFontCharMap() const; > + const ImplFontCharMapPtr GetImplFontCharMap() const; > bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) > const; > bool HasChar( sal_uInt32 cChar ) const; > Change-Id: I6a533a917ec42513b0783332c35e0a6803504324 Reviewed-on: https://gerrit.libreoffice.org/78235 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-27Consolidate ImplCalcLineSpacing()Khaled Hosny
Move getting UPEM and font tables to the functions and use HarfBuzz API to get them. In the future we might stop reading the tables ourselves and use HarfBuzz metrics API instead. Change-Id: I3f4511628fd33200bae94cdcd96479ba3e6d2fba Reviewed-on: https://gerrit.libreoffice.org/78081 Tested-by: Jenkins Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2019-08-23loplugin:returnconstval in vclNoel Grandin
Change-Id: Id4a0b460ba3c43e80b80ae6e2da9e40a6753e14c Reviewed-on: https://gerrit.libreoffice.org/77965 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-25tdf#124042: Remove unnecessary code for iOSTor Lillqvist
We don't need to pop the Core Graphics context state stack completely before releasing the context. The code that tried to do that failed anyway when the context was a "foreign" one (from doc_paintWindowDPI() in core's init.cxx) thad had already been released there. Also removed another apparently unnecessary ifndef for iOS. Change-Id: Idcd1e6edd06ab259ec850fd66fcbabc3df0ae3af Reviewed-on: https://gerrit.libreoffice.org/76263 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-07-06Constify GlyphItemJan-Marek Glogowski
This hides all the data, which shouldn't change after init. Real const makes a lot of problems for copying, so this is the 2nd option to just add getters for private data. While at it use typed_flags for the GlyphItemFlags. Change-Id: Ic1eeabe2398f6c30080fdd516285b72c620b11be Reviewed-on: https://gerrit.libreoffice.org/75147 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
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-06-06loplugin:data (macOS)Stephan Bergmann
Change-Id: I404a8364a4c7f8d48533fb3c7757a5b7798de9d8 Reviewed-on: https://gerrit.libreoffice.org/73588 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-04tdf#122221: Bin apparently unnecessary early returnTor Lillqvist
Removing these few lines of code fixes the problem on iOS, and has no apparent ill effect on macOS. But sure, I didn't check that thoroughly on macOS, so in case this has a bad effect on macOS after all, need to reinstate the few lines but make them #ifndef IOS. (Still passes make check.) Change-Id: I2380d010ba223a698acfe916fca4580a1502be98
2019-06-02tdf#125506: use rObjectToDevice if neededXisco Fauli
Use same logic as in vcl/unx/generic/gdi/gdiimpl.cxx Regression from 16091ff88aaab9ba9103c4e369bf79b97f431f40 See https://bugs.documentfoundation.org/show_bug.cgi?id=125506#c13 Thanks to Thorsten Wagner for pinpointing Change-Id: I7a7a8c4b3355f5621ba1603939a3757cd03e7777 Reviewed-on: https://gerrit.libreoffice.org/73319 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-05-31tdf#125506 tdf#121241: No need to transform to DeviceCoordinatesXisco Fauli
Regression from b9fa01a8d1137a95af9865a3e47995734c40da6e Change-Id: Ie4ab65966e274bff4d699b7cd4dc0fd47d26c558 Reviewed-on: https://gerrit.libreoffice.org/73249 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2019-05-22tdf#124271 use the bitmap context, handle scalingTomaž Vajngerl
The problem with latest macOS versions is that creating a graphic context with window (NSGraphicsContext graphicsContextWithWindow:) only works when actually drawing and otherwise it returns null. This caused problems before in AquaVrtualDevice, but we also use this when creating a device backing storage. This interestingly caused slowdowns and eventual crash, but the backtrace looked very misterious as it didn't crash because of a nullptr, but it halted all drawing commands and it crashed because of that. This changes the graphic context with a bitmap context, as it was already done in VirtualDevice and use that instead. The problem with a bitmap context is that we need to handle HiDPI scaling by ourselves now. LayerHolder was extended to store the scaling information of the layer (and its underlaying bitmap context) and provides methods that get the size of the layer in pixels or in scaling independent points (which is just size in pixels multiplied by the scaling factor). An known issue is that VirtualDevice also needs to take scaling into account, which it currently doesn't, so the text is still blurry on a HiDPI screen, but that was already true previously and is something that will be done in a different change. Change-Id: I8e10c518ecba285125746bd20525c4cb5ca67279 Reviewed-on: https://gerrit.libreoffice.org/72663 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.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-18use CGContextHolder in copyBitsTomaž Vajngerl
Change-Id: I98f1723da170712e2f2c2a846e02954381376c7e Reviewed-on: https://gerrit.libreoffice.org/72441 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-05-18use CGContextHolder in AquaVirtualDeviceTomaž Vajngerl
Change-Id: If5e27ea4049a76e560dd9823f335b86e2599d4cc Reviewed-on: https://gerrit.libreoffice.org/72440 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-18macOS: store VirtualDevice size in an instance variableTomaž Vajngerl
Change-Id: Id0a7317e9aed4b0222affb7292f6a3a44af74040 Reviewed-on: https://gerrit.libreoffice.org/72438 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-05-17handle CG state save/restore in ContextHolder classTomaž Vajngerl
Change-Id: I44ee257a8a196e8f2372dd01776c0c7c5193ad0a Reviewed-on: https://gerrit.libreoffice.org/72436 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-05-17Wrap CGContext into a ContextHolder classTomaž Vajngerl
Change-Id: I3088e0b2f6c54f272fd29d7a6069e8231b207666 Reviewed-on: https://gerrit.libreoffice.org/72435 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-04-21tdf#101854 Move to CommonSalLayout removed faux bold in macosTomaž Vajngerl
Previously faux bold was drawn with setting a dictionary key kCTStrokeWidthAttributeName and a value of the stroke width. This stopped working because we don't use attributedString for drawing anymore but we always use CTFontDrawGlyphs and draw the glyphs, which doesn't have a way to set this attributes. It took me a while to find a workaround (thanks to Apple's great documentation), where we switch text drawing to fill and stroke, and after that we can modify the stroke by changing the line width. Change-Id: I594fcb9c796a9c04ea8234a9938ca2f719706199 Reviewed-on: https://gerrit.libreoffice.org/71012 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-03-15tdf#124042: If mrContext is zero, calling Core Graphics APIs on it is futileTor Lillqvist
If mrContext is zero, the CG calls using it won't do anything and will cause "invalid context" warnings when running under Xcode. So just return early. Such calls to drawPolyPolygon() are apparently not essential but accidental and of no real use. Possibly related to bogus "focus" indicator painting. Which does not make sense on iOS as we aren't drawing to any actual "windows" with "focus". Change-Id: Icc4a768d8b255c09a8972551443ce59f4ad56089
2019-03-08Don'tbuild HarfBuzz with Core Text support on macOS/iOSKhaled Hosny
HarfBuzz 2.x has native support for AAT fonts which is, according to Chrome developers, sgnificantly faster that HarfBuzz Core Text integration. Change-Id: I4d5e861a1958402a6e3ccb720b10f40828c3db6a Reviewed-on: https://gerrit.libreoffice.org/68919 Tested-by: Jenkins Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2019-03-08make it possible to use FileDefinitionWidgetDraw in more backendsTomaž Vajngerl
Change-Id: I8871eb49e11d8c72c469230967c3c979091a0f9b Reviewed-on: https://gerrit.libreoffice.org/68898 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-26sal_uLong->sal_uInt32 in drawEPSNoel Grandin
Change-Id: I58beedfee1a55df971e778ba2aa3b6989ba53663 Reviewed-on: https://gerrit.libreoffice.org/68341 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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>
2019-02-01remove unnecessary SAL_WARNNoel Grandin
none of other backends warn about this Change-Id: I9b7ceba413d15698a28806cbb35bd02ccc6e9585 Reviewed-on: https://gerrit.libreoffice.org/67229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-25Assert missing SalGraphics font on GetTextLayoutJan-Marek Glogowski
Trying to layout text without a font can't work. Without a font, currently the text is simply not painted, but this is still a programming error, so warn the developer. And we can get rid of all the intermediate OutputDevice font and gpahics checks, as everything now uses Harfbuzz and there won't be any layout which can't use the cached runs, so just generate them directly. Change-Id: Iae1fab0afeefec1cb1ca82c4e5d8dcbe9919859d Reviewed-on: https://gerrit.libreoffice.org/66818 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-01-25Change SalGraphics::GetTextLayout definitionJan-Marek Glogowski
* drop the unused ImplLayoutArgs argument * return a std::unique_ptr<GenericSalLayout> Change-Id: I150a2a46f67f1ffbbd3ba0ffa68f5bffb30206c8 Reviewed-on: https://gerrit.libreoffice.org/66884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
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-21Bin unnecessary #ifdef, this file is for macOS onlyTor Lillqvist
Change-Id: Ia969648653b71e441446c38c4bed632ff1e53cc6
2018-12-21Add follow-up comment with guess why it must be 96Tor Lillqvist
Change-Id: Ifa725c40c5756ba7999423a782180c1ac3901d30
2018-12-21Add a bit more information to a SAL_WARNTor Lillqvist
Change-Id: Iea825271825119bddfdaa79af3b111659f084d0b
2018-12-11Adapt MACOSX/IOS ifdef for the now constness of the nFlags variableTor Lillqvist
Change-Id: Ic6c51cdc219e663c59dee32f61e337709c90fbd2
2018-12-11Do as the docs say: Use the CGContext property instead of graphicsPortTor Lillqvist
The graphicsPort property of NSGraphicsContext is deprecated in 10.14. CGContext is there since 10.10 so we can use it unconditionally. But sadly this did not enable me to un-comment the assert() a few lines below. Wonder if this deprecation is just a cleanup of the API, and functionality-wise the CGContext property is exactly the same as graphicsPort? Change-Id: I2d5d0c766c343faa2d8cabea3a0729ce5b3a34e3
2018-12-11Comment out an assertion that fails every time for me on macOSTor Lillqvist
Change-Id: I458f44d16b242700b228db647582c4b40b14661a
2018-12-11OSX implement bitmap-only rendering modeJan-Marek Glogowski
Eventually OSX should also depend on SVP and SVP should just export the platform agnostic code, so we can get rid of all the IOS and ANDROID ifdefs. Since the SVP mode now also uses a default DPI value of 96, we can get rid of those "broken" adjustments to the tests in commit a4ab0c08e747 ("Row height tolerance level increase for unittest") and commit 1e55a47e89a9 ("tdf#62268: allow row height recalculation on document load"). The DPI handling on OSX seems really broken. Additionally DPI should probably a float value, as rounding results in various of-by-one errors in tests. Change-Id: I47881683a9c3d3e1b4f8e7aba1d03842da4d6652 Reviewed-on: https://gerrit.libreoffice.org/64736 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-12-11OSX always fall back to a bitmap contextJan-Marek Glogowski
I'm not sure this is the best idea, but without a context many things will definitly break. In theory this is just needed for bitmap-only rendering mode. This is a more general solution of commit e659c6a1857f ("Work around odd macOS 10.14 graphicsContextWithWindow failure"). Change-Id: I3708c25b302a38e1b0c0cccbcacd6cb9b5ff33dc Reviewed-on: https://gerrit.libreoffice.org/64952 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-05tdf#121719: Revert fix for tdf#96971Xisco Fauli
it's still used on Mac. Revert it until XOL is removed This reverts 258301879bcd20397c38bbd522dea2c923bd9fc2 Change-Id: I06548a590f370618ad640724a1b9c59a3faceec2 Reviewed-on: https://gerrit.libreoffice.org/64582 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29Rename Mac OS X to official name macOS in comments and documentationBartosz Kosiorek
Change-Id: I651b7f202fa52ff5f5357a11aa72c43eb7dc7f95 Reviewed-on: https://gerrit.libreoffice.org/64102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
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>