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

727 commits

Author SHA1 Message Date
reuk
8374725f98
XWindowSystem: Use ScopedWindowAssociation for improved DRYness 2022-12-14 11:12:32 +00:00
reuk
bac51aba8f
OpenGL: Avoid dispatching events to the OpenGL component peer after it is destroyed
The significant change here is that the XSaveContext call in the OpenGL
NativeContext now has a matching XDeleteContext call. This breaks the
connection between the X window and the ComponentPeer, so that we avoid
dereferencing a dangling ComponentPeer pointer if the window receives
events after the peer is destroyed.
2022-12-14 11:12:32 +00:00
reuk
f2d0d9cde8
OpenGL: Add back CVDisplayLink-driven drawing 2022-12-14 11:12:32 +00:00
reuk
da38c1ed2a
TextInputTarget: Improve IME support on Android 2022-12-07 13:12:02 +00:00
reuk
28f2157912
Convert ignoreUnused to [[maybe_unused]] 2022-12-01 11:41:50 +00:00
Tom Poole
306ed633c6 Bump version number to 7.0.3 2022-11-29 11:04:54 +00:00
reuk
0fbd7d7b3f
Functional: Add ScopeGuard implementation 2022-11-02 11:38:29 +00:00
reuk
d8301ddc1c
OpenGL: Tidy up macOS implementation 2022-10-06 17:35:17 +01:00
reuk
7e404118b5
OpenGL: Correctly report OpenGL rendering scale in Pro Tools 2022.7 on Windows 2022-09-27 15:18:21 +01:00
reuk
19175ff698
OpenGL: Ensure that macOS uses the same (sRGB) colour space everywhere 2022-09-27 15:18:21 +01:00
reuk
2ae87f95f1
OpenGL: Carry out all GL rendering on a single thread 2022-09-27 15:18:21 +01:00
reuk
ae3bfdb1d2
OpenGL: Avoid occasional deadlock when destroying contexts 2022-09-26 18:03:47 +01:00
reuk
18aaa86761
OpenGL: Reduce error checking in Release builds 2022-09-26 18:03:47 +01:00
reuk
ff1d5d6da4
OpenGL: Only assert on high-severity errors 2022-09-26 18:03:47 +01:00
reuk
b3a4d54a72
Build: Update the minimum C++ standard to C++17 2022-09-12 16:14:57 +01:00
reuk
8ec8e36f5c OpenGLContext: Swap buffers on the main thread
This change fixes an issue where opening multiple OpenGLContexts on
certain versions of macOS (observed on 10.13) could cause a deadlock.

The issue can be reproduced by:
- Attaching an OpenGL context to the AudioPluginDemo editor
- Opening multiple copies of the editor simultaneously in a plugin host.
  I tested with Live 10.

I also observed the issue in a standalone app that opened new windows
containing OpenGLContexts on a timer.
2022-08-31 17:42:48 +01:00
reuk
322aa64459 OpenGLContext: Share CVDisplayLinks with NSViewComponentPeer 2022-08-31 17:42:47 +01:00
reuk
b27af5def9 OpenGL: Tidying 2022-08-31 17:42:47 +01:00
reuk
e64f87b26c OpenGL: Allow setting window bounds from repaint callback
On Windows, the OpenGL context window sometimes receives a repaint
request after moving between screens with different scale factors.
If the screen has changed size/scale since the last paint operation,
failing to invalidate the painted area may cause the screen contents
to be drawn at the wrong scale until paint is next called.
2022-08-31 17:42:47 +01:00
reuk
02b5ab748a OpenGL: Add support for a few more OpenGL profiles
- 4.1 and 4.3 contexts can now be requested
- The requested context version is no longer ignored on Linux
- Debugging contexts are now enabled in Debug builds with GL 4.3
- Fixes a bug where glEnable(GL_TEXTURE_2D) was called in core profiles
2022-08-31 17:42:47 +01:00
Tom Poole
7296b8e3f7 Bump version number to 7.0.2 2022-08-15 17:26:35 +01:00
reuk
9712775e5b
macOS: Remove macOS 10.12 preprocessor checks
The current minimum-supported Xcode (10.1) includes the macOS 10.14.1
SDK, so APIs from macOS 10.12 will always be available.
2022-08-04 22:51:17 +01:00
Tom Poole
7612f446b5 Matrix3D: Fixed an ordering bug in the multiplication operator 2022-07-28 21:31:47 +01:00
Tom Poole
fd8607302d Bump version number to 7.0.1 2022-07-04 15:07:43 +01:00
Tom Poole
8b399998b4 Bump version number to 7.0.0 2022-06-21 08:38:55 +01:00
reuk
b80f77f8b1
Android: Allow TalkBack borders to be displayed on OpenGL views 2022-06-13 15:29:57 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
reuk
7815d2007b
OpenGL: Set OpenGL view position correctly after adjusting the global scale factor 2022-04-22 14:18:49 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
Tom Poole
111bbc0979 Bump version number to 6.1.6 2022-02-28 12:53:10 +00:00
reuk
45ae98effd
OpenGLContext: Correctly size GL view when using a non-unity global scale 2022-02-23 10:56:12 +00:00
reuk
0223e44ae7
Image: Keep track of contiguous buffer size to avoid heap buffer overflows
In CoreGraphicsPixelData::createImage, image data was copied from a
BitmapData created from the Image passed into the function.

