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

feat(capture_webrender): write webrender revision into text #20320

Merged
merged 5 commits into from Mar 23, 2018

feat(capture_webrender): write webrender revision into text

  • Loading branch information
kwonoj committed Mar 19, 2018
commit 0671fcb5c7d2a8a0a3178937a55f5b31d452db9c
@@ -24,7 +24,8 @@ use servo_config::opts;
use servo_geometry::{DeviceIndependentPixel, DeviceUintLength};
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::fs::{File, create_dir_all};
use std::io::Write;
use std::rc::Rc;
use std::sync::mpsc::Sender;
use std::time::{Duration, Instant};
@@ -36,6 +37,7 @@ use touch::{TouchHandler, TouchAction};
use webrender;
use webrender_api::{self, DeviceIntPoint, DevicePoint, DeviceUintRect, DeviceUintSize, HitTestFlags, HitTestResult};
use webrender_api::{LayoutVector2D, ScrollEventPhase, ScrollLocation};
use webrender_revision::REVISION;
use windowing::{self, MouseWindowEvent, WebRenderDebugOption, WindowMethods};

#[derive(Debug, PartialEq)]
@@ -1540,9 +1542,25 @@ impl<Window: WindowMethods> IOCompositor<Window> {
Ok(current_dir) => {
let capture_id = now().to_timespec().sec.to_string();
let capture_path = current_dir.join("capture_webrender").join(capture_id);
let revision_file_path = capture_path.join("wr.txt");

if let Err(err) = create_dir_all(&capture_path) {
println!("Unable to create path '{:?}' for capture: {:?}", capture_path, err);

This comment has been minimized.

@nox

nox Mar 19, 2018

Member

eprintln

return
}

self.webrender_api.save_capture(capture_path, webrender_api::CaptureBits::all());

match File::create(revision_file_path) {
Ok(mut file) => {
if let Err(err) = write!(&mut file, "{}", REVISION) {
println!("Unable to write webrender revision: {:?}", err)
}
}
Err(err) => println!("Capture triggered, creating webrender revision info skipped: {:?}", err)
}
},
Err(err) => println!("could not locate path to save captures: {:?}", err)
Err(err) => println!("Unable to locate path to save captures: {:?}", err)
}
}
}
@@ -39,6 +39,7 @@ use style_traits::CSSPixel;
mod compositor;
pub mod compositor_thread;
mod touch;
mod webrender_revision;
pub mod windowing;

pub struct SendableFrameTree {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.