We no longer use FreeType, and this code is also not platform-specific,
so Generic seems like a good fit.
FreetypeFontFace -> GenericFontFace
FreetypeFont -> GenericFont
FreetypeFontList -> GenericFontList
FreeTypeTextRenderImpl -> GenericTextRenderImpl
Change-Id: I31547a25167684985fed8b21fdfba61371352528
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208578
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Move FreetypeFontFile and FreetypeFontFace out of
freetype_glyphcache.hxx/.cxx into FreetypeFontFace.hxx/.cxx.
Change-Id: I4eccfa0759340d1da33267bc5e360c1626678de4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208530
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
FreetypeFontInstance was a LogicalFontInstance whose only job was to own
a FreetypeFont and forward to it, while FreetypeFont held a reference
back to the instance to reach the font select pattern. Make FreetypeFont
the LogicalFontInstance, similar to CoreTextFont and QtFont already are.
Change-Id: If07df1a2d706f27b7364457f6288e8db372b7769
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208524
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
The FreeType/fontconfig font backend was spread over three directories
mostly for historical reasons. Lets clean this up and consolidate it
under one directory.
helper.cxx holds the psp path helpers, so it goes to print/ next to the
rest of the printing code.
Change-Id: I67d20e3e4bdf71d978a79e672bb31d3dd1460595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208522
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
This reverts commit 2a7e219bea.
Reason for revert: I was finally able to reproduce the bug and this patch didn't fix the bug. Apparently, the bug only occurs when the notebook bar is used with Skia/Metal. Why the notebook bar keeps moving around with Skia/Metal but not Skia/Raster is now the mystery that needs to be solved.
Change-Id: I36dbb296d1737f6f7d24b0b9a478a4614ef4db5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208131
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
During live resize on macOS, there is a flood of resize
events in quick succession so not only are most of the
newly created surfaces short lived, but preserving and
redrawing the original content drawn to the old surface
is unnecessary since AquaSalFrame::SendPaintEvent() is
is called after each resize event.
Change-Id: I60934d023a1303ffb898815a7787a30b1a163fba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208130
Tested-by: Jenkins
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
The font width used to mean the average character width on Windows,
like GDI’s LOGFONT lfWidth. This complicates things cross-platform, and
also DirectWrite does not expose such info.
Drop the whole average character width nonsense and align Windows to
other platforms, keeping the already existing cross-platforms
workarounds for EMF/WMF that are now applied also to Windows.
Change-Id: I750d42ad090bb9d0f776e80609b7a67b8ac38aac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207990
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
Drop the GDI fonts dance we don’t need now since we already have
DirectWrite fonts from font enumeration.
Change-Id: I7368067a53cd70857621a4a5308b2955314e515f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207988
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Replace hb_variation_t with vcl::FontVariation and convert to HarfBuzz
type only when interacting with HarfBuzz API. This makes VCL APIs
tied less to HarfBuzz API.
Change-Id: I1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203243
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Set variations on the Skia font since now we allow the user to set font
variations, and they can be different from the variations the font was
created with. Previously we only supported named instances and these got
their variations set by the platform font API.
Change-Id: I2cda0409273a8ae00f40dacb1deb166af65ebbe5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200673
Reviewed-by: Khaled Hosny <khaled@libreoffice.org>
Tested-by: Jenkins
All callers of vcl_sal::getSalDisplay call
GetGenericUnixSalData to get the GenericUnixSalData*
to pass as an argument.
Simplify this by dropping the param and
calling GetGenericUnixSalData inside
vcl_sal::getSalDisplay itself.
Change-Id: Id6269b656fbc7414ca65facc717c5b7fc3075e85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200301
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
SalX11Display is the only subclass of the
abstract SalDisplay class.
Merge them and keep the SalX11Display name
to clarify that this is specific to the gen/x11
VCL plugin.
Further simplification (e.g. in the dtor
can follow in separate commits).
Change-Id: Ia0eae9f03c25ff82cbc0834f290c0a828c7c49ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200299
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
After commits 07f480b7c8 (make skia
mandatory on MS-Windows, disable GDI backend, 2025-07-03) and
e7bd446baa (tdf#167642 Restart in
safe mode doesn't launch safe mode on macOS, 2025-07-25), Skia is
enabled in safe mode on these platforms. After enabling it, there
was no code to handle safe mode - so initRenderMethodToUse would
enable HW acceleration (and potentially crash, if the reason to
start safe mode was crash caused by Vulkan / Metal).
This change returns RenderRaster from initRenderMethodToUse in
safe mode on these platforms.
Change-Id: Ie80938f28985cb60e3936f274f26c3dcfa838616
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198993
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
1. Avoid explicitly specifying COM_QUERY in calls to QueryInterface
(it is implied from the name).
2. Drop redundant ctor and set() that duplicate QueryInterface.
3. Allow ThrowIfFailed without a message.
Change-Id: I75b545e534efb7e57da131dfd40a2a49d204efac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198033
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Found after running bin/find-unneeded-includes --headersfwd include/vcl/[d-g]*
This shaves off about 150M input
Change-Id: I2b15257451d4b392dca3e5d07f4a443ee653b04c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196395
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen@collabora.com>
regression from
commit 9791aaaa31
Author: Noel Grandin <noelgrandin@gmail.com>
Date: Tue Aug 5 14:40:41 2025 +0200
tdf#167643 Selection is black
What is weird here is that this is what I first tried when fixing
tdf#167643, and it did not work.
But now this change does work, and tdf#167643 does not recur.
Huh.
It still looks terrible, but at least it is visible now.
The report designer will likely need further work to support
dark mode properly, and likely chart rendering too.
Change-Id: I6b7ed5d073a73377edcb772ef016cdb53294eb9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196827
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
1. Make sure to restore warnings in MSVC after the include.
2. Only use `#pragma GCC diagnostic`, which works both in
GCC and clang.
Change-Id: I0e43659bd9aef5b3758801b474cc3188b1056790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195876
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Instead of an initialization lambda, use COMReference ctor taking an
ancestor COMReference. For that, let WinSalGraphics::getDWriteFactory
return const COMReference&.
Change-Id: Ib2200f800a2562c5e7bcb8ca96a9b2d34dd54be2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193139
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
We don't need the
Create(const SalGraphics& src, vcl::PixelFormat)
variant, because all of the call sites just want a copy
of src with the same format as src, and we already have
a Create() variant for that.
Change-Id: Idb452da2de6baf072be82274435cf765e38c518b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190541
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
they either return true, or they fail in ways that cannot usefully be recovered from.
So just remove the bool return value, and drop the fallback code.
Change-Id: I8a6ac9925defd0a304281f223f11393106b63e28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190497
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
fold the two drawBitmap methods together. The second variant
is no longer necessary since we can draw alpha with the
first one.
Change-Id: I578f72eb59af408624ef321059cfe897258e0b5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190430
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Using X11 backend (gen), LibreOffice produces assertion failure on a
debug build when running with Skia/Vulkan. That is because of missing
implementation for handling transparency on that platform.
I turned the assert/TODO into a warning to avoid assertion failure.
This is supposed to be only for X11, and is tested on Linux.
Change-Id: Iea7ac732123446843aaa71748c10bc17e305fc8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190291
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
checking for 32-bit format is not sufficient when there are 32-bit
formats which do not have actual alpha data.
Change the SalBitmap backend interface to return ScanlineFormat
rather than BitCount, to give a more reliable picture.
Change-Id: I6dde931a05415a9fbe0e8e696173b58e744b0e0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190242
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
<config_skia.h> is required to declare skwindow::MakeVulkanForWin,
otherwise it is shown as error in VS IDE. No idea why doesn't it fail
in build.
Change-Id: I6dce2140f66c88beb3f58eadecd5d9c8363f26a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190060
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins