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

Linux Drawing Errors #513

Closed
baconpaul opened this issue Feb 6, 2019 · 8 comments · Fixed by #529
Closed

Linux Drawing Errors #513

baconpaul opened this issue Feb 6, 2019 · 8 comments · Fixed by #529
Labels
Linux Issues which only occur on Linux UI Issues related to UI look&feel

Comments

@baconpaul
Copy link
Collaborator

The CHSwitches are very eager to disappear. This is code in src/common/gui/CHSwitch2.cpp and .h mostly. Haven't debugged at all yet.

linux_draw_one

OS:

paul@ubuntu:~/surge$ uname -a
Linux ubuntu 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Host:

 ~/Carla_2.0-RC3-linux64/carla/carla-bridge-native vst2 ./target/vst2/Release/Surge.so '(none)' '0'
@baconpaul baconpaul added UI Issues related to UI look&feel Linux Issues which only occur on Linux labels Feb 6, 2019
@baconpaul baconpaul changed the title Linux drawing of CHSwitches doesn't work well Linux Drawing Errors Feb 6, 2019
@baconpaul
Copy link
Collaborator Author

linux_draw_two

Another CHSwitch one. This time when you pick "random" (which basically moves the bitmap to the last selected and crops) it blanks out the area above.

This makes me think that the drawing crop rectangles in CBitmap::draw are not being properly respected but there could be other causes.

@baconpaul
Copy link
Collaborator Author

Using the modulators basically blows away the UI. This is what happens when I double click on LFO2 to start modulating

linux_draw_three

@baconpaul
Copy link
Collaborator Author

Lots of other examples too. Like if you zoom after double click you end up getting much but not all of the UI restored; and if you tab (to end the modulation) then zoom you get almost all of it back.

I think this is all the same problem. But it is a pretty big one. Do you guys see the same in your builds?

@baconpaul
Copy link
Collaborator Author

So this ends up after all the stuff in vstgui/lib/platform/linux/cairocontext.cpp where there's a bunch of translate and clip code.

The way surge works is all the graphics have all the states stacked (usually) vertically. Look at any of the bitmap assets. Then when you click it moves the pan and clips the image.

So if that cairo clip code is off it could easily draw over big swaths of the UI.

I don't know cairo at all. But just for whomever ends up looking.

Could be something else of course!

@falkTX
Copy link
Contributor

falkTX commented Feb 6, 2019

moving any slider causes the same issue.
I guess it is all related...

@baconpaul
Copy link
Collaborator Author

Yeah the sliders are also Trane!ated and clipped since they change color based on state

@baconpaul
Copy link
Collaborator Author

I have identified what causes this problem and have a fix which is local to the surge code, even though I think somewhere vstgui is incorrect still.

PR forthcoming with explanation.

baconpaul added a commit to baconpaul/surge that referenced this issue Feb 7, 2019
Linux drawing was mis-rendering terribly. Turns out this was
because, for some reason, the inbound alpha to bitmap::draw
was 255, not 1.0f, and cairocontext.cpp has a branch decision
based on equality with 1.0f. This indicates there may still be
a problem in vstgui (why was the 255 inbound?) but an interim
fix on linux is to reset alpha=255 to alpha=1.0 which completely
fixes the painting issues reported in surge-synthesizer#513

Closes surge-synthesizer#513 - Linux Painting Issues
@baconpaul
Copy link
Collaborator Author

OK Pull Request in. @jsakkine or @falkTX your quick scan appreciated. It is a one line change to work around a bug but want to make sure the comment is clear enough. Thank you.

Gotta say, with this fix in place surge on linux feels basically like surge on windows or surge on mac.

Turning to mis-positioned menu next.

baconpaul added a commit that referenced this issue Feb 7, 2019
Linux drawing was mis-rendering terribly. Turns out this was
because, for some reason, the inbound alpha to bitmap::draw
was 255, not 1.0f, and cairocontext.cpp has a branch decision
based on equality with 1.0f. This indicates there may still be
a problem in vstgui (why was the 255 inbound?) but an interim
fix on linux is to reset alpha=255 to alpha=1.0 which completely
fixes the painting issues reported in #513

Closes #513 - Linux Painting Issues
baconpaul added a commit to baconpaul/surge that referenced this issue Jul 10, 2019
Linux drawing was mis-rendering terribly. Turns out this was
because, for some reason, the inbound alpha to bitmap::draw
was 255, not 1.0f, and cairocontext.cpp has a branch decision
based on equality with 1.0f. This indicates there may still be
a problem in vstgui (why was the 255 inbound?) but an interim
fix on linux is to reset alpha=255 to alpha=1.0 which completely
fixes the painting issues reported in surge-synthesizer#513

Closes surge-synthesizer#513 - Linux Painting Issues

Former-commit-id: a3887eef160a399ff54ef7824c7a7dc69b56c298 [formerly 7ba3a88]
Former-commit-id: c29601ec73433bf46468733fac2c3b4432391e2b
Former-commit-id: 76617bba2aed60f0c164d332c4cff97c8afd2d14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux Issues which only occur on Linux UI Issues related to UI look&feel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants