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

Fix simple scene rendering #138

Closed
wants to merge 1 commit into from

Conversation

frank-weindel
Copy link
Collaborator

@frank-weindel frank-weindel commented Jan 26, 2024

Simple scenes that do not involve textures, text or any later mutations were not rendering to the canvas. I've tracked this down to a supposed double-buffer issue involing the performance optimization that stops drawing frames when there are no updates in the render tree detected. The Renderer was actually issusing the appropriate WebGL vertices and draw calls for these simple scenes but it seems a second pass at drawing is required in order for the scene to be drawn to the canvas.

This fix simply does an extra draw/raf cycle immediately after it previously drew updates.

I looked at writing a test for this but the behavior is not exhibited when running chromium headlessly.

Fixes #123

Simple scenes that do not involve textures, text or any later mutations were not
rendering to the canvas. I've tracked this down to a supposed double-buffer issue
involing the performance optimization that stops drawing frames when there are
no updates in the render tree detected. The Renderer was actually issusing the
appropriate WebGL vertices and draw calls for these simple scenes but it seems
a second pass at drawing is required in order for the scene to be drawn to
the canvas.

This fix simply does an extra draw/raf cycle immediately after it previously
drew updates.

Fixes #123
Copy link
Contributor

@wouterlucas wouterlucas left a comment

Choose a reason for hiding this comment

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

Smells hacky, there should be no reason for this.

We should check with the wpewebkit team why this is needed.

@frank-weindel
Copy link
Collaborator Author

Smells hacky, there should be no reason for this.

We should check with the wpewebkit team why this is needed.

I will check if this is actually happening on WPE. This is what I'm seeing in Chrome.

@frank-weindel
Copy link
Collaborator Author

@wouterlucas Thanks for questioning it. It indeed was happening on the RPI and I found the actual root cause and a better solution. Closed for #141

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.

Renderer doesn't render anything, unless there is at least 1 text node or a node with a src or texture
3 participants