Page MenuHome

UI: Rounding the corners of the splash image according to the theme preferences.
ClosedPublic

Authored by Yevgeny Makarov (jenkm) on Feb 14 2020, 10:26 AM.

Details

Summary

Rounding the corners of the splash screen image according to the theme's roundness preference.

The rounding of the splash screen block itself depends on the wcol_menu_back.roundness theme settings, and user can even set it to zero.
So, in this case the splash image rounding will not match the block ones.

This patch allows you to add proper corner rounding when the image is displayed.
It process only the corner part of the image, both corners in one pass, so a small number of operations are performed.

It also makes it easier to create new splash images as there is no need to worry about adding corner rounding.

Splash screen screenshots:

Diff Detail

Repository
rB Blender

Event Timeline

Thanks, but I rather leave this entirely up to the splash designers. There isn't really a need for this to be tweakable, and if the designers want to make a change it makes that harder.

The rounding of the block itself depends on the theme settings, see here D6549 for an example, you can even set it to zero, so the image will not match the block.
You can make the radius fixed for splash screen block, as an alternative.

And just the opposite is easier for the designer, he does not need to worry about rounding it just creates an image without any rounding.

You can commandeer the revision back to fix the author field.

It's been always a headache to get the rounded corners on the splash right (I'm currently using a rounded rectangle mask in the SVG file), having it automatically done would solve it!

@Julian Eisel (Severin), can you look at these splash screen patches? I'm short on time for 2.83.

After D6859 the splash screen should be premultiplied, so maybe some additional changes are needed here.

It would be preferable if it didn't have to manipulate the image buffer, but could let the UI code do texture drawing with round-boxes. That should definitely be doable with shaders.

I looked into this and got it mostly working using the existing drawing code for widget round-boxes, see P1331:


The remaining issue is anti-aliasing, which I didn't get to work nicely using the existing AA methods. A different way to draw the AA would be needed I think.
The nice thing about this is that we can update the corner drawing "on the fly" and it could be used in more places (e.g. file browser thumbnails). Splash screen specific logic would be kept minimal. That said I don't see more notable benefits really, so I'm not sure if it's worth spending more time on.

@Clément Foucault (fclem) do you think it's better/worth to move this to a shader level are is this CPU side approach fine?

@Julian Eisel (Severin) I would prefer this CPU approach as it's more local and way simpler.

Julian Eisel (Severin) updated this revision to Diff 23752.EditedApr 15 2020, 2:29 AM
  • Rebase on top of D6999, required a few fixes
  • Cleanup: Move round-corner logic into own function
  • Premultiply alpha for correct transparency

This works really nice!

I'm going to commit this tomorrow, after D6999.

This revision is now accepted and ready to land.Apr 15 2020, 2:32 AM

Updated image:

source/blender/windowmanager/intern/wm_splash_screen.c
190

this should depend on U.dpi_fac after changes in D6999

Out of curiosity, where did you get the un-rounded version from? Didn't find a link to it myself on a quick search.

source/blender/windowmanager/intern/wm_splash_screen.c
190

Indeed, I actually already changed that and did some final testing :)

Out of curiosity, where did you get the un-rounded version from?

In Photoshop :)

Just clone brush, stamp tool or something.