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

Add serialization branch to record display lists #316

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

move record functions into separte file

  • Loading branch information
lanamorgan committed Aug 18, 2016
commit dcceed9725378af1d93a5d062e0524d342cfb6fa
@@ -21,9 +21,8 @@ ipc-channel = "0.5"
lazy_static = "0.2"
log = "0.3"
num-traits = "0.1.32"
offscreen_gl_context = {version = "0.1.9", features = ["serde_serialization"]}
offscreen_gl_context = {version = "0.3", features = ["serde_serialization"]}
rayon = "0.4.0"
scoped_threadpool = "0.1.6"
time = "0.1"
webrender_traits = {path = "../webrender_traits", default-features = false}

@@ -0,0 +1,34 @@
use bincode;
use byteorder::{LittleEndian, WriteBytesExt};
use std::fs::OpenOptions;
use std::io::Write;
use webrender_traits::ApiMsg;

pub fn write_data(frame_counter:u32, auxiliary_data: &Vec<u8>){
let filename = format!("record/frame_{}.bin", frame_counter);
let mut file = OpenOptions::new().append(true).open(filename).unwrap();
file.write_u32::<LittleEndian>(auxiliary_data.len() as u32).ok();
file.write(&auxiliary_data).ok();
}


pub fn write_msg(frame:u32, msg: &ApiMsg){
match msg{
ref msg @ &ApiMsg::AddRawFont(..) |
ref msg @ &ApiMsg::AddNativeFont(..) |
ref msg @ &ApiMsg::AddImage(..) |
ref msg @ &ApiMsg::SetRootPipeline(..) |
ref msg @ &ApiMsg::UpdateImage(..) |
ref msg @ &ApiMsg::Scroll(..)|
ref msg @ &ApiMsg::TickScrollingBounce|
ref msg @ &ApiMsg::DeleteImage(..)|
ref msg @ &ApiMsg::SetRootStackingContext(..) =>{
let filename = format!("record/frame_{}.bin", frame);
let mut file = OpenOptions::new().append(true).create(true).open(filename).unwrap();
let buff = bincode::serde::serialize(msg, bincode::SizeLimit::Infinite).unwrap();
file.write_u32::<LittleEndian>(buff.len() as u32).unwrap();
file.write(&buff).unwrap();
}
_ => {}
}
}
@@ -60,10 +60,7 @@ impl RenderBackend {
config: FrameBuilderConfig,
debug: bool,
enable_recording: bool) -> RenderBackend {
let mut thread_pool = scoped_threadpool::Pool::new(8);

let resource_cache = ResourceCache::new(&mut thread_pool,
texture_cache,
let resource_cache = ResourceCache::new(texture_cache,
device_pixel_ratio,
enable_aa);

You are viewing a condensed version of this merge commit. You can view the full changes here.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.