mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AudioProcessorEditor: Add method to configure layer-backedness of plugin editors
This commit is contained in:
parent
3b2c6a545e
commit
926bbda4fa
2 changed files with 29 additions and 0 deletions
|
|
@ -225,4 +225,16 @@ ComponentPeer* AudioProcessorEditor::createNewPeer ([[maybe_unused]] int styleFl
|
|||
return Component::createNewPeer (styleFlags, nativeWindow);
|
||||
}
|
||||
|
||||
bool AudioProcessorEditor::wantsLayerBackedView() const
|
||||
{
|
||||
#if JUCE_MODULE_AVAILABLE_juce_opengl && JUCE_MAC
|
||||
if (@available (macOS 10.14, *))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace juce
|
||||
|
|
|
|||
|
|
@ -206,6 +206,23 @@ public:
|
|||
*/
|
||||
std::unique_ptr<ResizableCornerComponent> resizableCorner;
|
||||
|
||||
/** The plugin wrapper will call this function to decide whether to use a layer-backed view to
|
||||
host the editor on macOS and iOS.
|
||||
|
||||
Layer-backed views generally provide better performance, and are recommended in most
|
||||
situations. However, on older macOS versions (confirmed on 10.12 and 10.13), displaying an
|
||||
OpenGL context inside a layer-backed view can lead to deadlocks, so it is recommended to
|
||||
avoid layer-backed views when using OpenGL on these OS versions.
|
||||
|
||||
The default behaviour of this function is to return false if and only if the juce_opengl
|
||||
module is present and the current platform is macOS 10.13 or earlier.
|
||||
|
||||
You may want to override this behaviour if your plugin has an option to enable and disable
|
||||
OpenGL rendering. If you know your plugin editor will never use OpenGL rendering, you can
|
||||
set this function to return true in all situations.
|
||||
*/
|
||||
virtual bool wantsLayerBackedView() const;
|
||||
|
||||
private:
|
||||
//==============================================================================
|
||||
struct AudioProcessorEditorListener : public ComponentListener
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue