I sent a PullRequest to your GitHub with the following content:
I found a code that is a performance bottleneck when running on Retina Display with CoreGraphicsRenderer.
Actually, since NSHighResolutionCapable is set to true in Info.plist on Retina compatible applications, CoreGraphics seems to automatically scale internal back buffers by scale factor (factor is x2).
However, as I have seen, I recognize that there is a problem that JUCE side is doing affine transformation (scale multiplication).
I think that this implementation is the cause of the following problems that have been posted by JUCE Forum. Drawing images on MBP Retina is ultra-slow
On the other hand, when using SoftwareRenderer, the above scaling processing is necessary.
Based on the above, I propose an implementation that does not change displayScale value
when using CoreGraphicsRenderer.
This Pull Request dramatically improves graphics performance on retina displays, which has long been an issue.
When this Pull Request is merged, it leads to solving the problem in my project.
Please check.
Just to clarify, the two use cases for the getPhysicalPixelScaleFactor() method are for CachedComponentImages and Graphics::strokePath (which is called a lot).
Iâm hoping this creates some magic speedup but in my preliminary tests thatâs not actually been the case. I think where this will speed things up is in path creation but there will be the same number of pixels actually being pushed around as before.
Iâd been keen to hear others feedback on this as macOS graphics performance has been one of our biggest areas of complaint.
not sure why is that (I donât have the time to look at it further atm, just wanted to report) but some widgets of my plugin are now blurry with that commit.
Most of the UI is perfectly fine, but certain labels/sliders now look just like on non-retina displays.
Thanks @yairadix. @lalala are these just standard JUCE widgets? Iâve created an empty plug-in project with some sliders and buttons, calling setBufferedToImage (true) on some of them but I canât see any difference on a 15-inch retina MacBook Pro running 10.14.3.
@ed95 i also noticed blurry components (Juce standard Labels and Own Buttons) on a component dialog i show with setVisible() inside the plugin without using setBufferedToImage(). Other âdialogsâ seems to work right with the same elements. I will try to find out more when i have some more time. Maybe the components are not aligned to the pixels somehow because of dynamic position calculation. I just donât understand why at the moment, because this should not be an issue on retinas anymoreâŠ
@lalala
I tried according to your report in my environment.
My environment is macOS 10.14 Mojave and DAW is Studio One.
This is a screen shot.
What you can see from this image is as follows
ă»Buffered component is blurred.
ă»Unbuffered component is not blurred (comboboxâs context menu is clear).
If the buffering doesnât take the scaling into account, then it is rendered at 100%, whereas the whole GUI is displayed at 125% (or even 150% or 200%), thus the bitmap gets scaled and looks blurry.
It renders clean again when i comment out the component effect. The effects maybe also use the same code like setBufferedToImage. Not sure. Hope this helps.