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

feat: improve screen rendering framework #13737

Merged

Conversation

acolombier
Copy link
Member

This is a refactor largely inspired from the work in #13459 to simplify the hook system used for screen rendering.

src/controllers/controller.h Outdated Show resolved Hide resolved
src/test/controllerscriptenginelegacy_test.cpp Outdated Show resolved Hide resolved
src/qml/qmlmixxxcontroller.h Outdated Show resolved Hide resolved
src/qml/qmlmixxxcontroller.h Outdated Show resolved Hide resolved
@acolombier acolombier mentioned this pull request Oct 16, 2024
2 tasks
@acolombier acolombier force-pushed the feat/improve-screen-rendering-framework branch from c6fd897 to 99fed94 Compare October 17, 2024 00:33
Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only remaining complaint from me tbh

@acolombier acolombier force-pushed the feat/improve-screen-rendering-framework branch from f114197 to 9b2aafa Compare October 20, 2024 00:28
Comment on lines +61 to +63
#ifdef MIXXX_USE_QML
m_rootItems.clear();
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it work without the explicit .clear()? Ideally RAII would take care of this fully by itself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will probably work, but I preferred to make it explicit so if something was to crash when deallocating the screen, it still happens as part of the test hooks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense. It was more of a general question whether this would be needed in production code.

@@ -943,7 +813,7 @@ std::shared_ptr<QQuickItem> ControllerScriptEngineLegacy::loadQMLFile(
rootItem->setHeight(pScreen->quickWindow()->height());
}

return rootItem;
return std::unique_ptr<mixxx::qml::QmlMixxxControllerScreen>(rootItem);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in order to truly benefit from resource safety here, the unique_ptr wrapping needs to be done on the return value of qmlComponent.createWithInitialProperties (directly in the same statement) (potentially after a qobject_cast). I don't want to force you to do it, but I don't have the time right now. If you're up for it, feel free to do it now and if not, remind me on sunday and I will file a PR against your branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did try to give this a go but could not get around doing the dynamic_cast for the unique_ptr. Are you happy to address that as a follow up PR? I know you are busy lately, so I wouldn't want to add too much to your todolist, but also keen to close that PR ASAP to move forward with S4 Mk3 if we want it to hit the 2.6 deadline.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I'm just worried about forgetting about it. But you're right, lets postpone for now.

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you for the cleanup. Please rebase.

@acolombier acolombier force-pushed the feat/improve-screen-rendering-framework branch from c192b8a to 533cedb Compare October 21, 2024 22:46
@acolombier
Copy link
Member Author

Merge?

@Swiftb0y
Copy link
Member

yup, sorry. I've been busy until now.

@Swiftb0y Swiftb0y merged commit 701a6ec into mixxxdj:main Oct 27, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants