Upgrade to new Hasher API

This commit is contained in:
Ruud van Asseldonk 2016-02-03 20:06:39 +01:00
parent b1fffcd85d
commit 95be0b9a25
9 changed files with 14 additions and 20 deletions

View file

@ -20,7 +20,7 @@ use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResp
use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder};
use std::cell::{RefCell, RefMut};
use std::collections::HashMap;
use std::collections::hash_state::DefaultState;
use std::hash::BuildHasherDefault;
use std::rc::Rc;
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex};
@ -95,7 +95,7 @@ pub struct SharedLayoutContext {
pub canvas_layers_sender: Mutex<Sender<(LayerId, IpcSender<CanvasMsg>)>>,
/// The visible rects for each layer, as reported to us by the compositor.
pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>,
pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, BuildHasherDefault<FnvHasher>>>,
}
pub struct LayoutContext<'a> {

View file

@ -54,7 +54,7 @@ use serde_json;
use std::borrow::ToOwned;
use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::hash_state::DefaultState;
use std::hash::BuildHasherDefault;
use std::ops::{Deref, DerefMut};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::mpsc::{channel, Sender, Receiver};
@ -195,7 +195,7 @@ pub struct LayoutThread {
/// The position and size of the visible rect for each layer. We do not build display lists
/// for any areas more than `DISPLAY_PORT_SIZE_FACTOR` screens away from this area.
visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>,
visible_rects: Arc<HashMap<LayerId, Rect<Au>, BuildHasherDefault<FnvHasher>>>,
/// The list of currently-running animations.
running_animations: Arc<RwLock<HashMap<OpaqueNode, Vec<Animation>>>>,
@ -430,7 +430,7 @@ impl LayoutThread {
new_animations_receiver: new_animations_receiver,
outstanding_web_fonts: outstanding_web_fonts_counter,
root_flow: None,
visible_rects: Arc::new(HashMap::with_hash_state(Default::default())),
visible_rects: Arc::new(HashMap::with_hasher(Default::default())),
running_animations: Arc::new(RwLock::new(HashMap::new())),
expired_animations: Arc::new(RwLock::new(HashMap::new())),
epoch: Epoch(0),
@ -1099,7 +1099,7 @@ impl LayoutThread {
// layers have moved more than `DISPLAY_PORT_THRESHOLD_SIZE_FACTOR` away from their last
// positions.
let mut must_regenerate_display_lists = false;
let mut old_visible_rects = HashMap::with_hash_state(Default::default());
let mut old_visible_rects = HashMap::with_hasher(Default::default());
let inflation_amount =
Size2D::new(self.viewport_size.width * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR,
self.viewport_size.height * DISPLAY_PORT_THRESHOLD_SIZE_FACTOR);

View file

@ -6,7 +6,6 @@
#![feature(box_syntax)]
#![feature(cell_extras)]
#![feature(custom_derive)]
#![feature(hashmap_hasher)]
#![feature(mpsc_select)]
#![feature(nonzero)]
#![feature(plugin)]