Hi there,
I have been trying out the new Direct2D backend quite a lot lately, and was really impressed at the performance and integration within the Juce framework. @matt did a fantastic job there!
Now the performance is on par with the current Mac renderer, if not better.
The main thing I focused on, and did a lot of reports about, is the behavior when scaling the UI (AffineTransform::scale). This is the preferred method when resizing vectorial UIs, and it makes a lot of sense too with fast renderers (no need to buffer to images, path and gradients are cached, etc.).
The current Direct2D branch still has some issues when dealing with scaled int rectangles, but I assume most of them will be solved by the time JUCE 8 is released. I will focus on the behavior of the openGL and software renderers as I assume this is the current “behavioral” model for the direct2D one in this regard.
So, even with the openGL or software renders there is still a visible difference between float and int rectangles: float rectangles are much more consistent and stable (edges are less bouncy) when changing scale (especially visible with small scales), and as a consequence fine margins between adjacent rectangles stay visible much longer when scaled down compared to int rectangles. You also get inconsistencies when mixing int and float rectangles (unaligned edges a certain scales, etc.).
This situation also affect components, which bounds are always int rectangles. You can fill them with a float rectangle rather than an int one (or a simple fillAll) to get that same improved consistency with low scales, but that is only an option for custom components of course.
Now, on MacOS the situation is different with the default renderer: both int and float rectangles (with the same round values, of course) do behave exactly the same when changing scale, and the same goes for components. In fact they behave like float rectangles do on Windows: they are extremely well behaved and the UI seems locked-in down to the smallest possible scale. This is very impressive and feels nice (which is important for user experience).
Switching the openGL on MacOS gives the exact same behavior as the openGL and software renderer on Windows, with the int vs float difference becoming obvious again, and the UI becoming more bouncy when changing scale.
So here is my proposal:
Please make the Direct2D renderer behave like the MacOS one, ensuring that int rectangles (and components bounds) behave the same as float ones of the same values.
For one thing this would improve consistency between MacOS and Windows, improve scaling stability, and also get rid of many tiny inconsistencies you get when mixing int and float rectangles with a scaled UI.
I think JUCE 8 is the perfect opportunity for this kind of change: keeping the Windows software (and openGL) renderer unchanged would ensure that the rendering (both in terms of look and performance) could stay unchanged compared to JUCE 7 by sticking with it. On the other hand the (default) direct2D renderer would behave much closer to the MacOS one, both in terms of performance and (more importantly) look.
That would be a move for the best for IMHO, and a major version combined with a new renderer is a golden opportunity to take the plunge.
So in short, I believe the Direct2D renderer should use the MacOS renderer as a model, not the current Windows software one.