-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Created initial abstract renderers #2455
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…bstract-renderers
3 tasks
I put this on the list of relevant PRs on the Architecture discussion
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview: What does this pull request change?
The purpose of this PR is an initial refactor of the renderer and scene. The main goals were to remove circular dependencies between scene, renderer and scene_file_writer, and to make scene agnostic to the type of renderer used. There is still a lot more refactoring and improvements to still do beyond this, but those first few goals already created quite a large PR so anything else now related to these I think should be outside the scope of this PR.
scene
,renderer
andscene_file_writer
Motivation and Explanation: Why and how do your changes improve the library?
The goals of this PR are
To make scene agnostic to the renderers. Currently scene needs to know if the renderer is opengl or cairo. This PR allows scene to treat both renderers (and any future renderers) the same.
To untangle the dependencies between scene <-> renderer and renderer <-> scene_file_writer. This avoids circular dependencies that adds complexity, makes the flow more difficult to follow and improves the decoupling of components. The scene now has access to a renderer and a scene_file_writer. The renderer does not need to be aware of the scene or the file_writer. The few cases where the renderer uses a file_writer it is passed as a parameter from the scene.
To create an initial abstract renderer that can be applied to cairo and opengl. This is not meant to be what the final abstract renderer will look like, it was simply to extract what the common methods currently are. Finding the final abstract renderers will involve making improvements to the renderers themselves and this is outside the scope of this PR.
Things that are outside the scope of this PR:
In doing this a lot has moved about, such as renderer-specific logic to the renderers, and common logic to the scene, but the goal was to try and not change any behaviour.
Links to added or changed documentation pages
Further Information and Comments
This likely will not be merged to the main branch but will be targetting a new branch as part of the refactor.
It is a bit behind main, I will rebase to main once we are ready to start merging these kind of changes, but I thought I would open a draft for people to begin looking at it.
Most of the tests are passing. There are a four graphical unit tests not passing, I am not sure if this is due to an error in this PR, but I didn't think that it was. They are failing because the last frame in this PR is showing the scene, however in the stored test data the last frame is an empty scene. An example of one of the tests that fail is
I don't see from this scene why the last frame should be an empty scene?
The below tests fail:
FAILED tests/test_graphical_units/test_opengl.py::test_Circle - AssertionError:
FAILED tests/test_graphical_units/test_geometry.py::test_ZIndex - AssertionError:
FAILED tests/test_graphical_units/test_indication.py::test_FocusOn - AssertionError:
FAILED tests/test_graphical_units/test_indication.py::test_Flash - AssertionError:
FAILED tests/test_graphical_units/test_indication.py::test_ShowPassingFlash - AssertionError:
Reviewer Checklist