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 upLots of wrench fixes and features #660
Conversation
|
Just a couple of nits. |
| self.top_right == uniform_radius && | ||
| self.bottom_left == uniform_radius && | ||
| self.bottom_right == uniform_radius | ||
| { |
This comment has been minimized.
This comment has been minimized.
|
|
||
| pub fn is_uniform(&self) -> Option<f32> { | ||
| let uniform_radius = LayoutSize::new(self.top_left.width, self.top_left.width); | ||
| if self.top_left == uniform_radius && |
This comment has been minimized.
This comment has been minimized.
|
Fixed. |
|
A lot of great stuff here! |
| @@ -18,6 +17,9 @@ lazy_static! { | |||
| static ref WEBRENDER_RECORDING_DETOUR: Arc<Mutex<Option<Box<ApiRecordingReceiver>>>> = Arc::new(Mutex::new(None)); | |||
| } | |||
|
|
|||
| pub static WEBRENDER_RECORDING_HEADER: u64 = 0xbeefbeefbeefbe01u64; | |||
| static mut CURRENT_FRAME_NUMBER: u32 = 0xffffffffu32; | |||
This comment has been minimized.
This comment has been minimized.
| let pct = pct_int as f32 / 100.; | ||
| let index_f = (values.len()-1) as f32 * pct; | ||
| let index = f32::floor(index_f) as usize; | ||
| if index == index_f as usize { |
This comment has been minimized.
This comment has been minimized.
kvark
Dec 22, 2016
Member
any reason of not going with integer-only arithmetic?
let index_big = (values.len() - 1) * (pct_int as usize);
let index = index_big / 100;
if index * 100 != index_big {..} else {..}|
|
||
| let mut min_time = time::Duration::max_value(); | ||
| let mut min_min_time = time::Duration::max_value(); | ||
| let mut max_time = time::Duration::min_value(); | ||
| let mut max_max_time = time::Duration::min_value(); | ||
| let mut sum_time = time::Duration::zero(); | ||
|
|
||
| let mut block_avg_ms = vec![]; |
This comment has been minimized.
This comment has been minimized.
| if let Some(limit) = limit_seconds { | ||
| if (time::SteadyTime::now() - time_start) >= limit { | ||
| let mut block_avg_ms = block_avg_ms.iter().map(|v| as_ms(*v)).collect::<Vec<f64>>(); | ||
| block_avg_ms.sort_by(|a, b| a.partial_cmp(b).unwrap()); | ||
| let avg_ms = block_avg_ms.iter().fold(0., |sum, v| sum + v) / block_avg_ms.len() as f64; |
This comment has been minimized.
This comment has been minimized.
| frame_start_sender: timing_sender, | ||
| }; | ||
|
|
||
| wrench.set_title("start"); | ||
| // there's a "frame 0" that webrender itself renders; push this to | ||
| // not confuse our notifier | ||
| wrench.frame_start_sender.push(time::SteadyTime::now()); |
This comment has been minimized.
This comment has been minimized.
kvark
Dec 22, 2016
Member
nit: use wrench.begin_frame() instead?
perhaps, frame_start_sender doesn't even need to be public
| let start = item["start"].as_point().expect("gradient must have start"); | ||
| let end = item["end"].as_point().expect("gradient must have end"); | ||
| let stops = if let Some(stops) = item["stops"].as_vec() { | ||
| // FIXME(vlad): I can't find the right way to do this with iterators; |
This comment has been minimized.
This comment has been minimized.
kvark
Dec 22, 2016
Member
Chunks come to rescue:
let g_stops = stops.chunks(2).map(|chunk| GradientStop {
offset: chunk[0].as_force_f32().expect("gradient stop offset is not f32"),
color: chunk[1].as_colorf().expect("gradient stop color is not color"),
}).collect::<Vec<_>>();| } | ||
| } | ||
| } | ||
|
|
||
| fn handle_rect(&mut self, wrench: &mut Wrench, clip_region: &ClipRegion, item: &Yaml) | ||
| { |
This comment has been minimized.
This comment has been minimized.
| let colors = item["color"].as_vec_colorf().expect("borders must have color(s)"); | ||
| let styles = item["style"].as_vec_string().expect("borders must have style(s)"); | ||
| let styles = styles.iter().map(|s| match s { | ||
| s if s == "none" => BorderStyle::None, |
This comment has been minimized.
This comment has been minimized.
kvark
Dec 22, 2016
Member
You should be able to just do "something" => BorderStyle::Something without all the if in the matching
| let border_radius = item["border_radius"].as_force_f32().unwrap_or(0.0); | ||
| let clip_mode = if let Some(mode) = item.as_str() { | ||
| match mode { | ||
| s if s == "none" => BoxShadowClipMode::None, |
This comment has been minimized.
This comment has been minimized.
| @@ -14,6 +13,7 @@ use std::path::{Path, PathBuf}; | |||
| use webrender; | |||
| use webrender_traits::*; | |||
| use yaml_rust::{Yaml, YamlEmitter}; | |||
| use time; | |||
|
|
|||
| use super::CURRENT_FRAME_NUMBER; | |||
This comment has been minimized.
This comment has been minimized.
kvark
Dec 22, 2016
Member
any reason we can't just store the frame number locally and pass it around?
|
|
|
|
add flag to render only certain element types from YAML Output summary stats at end of time-limited run handle borders, box shadow, gradients in YAML Add binary recording header before TypeId, and check for it; clean up binary replay Fix yaml border stuff print 10th/90th percentiles add time prefix to resource filenames to avoid collisions Add --play option to binary frame reader, and fix window title setting Implement YAML clips properly Fix StackingContext bounds to record the proper rect Add 720p 1080p 4k size shorthand Add support for complex clips to wrench
|
@bors-servo r+ |
|
|
Lots of wrench fixes and features Support for many new yaml display items, clips, and other bits. <!-- 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/660) <!-- Reviewable:end -->
|
|
vvuk commentedDec 22, 2016
•
edited by larsbergstrom
Support for many new yaml display items, clips, and other bits.
This change is