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

14460 commits

Author SHA1 Message Date
reuk
a4022df686
Direct2D: Fix issue where contexts would not clear properly after pushing multiple clip layers
This issue could be seen when calling setBufferedToImage on a component
with a transparent background with a size different to the component's
size.

The details are unclear to me, but it seems like both calling Clear on
the device context, and using the COPY blend mode, ignore alpha values
and instead use a constant alpha of 1.0 when there is a geometric
clipping layer active.

As a workaround for this issue, when clearing a rectangle we now pop all
active layers, fill their intersection using the COPY blend mode while
there are no layers active, and then reinstate the layers.

The new implementation is likely to be very slow, however I think this
code path is unlikely to be used frequently in practice. The main
use-case for rendering clear transparent areas is the rendering of
buffered component images, but such cases normally use axis-aligned
clipping regions, which should be able to use the faster path.
2024-07-04 13:03:56 +01:00
reuk
f3dfd0d9be
Direct2D: Update formatting in clipToImageAlpha 2024-07-04 13:03:35 +01:00
reuk
6402641d49
Direct2D: Avoid applying pending clip list in excludeClipRectangle unless the transform is non-trivial
Frequently, excludeClipRectangle will be called several times in a row,
in order to trim away borders on each side of a rectangle. When this
happens, we want to avoid creating geometric clip layers which exclude
only two or three of the borders, and instead wait until all borders
have been excluded before applying the clip list. This way, it may be
possible to simplify the clip list to a single rectangle, which can be
implemented using the faster axis-aligned clipping layer.
2024-07-04 13:03:35 +01:00
reuk
b0bd58c5e6
Direct2D: Refactor layer storage to keep strong references to geometries and opacity brushes
Also switches to the slightly newer layer parameters type.
2024-07-04 13:03:35 +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
e18b78dbb2 Resave all projects 2024-07-04 13:05:26 +02:00
attila
c4ddbecf73 SIMDRegister: Fix undefined behaviour 2024-07-04 13:05:26 +02:00
attila
18fa0bfa15 Upgrade to harfbuzz 9.0.0 2024-07-04 13:05:26 +02:00
attila
5b30f2571e Suppress warnings emitted by harfbuzz 9.0.0 2024-07-04 13:05:26 +02:00
attila
cddd850d8a OpenGLDemo: Fix GCC 14 compilation issue 2024-07-04 13:05:26 +02:00
reuk
adcdaad34f
Resave all projects 2024-07-03 21:17:28 +01:00
reuk
a858f91354
Platform: Remove deprecated code paths that will never be called 2024-07-03 14:50:08 +01:00
reuk
5cdf6abf95
Projucer: Update default Apple platforms 2024-07-03 13:50:08 +01:00
reuk
ba9b6581b7
Platform: Remove references to unsupported platforms in docs and strings 2024-07-03 13:50:08 +01:00
reuk
b89553ae2c
Platform: Remove build-time Apple SDK availability checks 2024-07-03 13:50:08 +01:00
reuk
5c1b75cab7
Platform: Remove compatibility checks for Windows 8.1 and earlier 2024-07-03 13:47:06 +01:00
reuk
8ba2dc2ae2
Platform: Remove compatibility checks for Android 20 and earlier 2024-07-03 13:45:37 +01:00
reuk
483429f432
CameraDevice: Use new ObjC method syntax in implementation 2024-07-02 18:13:59 +01:00
reuk
a59d010f99
Platform: Remove compatibility checks for iOS 12 2024-07-02 18:13:59 +01:00
reuk
5391032238
Platform: Remove compatibility checks for iOS 11 2024-07-02 18:06:28 +01:00
reuk
6428f43eeb
Platform: Remove compatibility checks for iOS 10 2024-07-02 18:06:28 +01:00
reuk
e71ebb3407
Platform: Remove compatibility checks for macOS 10.11 2024-07-02 18:06:28 +01:00
reuk
8ac7bfc9ca
Platform: Remove compatibility checks for macOS 10.10 2024-07-02 18:06:27 +01:00
reuk
6d4bf60330
Platform: Remove compatibility checks for macOS 10.9 2024-07-02 18:06:27 +01:00
reuk
da8c5fdcb4
Platform: Remove compatibility checks for macOS 10.8 2024-07-02 18:06:27 +01:00
reuk
4576a75388
Platform: Remove compatibility checks for macOS 10.7 2024-07-02 18:06:27 +01:00
attila
47e71a4050 Projucer: Fix package resolution on Linux 2024-07-02 17:57:12 +02:00
attila
c057c0d55e CMake: Fix package resolution on Linux
This change ensures that instructions are straightforward on
Ubuntu 24.04 and 22.04.
2024-07-02 17:06:46 +02:00
Tom Poole
cb439c51b8 Remove a reference to VS2017 2024-07-01 10:13:33 +01:00
reuk
9dda9d65a7
RenderingHelpers: Allow software renderer to replace content of filled rects 2024-06-27 18:10:22 +01:00
reuk
592e2795b8
Direct2D: Fix regression that caused closed paths to remain open 2024-06-27 18:10:22 +01:00
reuk
cc52e9322d
LowLevelGraphicsPostScriptRenderer: Remove support 2024-06-27 18:10:22 +01:00
reuk
9112911122
MinGW: Remove support 2024-06-27 18:10:21 +01:00
reuk
8a4ec206f2
Projucer: Remove GUI Editor 2024-06-27 18:10:21 +01:00
reuk
813b01e3d8
Projucer: Remove Visual Studio 2017 exporter 2024-06-27 18:10:21 +01:00
reuk
ffc5061937
Projucer: Remove Code::Blocks exporter 2024-06-27 18:10:19 +01:00
attila
3c4aa8d0ce TextLayout: Preserve leading whitespaces
This fixes the CodeEditorComponent regression present since
03e79f8f12.
2024-06-27 15:31:57 +00:00
attila
ef8417023e Represent tab characters with non-breaking space during shaping
This avoids assertions raised when shaping text containing tabs.
2024-06-27 15:31:57 +00:00
Anthony Nicholls
0d8f2c63ec ListenerList: Assert if initialisation could throw for any reason other than a bad allocation 2024-06-27 14:17:37 +01:00
Anthony Nicholls
06fb8f4ea2 ListenerList: Fix a bug where removing a listener during a callback in which it had also been added prevents other listeners from being called 2024-06-27 14:14:25 +01:00
Anthony Nicholls
43762c7575 ListenerList: Move unit tests into separate file 2024-06-27 14:14:25 +01:00
reuk
7bb71cc1ba Direct2D: Make path-rendering behaviour consistent with CoreGraphics and the software renderer
The other renderers implicitly start a new supath at the last path
location when a line or bezier segment is added without explicitly
starting a new subpath.
2024-06-26 14:33:26 +01:00
reuk
815da2ec6d Direct2D: Tidy up clearWindowRedirectionBitmap 2024-06-26 14:33:26 +01:00
reuk
fe1a11908e Direct2D: Fix data race when creating Direct2DPixelData instances on a background thread 2024-06-26 14:33:25 +01:00
Matt Gonzalez
0789048777 Direct2D: Set transform for tiled image brush 2024-06-26 14:33:25 +01:00
reuk
9ae52f3d7a Direct2D: Update backbuffer implementation
Problem description
===================

