summaryrefslogtreecommitdiff
path: root/vcl/quartz/salgdi.cxx
AgeCommit message (Collapse)Author
2018-10-30Move SalGraphics glyph functions into FontInstanceJan-Marek Glogowski
As we already rely on the GlyphItem's font instance, consequently this removes the SalGraphics GlyphItem based functions. Also unifies the glyph bound rect cache handling. An interesting aspect is the rotated glyph bounding box handling moved from CairoTextRender to FreetypeFont. It doesn't look like an implementation detail for Cairo, so it may have been a bug. Change-Id: I81bbb5d8ee98fb77a1eee05568c456f9e4553023 Reviewed-on: https://gerrit.libreoffice.org/62503 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-25Change GlyphItem::nFallbackLevel to font instanceJan-Marek Glogowski
No need for a real reference, as GlyphItems are bound to their GenericSalLayout, which holds the valid reference and doesn't allow font change. Change-Id: I8e1129ef99f576e43d55f39aee040ceeb635d51d Reviewed-on: https://gerrit.libreoffice.org/62359 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-25Move GlyphItem into its own headerJan-Marek Glogowski
Actually GlyphItem should be VCL internal, but this requires a transparent SalLayoutGlyphs (i.e. via pImpl), which I'm too lazy to implement currently. This seperation makes the affected source files more obvious and later migration of vcl/glyphitem.hxx easier. While at it apply the coding style and add '_' to member prefix. Change-Id: I61497af5c628c40f51597ce0ef286c47321acbc2 Reviewed-on: https://gerrit.libreoffice.org/62358 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-25Need <o3tl/make_unique.hxx>Tor Lillqvist
Change-Id: I416523b701f6468bcbbc47e9e4e507c319b6beaa
2018-10-25Drop duplicate PhysicalFontFace referenceJan-Marek Glogowski
A LogicalFontInstance has a pointer to its parent font face. And don't pretend we can actually nest MultiSalLayout, so store the GenericSalLayout internally. Change-Id: I801acbc34497fc57e8e185eee34c1a1162dbea93 Reviewed-on: https://gerrit.libreoffice.org/62314 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-10-05SAL_WRN and SAL_INFO tweaksTor Lillqvist
Also add an assertion and some verbose debug output (in #if 0). Change-Id: If4907a682ee7359d71078f72ca2f483c80fc4a58
2018-10-02We shouldn't call DrawTextLayout() without a context on iOSTor Lillqvist
Change-Id: I3e72909ca1aa9f97721d982f16624f496152ae2d
2018-09-19loplugin:useuniqueptr in GetTTSimpleGlyphMetricsNoel Grandin
and only return the advance, we don't use the other field Change-Id: I956033dac97763caea2b27404fe9f099da809899 Reviewed-on: https://gerrit.libreoffice.org/60703 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22rename FontSelectPatternAttributes to FontSelectPatternCaolán McNamara
Change-Id: I2c018e2e61707c0d89178b0cb38a0918906e23cb Reviewed-on: https://gerrit.libreoffice.org/59390 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-21change FindFontSubstitute to operate on FontSelectPatternAttributesCaolán McNamara
it remains to be seen if we need the the returned mpFontInstance of the coretext impl Change-Id: I48f73188250c3eb014f16ffe0a735191da5cb25b Reviewed-on: https://gerrit.libreoffice.org/59322 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-21use LogicalFontInstance with SalGraphicsCaolán McNamara
Change-Id: I66fb1ff4b2fdcc211e0a9d5831f6dcc5e564e789 Reviewed-on: https://gerrit.libreoffice.org/59372 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-21only need FontSelectPatternAttributes hereCaolán McNamara
Change-Id: I5112b1e6db223a3df83b6769af140b3f698fdebd Reviewed-on: https://gerrit.libreoffice.org/59384 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@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-29This cast seems completely unnecessary to me?Tor Lillqvist
Change-Id: I93a135afc1402d9095828c4d41d669471a37f565 Reviewed-on: https://gerrit.libreoffice.org/56661 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2018-06-11drop PhysicalFontFace::CloneNoel Grandin
since we are now holding these via reference counting, no need to clone them Change-Id: I7b0bd86f4a5bca428f7dcd989f838a9aa0c7e179 Reviewed-on: https://gerrit.libreoffice.org/55427 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08hold LogicalFontInstance with rtl::ReferenceNoel Grandin
instead of manual reference counting. Also the releasing of not-currently-in-use LogicalFontInstance objects from the cache is made less aggressive - we now only flush entries until we have less than CACHE_SIZE instances, instead of flushing the whole cache. Change-Id: Ib235b132776b5f09ae8ae93a933c2eebe5fa9610 Reviewed-on: https://gerrit.libreoffice.org/55384 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-07manage PhysicalFontFace by rtl::ReferenceNoel Grandin
Change-Id: I8f66b5afb066fe83abb83c56ebde6f21197f894b Reviewed-on: https://gerrit.libreoffice.org/55333 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-29Change SFErrCodes to scoped enumStephan Bergmann
Change-Id: Ib2f267397e419e8164bb2d732f7cbcca7acad1a6 Reviewed-on: https://gerrit.libreoffice.org/54996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-11Fold CommonSalLayout into GenericSalLayoutKhaled Hosny
Now the crazy constructors of CommonSalLayout are gone, we can merge the two and drop one level of indirection. Change-Id: I166e4ed2c9d22c1ce75246d486f7526c4928f652 Reviewed-on: https://gerrit.libreoffice.org/54077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-05-08Refactor CommonSalLayout font handlingJan-Marek Glogowski
Moves all platform specific code from CommonSalLayout into the platform specific plugins. This way the vcl library won't depend on the Qt5 libraries and the Qt5Font header can be moved into the qt5 VCL plugin. While at it, switch the CommonSalLayouts font reference from the FontSelectPattern to the LogicalFontInstance and also add the harfbuzz font handling to the instance. Change-Id: Ida910b8d88837ea949a2f84394ccc0cfae153060 Reviewed-on: https://gerrit.libreoffice.org/47408 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-05-07Move PhysicalFontFace member of FontSelectPatternJan-Marek Glogowski
A FontSelectPattern describes a general font request. It can be used to find the best matching LogicalFontInstance. The instance will be created based on a PhysicalFontFace, which is really a factory since commit 8b700794b2746070814e9ff416ecd7bbb1c902e7. Following this workflow, this moves the PhysicalFontFace pointer to the instance and makes it constant. Which leaves some special symbol font handling code in the hash and instance lookup code path. It used to query the font face directly from the instance. I'm not sure of the correct handling. The related commits where made to fix #i89002#, which has an attached test document. 1. commit 849f618270da313f9339dda29a9f35938434c91d 2. commit 8c9823d311fdf8092cc75873e4565325d204a658 The document is as broken as it was before the patch. The symbol substitution still works, but the 'Q's are missing when displaying a symbol font. I also don't understand all the reinterpret_casts for fake font ids. I guess this was used to prevent the crashes I see, where a PhysicalFontFace referenced in a valid LogicalFontInstance is freed and a later FontId check in the GlyphCache crashes. So this now checks for a valid cache instead. Change-Id: If8ee5a6288e66cfa4c419289fbdd5b5da128c6ea Reviewed-on: https://gerrit.libreoffice.org/47279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2018-04-25Simplify and rename SalLayout::GetNextGlyphsKhaled Hosny
It is now always called with nLen == 1, so simplify and rename. The criteria for deciding how many glyphs to return was bogus anyway, good riddance. Change-Id: Iff578d124ab40a0dfa84469be8e0e9fc1b6b8c48 Reviewed-on: https://gerrit.libreoffice.org/53406 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
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-01-20More loplugin:cstylecast on macOSStephan Bergmann
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after cab0427cadddb3aaf1349c66f2fa13a4234ba4b2 "Enable loplugin:cstylecast for some more cases" and a409d32e7f6fc09e041079d6dbc3c927497adfed "More loplugin:cstylecast" Change-Id: Iff4877e8a42804c952c48c13332caf0a83c92870 Reviewed-on: https://gerrit.libreoffice.org/48216 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-14use std::unique_ptr for SalLayoutNoel Grandin
to make the ownership passing around more obvious Change-Id: I147ec6d9cfe7566cf3600685e0730ed741c2d90d Reviewed-on: https://gerrit.libreoffice.org/43454 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-30Constify some VCL interface functionsJan-Marek Glogowski
This drops the bPaintEnd optimization for vertical and horizontal lines on Windows, where Polyline and LineTo exclude painting the last pixel of the line. Instead we just always set the last pixel. It also merges the various "SetPixel" call sites into a common drawPixelImpl function. Change-Id: I01cc3c01c908ba74f7978fa90eaaf8d88f923ae3 Reviewed-on: https://gerrit.libreoffice.org/43939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-10-24loplugin:includeform: vcl (macOS)Stephan Bergmann
Change-Id: I4382a45dcffb32c7c001ee722ac1deccb2b01c2d
2017-08-08tdf#111497: fix leak in FindFontSubstitute with CFReleaseJulien Nabet
Change-Id: I9d7de52b4a1ee102b233b982e97ecbf731b476f2 Reviewed-on: https://gerrit.libreoffice.org/40895 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-07tdf#111432: fix leaks in AddTempDevFont with CFReleaseJulien Nabet
Change-Id: I11183b7fd21d2398de9e5f5854763cef96963caa Reviewed-on: https://gerrit.libreoffice.org/40845 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-07loplugin:casttovoidStephan Bergmann
Change-Id: Icda66259acf54e6771b926ce9d329287bd610e82
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-04-21remove unnecessary explicit linefeeds from end of SAL and OSL log callsNoel Grandin
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf Reviewed-on: https://gerrit.libreoffice.org/36727 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin
reference classes, uno::Reference and rtl::Reference. Specifically rename Is()->is() and Clear()->clear(). Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae Reviewed-on: https://gerrit.libreoffice.org/33576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-11sal_GlyphId is a simple glyph id nowKhaled Hosny
No more cleverness. Change-Id: I760c602802961b37728c6987c4ade14fb02ca034 Reviewed-on: https://gerrit.libreoffice.org/31819 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11Don’t encode font fallback level in the glyph idKhaled Hosny
Change-Id: I747d969c3c1dc42b1a3b5d12d06fed3af9a64675 Reviewed-on: https://gerrit.libreoffice.org/31818 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11Don’t encode the vertical flag in the glyph idKhaled Hosny
Change-Id: I00485dd4d42004e4eaa163a9e6ad0a43cf98a30a Reviewed-on: https://gerrit.libreoffice.org/31816 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10Use GlyphItem in more placesKhaled Hosny
Change-Id: Ic0dd8c0311161271817eb9a3f454d00a319e43a8 Reviewed-on: https://gerrit.libreoffice.org/31814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10Pass GlyphItem aroundKhaled Hosny
We have this nice structure that contains (almost) all the information we need, so pass it around instead of passing separate fragments of said information. The ultimate is to kill the horrible sal_GlyphId hack if encoding various bits of information in the higher bits of a 32-bit integer. Change-Id: Ie496bb4c2932157527a388e2a94e46bf0a325a70 Reviewed-on: https://gerrit.libreoffice.org/31781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-01Unused codeKhaled Hosny
Change-Id: Idfc964930c242d752a78cd109d75d809bce4de11 Reviewed-on: https://gerrit.libreoffice.org/31470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29Strip down GetEmbedFontData to what is really usedKhaled Hosny
The only remaining user is EmbeddedFontsHelper, and it just needs the raw font data. Change-Id: Ia15c59158b5c9e44d0936463553303a3c8b6e0f5 Reviewed-on: https://gerrit.libreoffice.org/31374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29SalGraphics::GetFontEncodingVector() is a noop nowKhaled Hosny
Change-Id: Id706fa242277a0ea7ba44f52eab4a56e404bd2fa Reviewed-on: https://gerrit.libreoffice.org/31372 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29Drop a bunch of font metrics flagsKhaled Hosny
These flags mean nothing these days, there are either always true or always false, since we no longer support bitmap or Type 1 fonts. Change-Id: Ie14ca480225a6346d868a44e58e7666c3a06931d Reviewed-on: https://gerrit.libreoffice.org/31346 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-26Kill old Core Text layout engineKhaled Hosny
Change-Id: If80d65899255d8be72f374fbec232d103a08a006 Reviewed-on: https://gerrit.libreoffice.org/31232 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-26ServerFontLayout is already goneKhaled Hosny
Kill DrawServerFontLayout, and rename DrawSalLayout to DrawTextLayout, in parity with GetTextLayout. Change-Id: I3f61efd8c6ecde64f28301dca6a7c91eb0873702 Reviewed-on: https://gerrit.libreoffice.org/31224 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-13Simplify vertical text drawing on macOSKhaled Hosny
Rotate only the rotated glyphs instead of rotating everything, then unrotating the upright glyphs. No need for a rotated font either, rotating the graphics is fine. Change-Id: I1fce2c9c6a29abb1353a5fc8485a9c0d34edfbf1
2016-11-13Fix buildKhaled Hosny
Change-Id: I55db5ba855b8d72e9be0298a68b094c7b01d9f54
2016-11-13Unused codeKhaled Hosny
Change-Id: Ief0942e7e3dfb7a550bcd1de99e4630831438c86
2016-10-18Rewrite AquaSalGraphics::DrawSalLayout()Khaled Hosny
Slightly cleaner code and now handles glyph rotation for vertical text. Change-Id: I98cc8fd7df5e73068294e4d7dd6b38a71dcbdcc7
2016-10-18Support font fallback on macOS for CommonSalLayoutKhaled Hosny
Change-Id: Ifd26b7f14ed77a3aa2a38e5961cac5f9bbb6d796