-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WVUMeterGL: fix initial rendering of meters invisble after skin load #11052
Conversation
src/widget/wvumetergl.h
Outdated
bool m_bHasRendered; | ||
// To make sure we render at least N times even when we have no signal, | ||
// for example after showEvent() | ||
int m_iNeedsRender; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name can be improved, sounds like a boolean. We have no rule for an i prefix in Mixxx.
How about m_pendingRendings
It looks like it is a workaround for a first failing rendering. Is it reliable that the first fails and the second succeeds?
Is there any measure we can use to detect a failing attempt? This would allow to go back to the boolean and might be more reliable.
On the other hand there is no harm with this approach if it has been proven to be a solution, except the extra CPU for a pointless first render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it is a workaround for a first failing rendering.
I noticed "// 2 pendings renders, in case we have triple buffering" in one of @m0dB's PRs so I tried this. So the first rendering is not pointless but buffered and just not swapped yet IIUC.
Can we somehow figure if triple-buffering is enabled and use either 1 or 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't found a way (and honestly, the tripple buffering is an assumption, but it's the only explanation I see for what I have been seeing while debugging my QOpenGLWindow based branch). Anyway, the cost of 1 extra render is surely neglectable, so I don't think it's worth the effort.
@ronso0 , I actually used the same solution in my qopengl_renderers branch (so I should have created this PR myself, but I forgot about it!). See https://github.com/m0dB/mixxx/blob/qopengl_renderers/src/widget/wvumetergl.cpp @daschuer I also went for an i prefix, but only because other variables in this class also use it. I don't care either way (I personally would never use type prefixes). I do think that your proposed variable name expresses better it is a counter and not a bool. (In my branch I use the similar name m_iRendersPending) |
c4ea28d
to
d053d42
Compare
@m0dB I adopted some changes from your branch. |
Looks good to me. |
?? |
Alright then, ready for merge. |
Thank you. I can confirm it is working. |
Fixes the initial painting issue with VU meters that are not shown visible after skin loaded.
For example, start LateNight with compact decks, the toggle the mixer: VU meters are black.
@m0dB Please take a look. 2 rendering passes fix it for me, though I'm not sure if this approach is "correct"