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

9735 commits

Author SHA1 Message Date
attila
7ead20d575 WebBrowserComponent: Windows: Avoid flash to default JUCE background colour
The default background colour of the WebBrowserComponent is white on all
platforms. Before the first page finishes loading this is the colour
that should fill the WebBrowserComponent's area.

Prior to this change however, on Windows a sudden flash to the default
JUCE background colour would occur, before the default white background
could take effect.

At the time of this commit there is a known issue with the
icorewebview2controller2, where a white flash is inevitable, unless the
WEBVIEW2_DEFAULT_BACKGROUND_COLOR environment variable is set. Using
a white background behind the WebView avoids this issue.
2024-07-11 13:36:07 +02:00
reuk
8642cfe6b3
Direct2D: Remove rectangular clip assertion
This assertion was intended to emulate a performance warning that could
be emitted by the D2D debug layer, but it often gets in the way during
development. To check for this performance issue, users can change
D2D1_DEBUG_LEVEL_NONE to D2D1_DEBUG_LEVEL_INFORMATION in
juce_DirectX_windows.h
2024-07-09 12:47:30 +01:00
reuk
4c1a93e8d8 FreeTypeTpeface: Avoid recreating FTTypefaceList at shutdown
Calling getInstance may recreate the list singleton if it has already
been destroyed. This should only happen if a Typeface instance is being
destroyed after the app/plugin has been shutdown, e.g. if the typeface
has static storage duration.
2024-07-08 13:16:57 +01:00
reuk
1023f62338 XmlElement: Avoid potential undefined-init-order issues with juce_xmltextContentAttributeName
This fixes potential crashes when this static object is accessed from
the constructors of other objects with static storage duration.

A concrete example of this could be seen when running the following on
Linux:

    static inline const Typeface::Ptr face =
        Typeface::createSystemTypefaceFor (...);

Here, 'face' is a static data member of some class. Creating a system
typeface on Linux will parse an XML document of system typefaces,
eventually accessing juce_xmltextContentAttributeName.
2024-07-08 13:09:30 +01:00
attila
9844687735 Javascript: Convert void and undefined vars to correct QuickJS values 2024-07-05 17:18:16 +02:00
attila
ced6347505 Javascript: Fix dangling pointer 2024-07-05 17:17:56 +02:00
reuk
606a7bc552 Javascript: Update implementation to preserve methods when converting between JUCE and QJS types 2024-07-04 19:36:57 +01:00
attila
d2f3e920f7 WebSliderParameterAttachment: Always report the NormalisableRange defined number of steps
Even for AudioParameterFloat.
2024-07-04 16:23:51 +02:00
attila
9082d3274a Fix inactive sliderDragStarted/sliderDragEnded events in the WebView frontend library
This fixes the behaviour of WebBrowserComponent based plugins, including
the WebViewPluginDemo, when working with automations.
2024-07-04 13:59:30 +00:00
attila
f1954bbe4d Add missing documentation for Javascript helper classes 2024-07-04 13:59:30 +00:00
attila
9f06b4f6a6 Update WebBrowserComponent documentation 2024-07-04 13:59:30 +00:00
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
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
reuk
a858f91354
Platform: Remove deprecated code paths that will never be called 2024-07-03 14: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
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
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
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