Firstly, the linked-list of pending presentations acted as a stack
(FILO).  If the swap chain thread and main thread processed frames at
varying rates, then the following sequence of events was possible:

Main thread           Swap chain thread       Queue state
---------------------------------------------------------
Push frame (1)                                [1]
Push frame (2)                                [2, 1]
                      Pop frame (2)           [1]
Push frame (3)                                [3, 1]
                      Pop frame (3)           [1]
                      Pop frame (1)           [] <--  Out of sequence!

Secondly, the swap chain's sequential flip model can only maintain a
valid back-buffer state as long as the list of dirty rects is correct,
and every pixel within the dirty rects is painted incrementally.

In the example above, if the main thread were to produce two frames
before the swap chain thread could present any frame, then presenting
*only* the frame 2 (skipping frame 1) may produce incorrect results when
combined with the existing back buffer. This is because regions updated
in frame 1 may not be updated in frame 2, so regions *only* updated in
frame 1 will be omitted from the back buffer.

Mitigation
==========

This patch removes the old stack of presentations and replaces it with a
slightly more complex mechanism that tracks two different Presentation
objects. At any time, up to one Presentation may be in use by the swap
chain thread (i.e. actively presenting), up to one Presentation may be
accumulating updated/dirty regions (i.e. painting), and up to one region
may be ready, awaiting display.

This scheme resolves the first issue described above by ensuring that
old frame data is not kept around. There is never more than one frame
awaiting display, which means that if the swap chain thread attempts to
display twice in a row (before the main thread produces a new frame),
the second attempt will be a no-op.

The second issue is resolved by accumulating changes into a single
Presentation whenever the main thread produces two or more frames in a
row. If there is already a 'ready' Presentation when the main thread
finishes painting, then all updated regions from the newest Presentation
will be added to the 'ready' Presentation, rather than replacing it.
When the swap chain thread is ready to present, it will therefore see
the result of all the accumulated Presentations produced by the main
thread, instead of just the newest Presentation.
2024-06-26 14:33:25 +01:00
reuk
515e9b9f89 Windowing: Avoid recursively calling WM_NCHITTEST in contains() 2024-06-26 14:33:25 +01:00
attila
adbb0850ed Fix compilation error with C++20 2024-06-24 15:07:16 +00:00
reuk
1019614dcd
URLConnectionState: Use a shared NSURLSession to improve performance 2024-06-24 12:50:02 +01:00
reuk
1e3703fe64
URLConnectionState: Simplify and improve thread safety 2024-06-20 17:52:23 +01:00