Bug 1320320 - handle pipeline epoch in WR binding. r=mchang?

move the epoch counting from gecko to WR binding

MozReview-Commit-ID: IqHbOchFJIc
This commit is contained in:
JerryShih 2016-12-05 01:16:03 -10:00
Родитель 40d8316588
Коммит 9b40d2f3f6
7 изменённых файлов: 34 добавлений и 21 удалений

Просмотреть файл

@ -45,7 +45,6 @@ WebRenderBridgeParent::WebRenderBridgeParent(CompositorBridgeParentBase* aCompos
, mParentLayerObserverEpoch(0)
, mPendingTransactionId(0)
, mDestroyed(false)
, mWREpoch(0)
{
MOZ_ASSERT(mGLContext);
MOZ_ASSERT(mCompositor);
@ -470,7 +469,7 @@ WebRenderBridgeParent::ClearResources()
mExternalImageIds.Clear();
if (mWRState) {
wr_destroy(mWRState);
wr_destroy(mWRWindowState, mWRState);
mWRState = nullptr;
}
if (mCompositorScheduler) {

Просмотреть файл

@ -135,7 +135,6 @@ private:
uint64_t mPendingTransactionId;
bool mDestroyed;
uint32_t mWREpoch;
};
} // namespace layers

Просмотреть файл

@ -9,6 +9,7 @@ webrender_traits = {path = "../webrender_traits", version = "0.11.0"}
euclid = "0.10"
app_units = "0.3"
gleam = "0.2"
fnv="1.0"
[dependencies.webrender]
path = "../webrender"

Просмотреть файл

@ -212,8 +212,8 @@ pub struct WrWindowState {
_gl_library: GlLibrary,
root_pipeline_id: PipelineId,
size: Size2D<u32>,
epoch: Epoch,
render_notifier_lock: Arc<(Mutex<bool>, Condvar)>,
pipeline_epoch_map: HashMap<PipelineId, Epoch, BuildHasherDefault<FnvHasher>>,
}
pub struct WrState {
@ -338,8 +338,8 @@ pub extern fn wr_init_window(root_pipeline_id: u64,
_gl_library: library,
root_pipeline_id: pipeline_id,
size: Size2D::new(0, 0),
epoch: Epoch(0),
render_notifier_lock: notification_lock_clone,
pipeline_epoch_map: HashMap::with_hasher(Default::default()),
});
Box::into_raw(state)
}
@ -362,6 +362,8 @@ pub extern fn wr_create(window: &mut WrWindowState, width: u32, height: u32, lay
window.size = Size2D::new(width, height);
}
window.pipeline_epoch_map.insert(pipeline_id, Epoch(0));
Box::into_raw(state)
}
@ -433,28 +435,34 @@ pub fn wr_composite_window(window: &mut WrWindowState) {
#[no_mangle]
pub extern fn wr_dp_end(window: &mut WrWindowState,
state: &mut WrState,
epoch: Epoch) {
state: &mut WrState) {
assert!( unsafe { is_in_compositor_thread() });
let root_background_color = ColorF::new(0.3, 0.0, 0.0, 1.0);
let pipeline_id = state.pipeline_id;
let (width, height) = state.size;
window.epoch = epoch;
// Should be the root one
assert!(state.frame_builder.dl_builder.len() == 1);
let mut dl = state.frame_builder.dl_builder.pop().unwrap();
state.frame_builder.root_dl_builder.list.append(&mut dl.list);
if let Some(epoch) = window.pipeline_epoch_map.get_mut(&pipeline_id) {
(*epoch).0 += 1;
state.frame_builder.root_dl_builder.pop_stacking_context();
// Should be the root one
assert!(state.frame_builder.dl_builder.len() == 1);
let mut dl = state.frame_builder.dl_builder.pop().unwrap();
state.frame_builder.root_dl_builder.list.append(&mut dl.list);
let fb = mem::replace(&mut state.frame_builder, WebRenderFrameBuilder::new(pipeline_id));
state.frame_builder.root_dl_builder.pop_stacking_context();
//let (dl_builder, aux_builder) = fb.root_dl_builder.finalize();
window.api.set_root_display_list(root_background_color,
epoch,
Size2D::new(width as f32, height as f32),
fb.root_dl_builder);
let fb = mem::replace(&mut state.frame_builder, WebRenderFrameBuilder::new(pipeline_id));
//let (dl_builder, aux_builder) = fb.root_dl_builder.finalize();
window.api.set_root_display_list(root_background_color,
*epoch,
Size2D::new(width as f32, height as f32),
fb.root_dl_builder);
return;
}
panic!("Could not find epoch for pipeline_id:({},{})", pipeline_id.0, pipeline_id.1);
}
#[no_mangle]

Просмотреть файл

@ -7,6 +7,7 @@ extern crate webrender_traits;
extern crate euclid;
extern crate app_units;
extern crate gleam;
extern crate fnv;
#[cfg(target_os="macos")]
extern crate core_foundation;

Просмотреть файл

@ -107,7 +107,7 @@ wr_create(wrwindowstate* wrWindow, uint32_t width, uint32_t height, uint64_t lay
WR_FUNC;
WR_INLINE void
wr_destroy(wrstate* wrstate)
wr_destroy(wrwindowstate* wrWindow, wrstate* wrstate)
WR_FUNC;
WR_INLINE WRImageKey
@ -151,7 +151,7 @@ wr_dp_begin(wrwindowstate* wrWindow, wrstate* wrState, uint32_t width, uint32_t
WR_FUNC;
WR_INLINE void
wr_dp_end(wrwindowstate* wrWindow, wrstate* wrState, uint32_t epoch)
wr_dp_end(wrwindowstate* wrWindow, wrstate* wrState)
WR_FUNC;
WR_INLINE void

5
third_party/rust/xml-rs/Changelog.md поставляемый
Просмотреть файл

@ -3,6 +3,11 @@
* Added `Debug` implementation for `XmlVersion`
* Fixed some failing tests
## Version 0.3.5
* Added `Debug` implementation for `XmlVersion`
* Fixed some failing tests
## Version 0.3.3
* Updated `bitflags` to 0.7.