-
-
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
feat: improve screen rendering framework #13737
feat: improve screen rendering framework #13737
Conversation
src/controllers/scripting/legacy/controllerscriptinterfacelegacy.cpp
Outdated
Show resolved
Hide resolved
src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp
Outdated
Show resolved
Hide resolved
c6fd897
to
99fed94
Compare
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.
only remaining complaint from me tbh
src/controllers/scripting/legacy/controllerscriptenginelegacy.h
Outdated
Show resolved
Hide resolved
f114197
to
9b2aafa
Compare
src/controllers/scripting/legacy/controllerscriptenginelegacy.cpp
Outdated
Show resolved
Hide resolved
#ifdef MIXXX_USE_QML | ||
m_rootItems.clear(); | ||
#endif |
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.
does it work without the explicit .clear()
? Ideally RAII would take care of this fully by itself.
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 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
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.
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); |
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 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.
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 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.
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.
yeah I'm just worried about forgetting about it. But you're right, lets postpone for now.
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.
LGTM. Thank you for the cleanup. Please rebase.
c192b8a
to
533cedb
Compare
Merge? |
yup, sorry. I've been busy until now. |
This is a refactor largely inspired from the work in #13459 to simplify the hook system used for screen rendering.