1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00
Commit graph

13 commits

Author SHA1 Message Date
reuk
7f52509c78
Direct2D: Simplify SwapChain buffer creation 2024-10-16 10:36:53 +01:00
reuk
c57041e5bc
Direct2D: Simplify threading of swapchain presentation
Previously, IDXGISwapChain::Present was called on a background thread,
which made it difficult to avoid race conditions. e.g. during a
live-resize of a window, we would occasionally draw old incomplete
frames instead of new frames at the correct size.

The new approach moves the Present call to the main thread via
AsyncUpdater. We attempt to present whenever the swap event wakes, and
whenever a frame is drawn. Only a single Present call may be made after
the swap event wakes. Subsequent Present calls will be ignored until the
next time the swap event wakes.
2024-10-08 16:10:07 +01:00
reuk
25e2fa44ff
Direct2D: Correctly recreate ID2D1DeviceContext when moving transparent windows between devices 2024-09-05 12:16:02 +01:00
reuk
14d52769dc
Direct2D: Revert to using grayscale text antialisaing exclusively
Reverts b12088a1f6

After some investigation, it appears that ClearType rendering is
unsuitable when
- the render target has translucent pixels underneath rendered text, or
- the render ouput is rotated, scaled, subpixel-translated, or otherwise
  transformed before display.

This necessitates avoiding ClearType when rendering into transparent
bitmaps.

Unfortunately, a commmon use-case for transparent bitmaps is buffered
component images. Even if ClearType were enabled for opaque targets,
ClearType text could then end up displaying next to non-ClearType text
rendered to an intermediate texture, leading to an inconsistent
appearance.

There's also not a straightforward way of exposing a ClearType rendering
option in all of the places that it would be required, and a change of
this size is difficult to justify given that subpixel text rendering
controls would only have an effect on Windows.
2024-09-05 12:15:31 +01:00
reuk
68441e0726
Direct2D: Refactor DeviceResources helper 2024-08-22 18:18:15 +01:00
reuk
8bbcfe4d6b
Direct2D: Move DeviceContext helpers to shared DirectX header 2024-08-22 18:18:14 +01:00
reuk
f3a74896fc
Direct2D: Move bitmap helpers to shared DirectX header 2024-08-22 18:18:14 +01:00
reuk
025a05d210
Windows: Remove clearWindowRedirectionBitmap() 2024-08-22 18:18:14 +01:00
reuk
1b69ba3997
Direct2DResources: Refactor CompositionTree 2024-08-22 18:18:13 +01:00
reuk
e67e78803c
Direct2D: Tidy up implementation of createBitmap and remove lineStride parameter
The lineStride parameter is only required to be set when the 'data'
pointer is also set.
2024-07-04 13:03:34 +01:00
reuk
122b75909e
D2D: Avoid setting DPI when resizing context, as it is already set per-frame 2024-04-29 16:08:23 +01:00
reuk
06903573d2
D2D: Refactor SwapChainThread and attempt to ensure correct alignment of slist entries 2024-04-29 16:08:22 +01:00
reuk
19061e6d17
Direct2D: Add initial support 2024-04-18 14:16:02 +01:00