The BitmapData instance didn't keep track of the size of the buffer it
pointed to, so the buffer size was computed by multiplying the
BitmapData height by its line stride. However, if the BitmapData pointed
to a subsection of an image, the `data` pointer might be offset from
the allocated region, and `data + lineStride * height` would point past
the end of the allocated region. Trying to read/copy this range would
cause a heap buffer overflow at the end of the range.

This change adjusts BitmapData so that it keeps track of the size of the
allocated region. Taking a subsection of an image should subtract the
data pointer offset from the size of the allocated region.
2022-02-23 10:56:09 +00:00
reuk
d3c4017685
OpenGLContext: Only create and use a VAO in contexts using the core profile 2022-02-18 16:43:27 +00:00
reuk
e367393a99
OpenGL: Use a core profile when OpenGL 3.2 is requested on Windows
This mirrors the behaviour on macOS.
2022-02-18 16:43:27 +00:00
reuk
199885baa8
OpenGL: Avoid deprecated function when querying available extensions
In OpenGL 3 and up, GL_EXTENSIONS is deprecated as an argument of
glGetString and glGetStringi should be used instead.
2022-02-18 16:43:27 +00:00
reuk
01e71bc351
OpenGL: Avoid races on viewportArea and scale data members 2022-01-27 18:43:22 +00:00
reuk
e751a5edd7
OpenGL: Avoid race on minSwapTimeMs 2022-01-27 18:43:22 +00:00
Tom Poole
3c03693d07 Bump version number to 6.1.5 2022-01-26 13:00:05 +00:00
ed
6eac100a79 macOS Accessibility: Pass through accessibility hit test to accessible view in MouseForwardingNSOpenGLViewClass 2021-12-21 15:36:36 +00:00
Tom Poole
8a6e1980d0 Bump version number to 6.1.4 2021-12-20 11:06:15 +00:00
reuk
1ff05d3333
OpenGL: Avoid querying the native view hierarchy from a background thread on macOS 2021-12-15 14:14:07 +00:00
reuk
48c6087faf Thread: Update macOS thread priority calculation
The Apple threading documentation [^1] says the following:

> The second argument to pthread_setschedparam is the desired policy,
  which can currently be one of SCHED_FIFO (first in, first out),
  SCHED_RR (round-robin), or SCHED_OTHER. The SCHED_OTHER policy is
  generally used for extra policies that are specific to a given
  operating system, and should thus be avoided when writing portable
  code.

This appears to differ from the policy semantics on Linux and BSD, where
FIFO and RR are both explicitly real-time policies.

Therefore, on Linux/BSD we only enable the RR policy if the requested
priority is 8 or higher. Meanwhile, on macOS, we map all thread
priorities (0 - 10) onto the RR policy with an appropriate priority.

[^1]: https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/scheduler/scheduler.html
2021-12-14 22:50:09 +00:00
reuk
44404508fe Bump version number to 6.1.3 2021-12-08 15:26:08 +00:00
ed
b620bf1d43 Windows: Use compatibility profile when creating 3.2 context to allow deprecated function use 2021-12-06 14:27:01 +00:00
ed
e52582a561 Windows: Create OpenGL 3.2 context when specified (not 3.3) 2021-12-06 14:27:01 +00:00
ed
9867ee5c30 Whitespace 2021-12-06 14:27:01 +00:00
ed
2224bb9760 Windows: Recreate OpenGL context if pixel format changes 2021-12-03 12:26:13 +00:00
reuk
c5c9f080d3
OpenGL: Ensure context is initially drawn with correct scale on macOS 2021-12-03 10:15:51 +00:00
reuk
ea8b0a2d32
OpenGL: Ensure that GL views display at the correct scale on macOS 12
Previously, we were using the window's top-left position to determine
the scale to use for the OpenGLContext. However, on macOS the
backingScaleFactor of the window is not strictly related to the top-left
corner of the window, so the OpenGL view's scale could end up differing
from the backing scale factor when slowly moving a window between
displays with different backing scale factors.

On macOS, we now use the backing scale factor of the window's screen (as
maintained by AppKit), rather than trying to work out the correct
display and scale ourselves.
2021-12-01 15:44:07 +00:00
ed
4471efd1c5 Windows: Allow OpenGL 3.3 core profile context 2021-11-30 17:07:49 +00:00