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 upIssue 23009/separate angle and disable vsync #24525
Conversation
|
I like these changes, and I appreciate the care you have taken in describing your reasoning for them! I think moving the disable-vsync flag to be a non-debug option is fine in this case. I've found several other flags that are glutin-only that we can convert as well: device_pixels_per_px, clean_shutdown, use_msaa, and no_native_titlebar. |
|
I extracted servo/components/constellation/pipeline.rs Line 612 in dc8be8f |
|
We can file a followup to remove the use from constellation by passing it as an argument to the constructor instead, if you'd like. |
|
This looks great! |
We can definitely make that change in this PR. However, I suspect that's going to force a modification of |
|
libservo isn't published anywhere so we don't need to follow any semver rules. |
| @@ -159,6 +158,7 @@ pub fn init( | |||
| gl: Rc<dyn gl::Gl>, | |||
| waker: Box<dyn EventLoopWaker>, | |||
| callbacks: Box<dyn HostTrait>, | |||
| device_pixels_per_px: Option<f32>, | |||
This comment has been minimized.
This comment has been minimized.
jdm
Oct 26, 2019
Member
This will require updating
servo/ports/libmlservo/src/lib.rs
Line 193 in 6a54d60
servo/ports/libsimpleservo/jniapi/src/lib.rs
Line 117 in 6a54d60
servo/ports/libsimpleservo/capi/src/lib.rs
Line 320 in 6a54d60
However, I just noticed
servo/ports/libsimpleservo/api/src/lib.rs
Line 49 in 6a54d60
init method.
This comment has been minimized.
This comment has been minimized.
0e72bba
to
bf47d85
|
@bors-servo r+ |
|
|
Thank you for your guidance. It was fun! |
…sync, r=jdm Issue 23009/separate angle and disable vsync The `--angle` and `--disable-vsync` options were declared as global options, but only used in the Glutin embedding for desktop builds. Moving them to the Glutin embedding code makes them easier to update in the future. I modified `opts::from_cmdline_args` to accept a `getopts::Options` (as prescribed in the issue) and augmented `opts::ArgumentParsingResult` to include an `opts::Matches` and `content-process` String when appropriate. I could use some feedback on this last bit. I could have changed the function to return `opts::Matches` and have the embedding code look for the presence of `content-process`, but I felt that the approach I went with was closer to the original design. The other aspect I'm not sure about is moving `disable-vsync` from a global debug option to a plain embedder option. This changes the command line interface for glutin, which is maybe bad. However I wasn't sure whether it was worth preserving the original behavior given the complexity of injecting debug options into `opts::from_cmdline_args`. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes partially fix #23009 – there are 2 more options to deal with, but I'm not sure if we should handle them yet. - [x] These changes do not require tests because this is a refactoring and I'm hoping that the existing tests cover these changes. r? @jdm
|
|
Looks like these errors are caused by me failing to update some things in |
|
@glowe I guess you're using macOS? maybe it's easier to fix them and push to the PR and ask homu to try error[E0433]: failed to resolve: use of undeclared type or module `Options`
--> ports/libsimpleservo/api/src/lib.rs:173:33
|
173 | opts::from_cmdline_args(Options::new(), &args);
| ^^^^^^^ use of undeclared type or module `Options`
error[E0061]: this function takes 3 parameters but 2 parameters were supplied
--> ports/libsimpleservo/api/src/lib.rs:207:17
|
207 | let servo = Servo::new(embedder_callbacks, window_callbacks.clone());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 parameters
error: aborting due to 2 previous errors |
|
|
Removed opts::get() access for the two glutin specific options: angle and disable-vsync. This is the first step in a refactoring to separate these two options from the global options.
bf47d85
to
a3f9130
This is also an embedder specific option, so removing it from the global options makes sense.
ab4b53e
to
0ee3004
|
Thanks for the help again. I believe I've addressed the libsimpleservo build errors. |
|
@bors-servo r+ |
|
|
…sync, r=jdm Issue 23009/separate angle and disable vsync The `--angle` and `--disable-vsync` options were declared as global options, but only used in the Glutin embedding for desktop builds. Moving them to the Glutin embedding code makes them easier to update in the future. I modified `opts::from_cmdline_args` to accept a `getopts::Options` (as prescribed in the issue) and augmented `opts::ArgumentParsingResult` to include an `opts::Matches` and `content-process` String when appropriate. I could use some feedback on this last bit. I could have changed the function to return `opts::Matches` and have the embedding code look for the presence of `content-process`, but I felt that the approach I went with was closer to the original design. The other aspect I'm not sure about is moving `disable-vsync` from a global debug option to a plain embedder option. This changes the command line interface for glutin, which is maybe bad. However I wasn't sure whether it was worth preserving the original behavior given the complexity of injecting debug options into `opts::from_cmdline_args`. - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes partially fix #23009 – there are 2 more options to deal with, but I'm not sure if we should handle them yet. - [x] These changes do not require tests because this is a refactoring and I'm hoping that the existing tests cover these changes. r? @jdm
|
|
glowe commentedOct 23, 2019
•
edited
The
--angleand--disable-vsyncoptions were declared as global options, but only used in the Glutin embedding for desktop builds. Moving them to the Glutin embedding code makes them easier to update in the future.I modified
opts::from_cmdline_argsto accept agetopts::Options(as prescribed in the issue) and augmentedopts::ArgumentParsingResultto include anopts::Matchesandcontent-processString when appropriate. I could use some feedback on this last bit. I could have changed the function to returnopts::Matchesand have the embedding code look for the presence ofcontent-process, but I felt that the approach I went with was closer to the original design.The other aspect I'm not sure about is moving
disable-vsyncfrom a global debug option to a plain embedder option. This changes the command line interface for glutin, which is maybe bad. However I wasn't sure whether it was worth preserving the original behavior given the complexity of injecting debug options intoopts::from_cmdline_args../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsr? @jdm