Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences Between GL and Software Renderers #944

Closed
stuartmscott opened this issue May 5, 2020 · 19 comments
Closed

Differences Between GL and Software Renderers #944

stuartmscott opened this issue May 5, 2020 · 19 comments
Labels
question A question has been asked

Comments

@stuartmscott
Copy link
Member

Is your feature request related to a problem? Please describe:

"fyne.io/fyne/internal/widget".BaseRenderer implements BackgroundColor() and returns theme.BackgroundColor().

If an object (eg "fyne.io/fyne/widget".Group) is used in a dialog, its background does not match the dialog background.

Is it possible to construct a solution with the existing API?

There is no easy way to override the background color. One option is to make a custom widget extending Group which uses a different renderer - but this seems like overkill

Describe the solution you'd like to see:

Either baseRenderer should have a transparent background, or there need to be a SetBackgroundColor(color.Color) then BackgroundColor returns that, or if it is not set, return theme.BackgroundColor()

@andydotxyz
Copy link
Member

I'm not sure about this... The dialog should be using backgroundColor, so perhaps there is another issue somewhere. Perhaps you have an image so we can look at what might be wrong in the rendering?

Moving to transparent by default is probably an option nevertheless but I'd like to know if we have an underlying issue.

Adding a SetBackgroundColor to all widgets isn't something we should consider, as widgets should expose only logic/state APIs

@andydotxyz
Copy link
Member

Suggest change of title to "Dialog background is not theme.BackgroundColor"?

@stuartmscott
Copy link
Member Author

I'm using a dialog which on mobile contains a tabber with two tabs (Sign In/Sign Up), and on desktop (with more screen real estate) shows the two pieces of content side-by-side. Here are two screenshots (mobile & desktop) to show the problem that triggered this issue:

Screen Shot 2020-05-06 at 6 53 44 AM

Screen Shot 2020-05-06 at 6 46 15 AM

It looks like dialog (modal popup) has theme.ShadowColor() as its background - which is fine as you'd want the dialog to have a different color than the window, but Group and Tabber use theme.BackgroundColor(). If the default was transparent, I think this issue would be resolved.

@andydotxyz
Copy link
Member

The shadow colour is supposed to be used for the semi-transparent shadow drawn around the modal.
The dialog content background should be bg colour.

@stuartmscott
Copy link
Member Author

Okay, let's use your suggested title for this bug and make dialog background the same as window background, ie. theme.BackgroundColor()

@andydotxyz
Copy link
Member

dialog/base.go:58 seems to indicate we already are, I think there is a more subtle issue

@stuartmscott
Copy link
Member Author

widget/popup.go:253 made me think it was rendering the background with the shadow color

@andydotxyz
Copy link
Member

OK, not a problem. But now it seems we have 2 widgets using background colour but they look different... hmm.
I wonder if my colourspace changes fix this at all? not sure why they would but it is in that area...

@stuartmscott
Copy link
Member Author

It is certainly better, but there is still a colour difference:

Screen Shot 2020-05-06 at 10 26 36 AM

@andydotxyz
Copy link
Member

Hmm. I wonder if that is an artifact in the Gl renderer? if you capture the canvas from a software renderer do you see the same issue?

@stuartmscott
Copy link
Member Author

Attempted in #949

@andydotxyz
Copy link
Member

This is the software renderer version, looks like it might be a GL issue...

dialog_background_group

@stuartmscott
Copy link
Member Author

Here's what I get:

dialog_bg_light
dialog_bg_dark

If the issue is in GL, what's the best way to track it down?

@andydotxyz
Copy link
Member

I'd say that running the app as normal and a lot of screenshots will help.
Use a colour pixel check on the resulting images and compare it to the theme values.

I'd suggest testing once with it as content of the window then another as the content of a dialog and see what changes.

@andydotxyz
Copy link
Member

I think the title is not fitting well now. Probably something about subtle differences in background colours in GL renderer?

@stuartmscott stuartmscott changed the title "fyne.io/fyne/internal/widget".BaseRenderer hardcodes background color Differences Between GL and Software Renderers May 11, 2020
@andydotxyz andydotxyz added this to the 1.3.x milestone May 23, 2020
@andydotxyz
Copy link
Member

I realised today that the software renderer does not support circle or line. I am working on this now

@andydotxyz
Copy link
Member

All graphical types should be supported by the incoming #1141.
I would love to mark this as resolved but I guess the subtle background issues are what caused this to be opened in the first case right @stuartmscott?

In combination with the previous #947 for NRGBA transition this may now be resolved?

@andydotxyz andydotxyz added the question A question has been asked label Jun 30, 2020
@andydotxyz
Copy link
Member

Ping @stuartmscott

@stuartmscott
Copy link
Member Author

This appears to be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question has been asked
Projects
None yet
Development

No branches or pull requests

2 participants