RFR: 8293478: [java.desktop/macOS] Condense SDRenderType usages in QuartzRenderer.m

Julian Waters jwaters at openjdk.org
Wed Sep 7 18:51:40 UTC 2022


On Mon, 5 Sep 2022 23:41:40 GMT, SWinxy <duke at openjdk.org> wrote:

> The `SDRenderType` enum is often returned using a variable declared at the start of functions. These can be inlined in the `return` itself. Using a ternary operator condenses what may be 12 lines into one, in the most extreme cases. `doRectUsingCG` and `doPolyUsingCG` were both modified more than the rest, but still are equivalent.
> 
> Example change:
> 
> SDRenderType renderType = SD_Nothing;
> 
> if (fill == YES)
> {
>     renderType = SD_Fill;
> }
> else
> {
>     renderType = SD_Stroke;
> }
> 
> // ...
> 
> return renderType;
> 
> 
> 
> // ...
> 
> return fill ? SD_Fill : SD_Stroke;

No problem, but have you checked with the relevant groups about this change yet? If not, I'd recommend doing so before I create the entry for this PR. A MacOS test also seems to be failing, though it doesn't seem to be related to the changes made here

I agree it's a frustrating process, but unfortunately that's how most maintainers prefer to discuss changes. However, I've had enough of waiting, so I'm just crossing my fingers and creating it anyway
https://bugs.openjdk.org/browse/JDK-8293478

-------------

PR: https://git.openjdk.org/jdk/pull/10174



More information about the client-libs-dev mailing list