Skip to content

Conversation

@SML-MeSo
Copy link
Collaborator

No description provided.

@SML-MeSo SML-MeSo closed this Jul 25, 2018
@SML-MeSo SML-MeSo reopened this Jul 25, 2018
@ghost ghost self-requested a review January 16, 2019 13:16
}

/**
* param: (canvas: HTMLCanvasElement, fps?: number)
Copy link

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

Suggested change
* 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)
Copy link

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) {
Copy link

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.

Suggested change
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) {
Copy link

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) {
Copy link

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)
Copy link

Choose a reason for hiding this comment

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

nitpicking, double space.

Suggested change
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;
Copy link

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?

nelson-temporal and others added 19 commits May 28, 2019 22:44
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)
- 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
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.

2 participants