SDL: add idiotic workaround to be less blurry on HiDPI#1602
Conversation
SDL_GetRendererInfo could be useful to check for supported flags. SDL_GetOutputSize is required to get some kind of half-functioning output for so-called "HiDPI," which is broken by design.
Naturally we supported so-called HiDPI since the mesozoic era of over a decade ago. You'll find that Windows XP and ancient X11 for example also support it much better than modern roughly post-2015 operating systems, contrary to rampant claims by the clueless.
|
NB I had the displeasure of looking at macOS bad blurry scaling for the past half hour and I'd like to take this opportunity to state to the person I don't recall who told me that macOS is sharp that they are completely and utterly bloody wrong. a. It sizes things down from 2x so it will never not be blurry. |
| h = h or SDL.h | ||
| local output_w = ffi.new("int[1]", 0) | ||
| local output_h = ffi.new("int[1]", 0) | ||
| if SDL.SDL.SDL_GetRendererOutputSize(SDL.renderer, output_w, output_h) == 0 and tonumber(output_w[0]) ~= w then |
There was a problem hiding this comment.
I assume the double SDL is an unfortunate side-effect of our own ffi wrapper being named SDL, and the C namespace for the actual SDL lib being named SDL too?
There was a problem hiding this comment.
Yes, we could change one of them if desired for clarity. The construct occurs a fair bit throughout the code dealing with SDL I'm sure. ;-)
The one called S in SDL2_0.lua is called SDL in framebuffer here.
Lines 61 to 67 in df96630
|
I think I grok the intent, but I'm unfamiliar with both SDL internals and HiDPI woes in general to say much about it, but I imagine it's at least less worse than before ;). |
Fixes <koreader#8630>. Might require the `SDL_VIDEODRIVER=wayland` environment variable. Includes: * SDL: add idiotic workaround to be less blurry on HiDPI (koreader/koreader-base#1602) * SDL: avoid silly ABS_MT_TRACKING_ID for mouse button presses (koreader/koreader-base#1600)
Fixes <#8630>. Might require the `SDL_VIDEODRIVER=wayland` environment variable. Includes: * SDL: add idiotic workaround to be less blurry on HiDPI (koreader/koreader-base#1602) * SDL: avoid silly ABS_MT_TRACKING_ID for mouse button presses (koreader/koreader-base#1600)
Fixes <koreader#8630>. Might require the `SDL_VIDEODRIVER=wayland` environment variable. Includes: * SDL: add idiotic workaround to be less blurry on HiDPI (koreader/koreader-base#1602) * SDL: avoid silly ABS_MT_TRACKING_ID for mouse button presses (koreader/koreader-base#1600)




Fixes #1300
This change is