-
Notifications
You must be signed in to change notification settings - Fork 12
Issue 189: Rendering class to handle duplication methods #223
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
base: 2.9.0
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| /** | ||
| * param: (canvas: HTMLCanvasElement, fps?: number) |
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.
@SML-MeSo we did not document the 3rd parameter. Is this intentional
| * param: (canvas: HTMLCanvasElement, fps?: number) | |
| * param: (canvas: HTMLCanvasElement, fps?: number, includeToPool?: boolean) |
| static cleanCanvas(canvas: HTMLCanvasElement) { | ||
| return new Promise(resolve => { | ||
| const match = Render._canvasPool.filter(renObj => renObj['_canvas'] === canvas) | ||
| Render._canvasPool = Render._canvasPool.filter(renObj => renObj['_canvas'] !== canvas) |
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.
Shouldn't we move this inside the if statement? That way we'll be avoiding looping the _canvasPool twice if match's length is 0.
| * scene parameter can be Scene instance, scene index, or scene uid. | ||
| * | ||
| */ | ||
| static renderScene(canvas: HTMLCanvasElement, scene: any) { |
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.
We could also make use of typescript's union. This is not needed, but I thought that I should share it just in case we do something similar in the future.
| static renderScene(canvas: HTMLCanvasElement, scene: any) { | |
| static renderScene(canvas: HTMLCanvasElement, scene: Scene | number | string) { |
| * item parameter can be Item instance, or item id. | ||
| * | ||
| */ | ||
| static renderVideoItem(canvas: HTMLCanvasElement, item: any) { |
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.
Same suggestion as above, use typescript unions instead of any :)
| * source parameter can be Source instance, or source id. | ||
| * | ||
| */ | ||
| static renderVideoSource(canvas: HTMLCanvasElement, source: any) { |
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.
Same suggestion as above, use typescript unions instead of any :)
| */ | ||
| static renderWorkspace(canvas: HTMLCanvasElement) { | ||
| return new Promise((resolve) => { | ||
| const match = Render._canvasPool.filter(renObj => renObj['_canvas'] === canvas) |
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.
nitpicking, double space.
| const match = Render._canvasPool.filter(renObj => renObj['_canvas'] === canvas) | |
| const match = Render._canvasPool.filter(renObj => renObj['_canvas'] === canvas) |
It might also make sense to simply use find instead of filter.
| iRender.initializeCanvas(canvas, Render._canvasCounter, fps).then(() => { | ||
| resolve(true); | ||
| }) | ||
| Render._canvasCounter = Render._canvasCounter + 1; |
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.
Not sure if this is intentional. Do we want to increment the canvas counter only if initializeCanvas successfully resolved?
fixed on: Scene.getItems() Scene.getSources() Source.getAllSources() closes #224
T13929: Provision for setting window params for NewDialog
T13929: Provision for setting window params for NewDialog
implement restoring old configuration from old map id (url)
closes issue-253
- new class Render for rendering methods - internal class Render to handle canvas processes and other calculations
fix: rendering multiple items causes slower fps for every succeeding call fix: render type has the chance to be overwritten by previous or next render calls
… the array with the same index as the canvas - incorrect argument on startStopRender
- handle webGL, whether new or old implementation
No description provided.