mirror of
https://github.com/servo/servo.git
synced 2025-10-01 00:59:15 +01:00
Add debug option to disable vsync for profiling.
This commit is contained in:
parent
0f72049363
commit
6c8905126f
2 changed files with 26 additions and 11 deletions
|
@ -86,17 +86,21 @@ impl Window {
|
|||
pub fn new(is_foreground: bool,
|
||||
window_size: TypedSize2D<DevicePixel, u32>,
|
||||
parent: Option<glutin::WindowID>) -> Rc<Window> {
|
||||
let mut glutin_window = glutin::WindowBuilder::new()
|
||||
.with_title("Servo".to_string())
|
||||
.with_decorations(!opts::get().no_native_titlebar)
|
||||
.with_vsync()
|
||||
.with_dimensions(window_size.to_untyped().width, window_size.to_untyped().height)
|
||||
.with_gl(Window::gl_version())
|
||||
.with_visibility(is_foreground)
|
||||
.with_parent(parent)
|
||||
.with_multitouch()
|
||||
.build()
|
||||
.unwrap();
|
||||
let width = window_size.to_untyped().width;
|
||||
let height = window_size.to_untyped().height;
|
||||
let mut builder = glutin::WindowBuilder::new().with_title("Servo".to_string())
|
||||
.with_decorations(!opts::get().no_native_titlebar)
|
||||
.with_dimensions(width, height)
|
||||
.with_gl(Window::gl_version())
|
||||
.with_visibility(is_foreground)
|
||||
.with_parent(parent)
|
||||
.with_multitouch();
|
||||
|
||||
if opts::get().enable_vsync {
|
||||
builder = builder.with_vsync();
|
||||
}
|
||||
|
||||
let mut glutin_window = builder.build().unwrap();
|
||||
|
||||
unsafe { glutin_window.make_current().expect("Failed to make context current!") }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue