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

Red screen on launch #26356

Open
camelid opened this issue Apr 29, 2020 · 16 comments
Open

Red screen on launch #26356

camelid opened this issue Apr 29, 2020 · 16 comments

Comments

@camelid
Copy link
Contributor

@camelid camelid commented Apr 29, 2020

For every site, when I load it, a red screen is shown for several seconds. (Same with local test HTML files.)

Here's what it looks like:

servo red screen on startup

@jdm thinks this is because of #25853 and at some point the OpenGL surface is cleared to red.

@camelid
Copy link
Contributor Author

@camelid camelid commented Apr 30, 2020

Could this line where we set clear_color in RendererOptions be related to the issue? It's set to None, and perhaps when it's later used the default in OpenGL is red.

clear_color: None,

@camelid
Copy link
Contributor Author

@camelid camelid commented Apr 30, 2020

Nope. I tried changing it to ColorF::WHITE, but I still got the red screen.

@camelid
Copy link
Contributor Author

@camelid camelid commented Apr 30, 2020

@jdm Do you think this is an issue with Servo or with WebRender?

@jdm
Copy link
Member

@jdm jdm commented Apr 30, 2020

I'm pretty sure it's an issue with Servo.

@camelid
Copy link
Contributor Author

@camelid camelid commented Apr 30, 2020

Okay, thanks. I've been looking through the code in this repo and in surfman's, but I'm having trouble finding where surfaces are created. Could you point me to the spot(s) in Servo where they're created? Thanks!

@jdm
Copy link
Member

@jdm jdm commented Apr 30, 2020

https://github.com/servo/servo/blob/master/components/webrender_surfman/lib.rs#L56 is called from

// Initialize surfman
let connection = Connection::from_winit_window(&winit_window).expect("Failed to create connection");
let adapter = connection.create_adapter().expect("Failed to create adapter");
let native_widget = connection
.create_native_widget_from_winit_window(&winit_window)
.expect("Failed to create native widget");
let surface_type = SurfaceType::Widget { native_widget };
let webrender_surfman = WebrenderSurfman::create(
&connection,
&adapter,
surface_type,
).expect("Failed to create WR surfman");
.

@camelid
Copy link
Contributor Author

@camelid camelid commented Apr 30, 2020

Cool, thanks!

@Darkspirit
Copy link
Contributor

@Darkspirit Darkspirit commented Apr 30, 2020

Maybe related to #26353.

@camelid
Copy link
Contributor Author

@camelid camelid commented Apr 30, 2020

Although it seems in that one that nothing ever rendered, whereas this issue is that on startup there's a red screen and then the page is rendered.

@camelid
Copy link
Contributor Author

@camelid camelid commented May 2, 2020

Tried adding the code from

https://github.com/servo/servo/blame/9dbc6554f087ca3675104fb1bac45b0c442a0158/ports/glutin/headed_window.rs#L191-L193

to

at @asajeffrey's recommendation, but still the red screen.

EDIT: GitHub doesn't seem to render two snippets in the same comment, so here's the first snippet copied-and-pasted:

        gl.clear_color(0.6, 0.6, 0.6, 1.0);
        gl.clear(gl::COLOR_BUFFER_BIT);
        gl.finish();
@camelid
Copy link
Contributor Author

@camelid camelid commented May 10, 2020

@jdm is this an issue only on macOS or on Linux/Windows too?

@atouchet
Copy link
Contributor

@atouchet atouchet commented May 11, 2020

I do not see this issue using Windows 10.

@camelid
Copy link
Contributor Author

@camelid camelid commented May 11, 2020

Huh, interesting. Thanks for the info!

@asajeffrey Perhaps this is an issue with surfman's platform-specific APIs then?

@camelid
Copy link
Contributor Author

@camelid camelid commented May 11, 2020

I just tried a prebuilt Servo binary on my Ubuntu VM and it worked fine without the red screen.

@camelid
Copy link
Contributor Author

@camelid camelid commented May 13, 2020

Likely an issue with the platform specific background code, e.g. surfman, winit. Needs more experimentation.

@camelid
Copy link
Contributor Author

@camelid camelid commented Jun 5, 2020

I tried running the chaos_game example in surfman, but no red screen - it worked fine.

I'm guessing the red screen is either caused by winit or the way servo calls winit or surfman.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.