diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-05-21 14:46:56 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-05-22 01:33:59 +0200 |
commit | 959e8ae7ea33ce94dd80ee8ea172b6db64593873 (patch) | |
tree | c2bd09cd7407f3e830b7552fbeee6fe710e5c142 /opencl | |
parent | 3b67ad5f11714d6bea83ec8511f7723dbd999c56 (diff) |
tdf#124271 use the bitmap context, handle scaling
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>
Diffstat (limited to 'opencl')
0 files changed, 0 insertions, 0 deletions