Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upPropagate errors when initializing WebRender instead of panicking #768
Conversation
|
|
| } | ||
|
|
||
| Ok(()) |
This comment has been minimized.
This comment has been minimized.
kvark
Jan 26, 2017
Member
similarly with shader compiling, we should still print out warnings on the successful builds too
|
|
||
| match (vs_id, fs_id) { | ||
| (Some(vs_id), None) => { | ||
| (Ok(vs_id), Err(e)) => { | ||
| println!("FAILED to load fs - falling back to previous!"); |
This comment has been minimized.
This comment has been minimized.
kvark
Jan 26, 2017
Member
I don't think failing back to a previous shader is a good idea, especially if we get in a partial state where, for example, the FS is new and the VS is old.
It would be much nicer to do this idiomatically, as in - let vs_id = try!(Device::compile_shader(..)); without the need to do this match afterwards.
| Thread(std::io::Error), | ||
| } | ||
|
|
||
| impl std::convert::From<ShaderError> for InitError { |
This comment has been minimized.
This comment has been minimized.
kvark
Jan 26, 2017
Member
I don't think you need the full path here: std::convert::From should be in prelude already
| @@ -1006,59 +1058,59 @@ impl Renderer { | |||
|
|
|||
| let (data, marker, shader) = match &batch.data { | |||
| &PrimitiveBatchData::CacheImage(ref data) => { | |||
| let shader = self.ps_cache_image.get(&mut self.device, transform_kind); | |||
| let shader = self.ps_cache_image.get(&mut self.device, transform_kind).unwrap(); | |||
This comment has been minimized.
This comment has been minimized.
kvark
Jan 26, 2017
Member
we could get away without uwnrap-ping in each match arm by doing it after the match
|
|
|
Needs rebasing. |
|
@bors-servo r=kvark |
|
|
Propagate errors when initializing WebRender instead of panicking First step towards proper error handing in WebRender. This patch focuses on making the initialization of the Renderer fallible. This is important in order to let Gecko be able to catch potential errors and fallback to a different rendering backend. r? @kvark <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/768) <!-- Reviewable:end -->
|
Merging manually, as bors seems stuck, but travis / appveyor have passed. |
nical commentedJan 23, 2017
•
edited by larsbergstrom
First step towards proper error handing in WebRender. This patch focuses on making the initialization of the Renderer fallible. This is important in order to let Gecko be able to catch potential errors and fallback to a different rendering backend.
r? @kvark
This change is