Skip to content

Don't use QStylePainter in WSpinny. lp:1530720#1994

Merged
daschuer merged 2 commits into
mixxxdj:2.2from
rryan:2.2-stylepainter
Jan 24, 2019
Merged

Don't use QStylePainter in WSpinny. lp:1530720#1994
daschuer merged 2 commits into
mixxxdj:2.2from
rryan:2.2-stylepainter

Conversation

@rryan
Copy link
Copy Markdown
Member

@rryan rryan commented Jan 13, 2019

Cherry-picked from #1974, since I forgot about https://bugs.launchpad.net/bugs/1530720.

When I originally filed the bug, it only printed QMacCGContext:: Unsupported painter devtype type 1 once, now it is quite spammy. I haven't tested whether the performance improvement in #1974 also applies to QGLWidget.

Using a QStylePainter on any QOpenGLWidget seems to introduce up to
a 10x rendering slowdown for all QOpenGLWidgets. We should probably
figure out how to style WSpinny without QSS to realize this savings.

Using a QStylePainter on *any* QOpenGLWidget seems to introduce up to
a 10x rendering slowdown for *all* QOpenGLWidgets. We should probably
figure out how to style WSpinny without QSS to realize this savings.
@rryan
Copy link
Copy Markdown
Member Author

rryan commented Jan 19, 2019

The mac Travis failure is unrelated.

@rryan
Copy link
Copy Markdown
Member Author

rryan commented Jan 19, 2019

These are the two places I found that style WSpinny:

LateNight:

WSpinny {/*
  This produces artifacts in spinny bg
  background-color: rgba(1, 1, 1, 10);
  This makes no difference, the spinny loads some default grey bg
  background: none;*/
}

Tango:

#SpinnyMini {
  background-color: transparent;
}

I'm not sure that transparency is even an option with QGLWidget. @ronso0, do you know why Tango sets this and whether it actually works?

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Jan 20, 2019

Tango:

#SpinnyMini {
  background-color: transparent;
}

I'm not sure that transparency is even an option with QGLWidget. @ronso0, do you know why Tango sets this and whether it actually works?

It doesn't work, it's probably just a leftover from testing.

If I comment out the spinny background and the spinny mask, it looks like this after skin reload:
spinny-glitch1
when I scratch with the spinny funny stuff happens:
spinny-glitch

@rryan
Copy link
Copy Markdown
Member Author

rryan commented Jan 20, 2019

It doesn't work, it's probably just a leftover from testing.

If I comment out the spinny background and the spinny mask, it looks like this after skin reload:
spinny-glitch1
when I scratch with the spinny funny stuff happens:
spinny-glitch

Thanks -- I think we can safely remove this then.

@rryan
Copy link
Copy Markdown
Member Author

rryan commented Jan 21, 2019

This is a nice CPU usage win for 2.2 on macOS -- with 1 deck playing (4 decks visible), PreviewButtonDelegate disabled, CPU usage with one deck playing drops from ~75% to ~45%.

rryan added a commit to rryan/mixxx that referenced this pull request Jan 22, 2019
… Launchpad Bug #1812763

After upgrading to Qt 5.12, Mixxx idle CPU usage is high (99%) on
macOS. Profiling shows LibraryPreviewDelegate::paintItem as one of the hottest
functions. It appears to be related to calling QPushButton::setGeometry for each
row of the library. My workaround relies on the fact that we only need the
QPushButton size to be correct, not its position.

On macOS 10.13.6, CPU usage drops from 99% to 50% with this change
(and with mixxxdj#1994, idle usage drops to 15%).
@daschuer
Copy link
Copy Markdown
Member

Thank you LGTM

@daschuer daschuer merged commit 42c1b93 into mixxxdj:2.2 Jan 24, 2019
rryan added a commit to rryan/mixxx that referenced this pull request Jan 28, 2019
… Launchpad Bug #1812763

After upgrading to Qt 5.12, Mixxx idle CPU usage is high (99%) on
macOS. Profiling shows LibraryPreviewDelegate::paintItem as one of the hottest
functions. It appears to be related to calling QPushButton::setGeometry for each
row of the library. My workaround relies on the fact that we only need the
QPushButton size to be correct, not its position.

On macOS 10.13.6, CPU usage drops from 99% to 50% with this change
(and with mixxxdj#1994, idle usage drops to 15%).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants