mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Remove unused code from a bunch of crates
This commit is contained in:
parent
8b6ed3d182
commit
e64de8d90a
8 changed files with 6 additions and 74 deletions
|
@ -997,26 +997,6 @@ fn write_image(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait PointToi32 {
|
|
||||||
fn to_i32(&self) -> Point2D<i32>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl PointToi32 for Point2D<f64> {
|
|
||||||
fn to_i32(&self) -> Point2D<i32> {
|
|
||||||
Point2D::new(self.x.to_i32().unwrap(), self.y.to_i32().unwrap())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait SizeToi32 {
|
|
||||||
fn to_i32(&self) -> Size2D<i32>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl SizeToi32 for Size2D<f64> {
|
|
||||||
fn to_i32(&self) -> Size2D<i32> {
|
|
||||||
Size2D::new(self.width.to_i32().unwrap(), self.height.to_i32().unwrap())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait RectToi32 {
|
pub trait RectToi32 {
|
||||||
fn to_i32(&self) -> Rect<i32>;
|
fn to_i32(&self) -> Rect<i32>;
|
||||||
fn ceil(&self) -> Rect<f64>;
|
fn ceil(&self) -> Rect<f64>;
|
||||||
|
|
|
@ -147,17 +147,6 @@ impl GLContextWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unbind(&self) {
|
|
||||||
match *self {
|
|
||||||
GLContextWrapper::Native(ref ctx) => {
|
|
||||||
ctx.unbind().unwrap();
|
|
||||||
},
|
|
||||||
GLContextWrapper::OSMesa(ref ctx) => {
|
|
||||||
ctx.unbind().unwrap();
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn apply_command(
|
pub fn apply_command(
|
||||||
&self,
|
&self,
|
||||||
cmd: WebGLCommand,
|
cmd: WebGLCommand,
|
||||||
|
|
|
@ -122,17 +122,9 @@ impl PipelineId {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn root_scroll_node(&self) -> webrender_api::SpatialId {
|
|
||||||
webrender_api::SpatialId::root_scroll_node(self.to_webrender())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn root_scroll_id(&self) -> webrender_api::ExternalScrollId {
|
pub fn root_scroll_id(&self) -> webrender_api::ExternalScrollId {
|
||||||
webrender_api::ExternalScrollId(0, self.to_webrender())
|
webrender_api::ExternalScrollId(0, self.to_webrender())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn root_clip_node(&self) -> webrender_api::ClipId {
|
|
||||||
webrender_api::ClipId::root(self.to_webrender())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for PipelineId {
|
impl fmt::Display for PipelineId {
|
||||||
|
|
|
@ -18,8 +18,6 @@ pub trait Int:
|
||||||
{
|
{
|
||||||
fn zero() -> Self;
|
fn zero() -> Self;
|
||||||
fn one() -> Self;
|
fn one() -> Self;
|
||||||
fn max_value() -> Self;
|
|
||||||
fn from_usize(n: usize) -> Option<Self>;
|
|
||||||
fn to_usize(self) -> usize;
|
fn to_usize(self) -> usize;
|
||||||
}
|
}
|
||||||
impl Int for isize {
|
impl Int for isize {
|
||||||
|
@ -32,14 +30,6 @@ impl Int for isize {
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
fn max_value() -> isize {
|
|
||||||
::std::isize::MAX
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
fn from_usize(n: usize) -> Option<isize> {
|
|
||||||
num_traits::NumCast::from(n)
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
fn to_usize(self) -> usize {
|
fn to_usize(self) -> usize {
|
||||||
num_traits::NumCast::from(self).unwrap()
|
num_traits::NumCast::from(self).unwrap()
|
||||||
}
|
}
|
||||||
|
@ -54,14 +44,6 @@ impl Int for usize {
|
||||||
1
|
1
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
fn max_value() -> usize {
|
|
||||||
::std::usize::MAX
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
fn from_usize(n: usize) -> Option<usize> {
|
|
||||||
Some(n)
|
|
||||||
}
|
|
||||||
#[inline]
|
|
||||||
fn to_usize(self) -> usize {
|
fn to_usize(self) -> usize {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
@ -134,10 +116,6 @@ macro_rules! int_range_index {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn one() -> $Self_ { $Self_($crate::Int::one()) }
|
fn one() -> $Self_ { $Self_($crate::Int::one()) }
|
||||||
#[inline]
|
#[inline]
|
||||||
fn max_value() -> $Self_ { $Self_($crate::Int::max_value()) }
|
|
||||||
#[inline]
|
|
||||||
fn from_usize(n: usize) -> Option<$Self_> { $crate::Int::from_usize(n).map($Self_) }
|
|
||||||
#[inline]
|
|
||||||
fn to_usize(self) -> usize { self.to_usize() }
|
fn to_usize(self) -> usize { self.to_usize() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,12 +62,6 @@ impl AtomicOptThreadId {
|
||||||
let number = self.0.load(ordering);
|
let number = self.0.load(ordering);
|
||||||
NonZeroUsize::new(number).map(ThreadId)
|
NonZeroUsize::new(number).map(ThreadId)
|
||||||
}
|
}
|
||||||
#[allow(unsafe_code)]
|
|
||||||
pub fn swap(&self, value: Option<ThreadId>, ordering: Ordering) -> Option<ThreadId> {
|
|
||||||
let number = value.map(|id| id.0.get()).unwrap_or(0);
|
|
||||||
let number = self.0.swap(number, ordering);
|
|
||||||
NonZeroUsize::new(number).map(ThreadId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A type for hand-over-hand mutexes.
|
/// A type for hand-over-hand mutexes.
|
||||||
|
|
|
@ -27,4 +27,8 @@ impl<'a> InCompartment<'a> {
|
||||||
pub fn in_compartment(token: &AlreadyInCompartment) -> InCompartment {
|
pub fn in_compartment(token: &AlreadyInCompartment) -> InCompartment {
|
||||||
InCompartment::Already(token)
|
InCompartment::Already(token)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn entered(token: &JSAutoRealm) -> InCompartment {
|
||||||
|
InCompartment::Entered(token)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,11 +18,6 @@ const KEY_MASK: u32 = (1 << KEY_SIZE) - 1;
|
||||||
/// A counting Bloom filter with 8-bit counters.
|
/// A counting Bloom filter with 8-bit counters.
|
||||||
pub type BloomFilter = CountingBloomFilter<BloomStorageU8>;
|
pub type BloomFilter = CountingBloomFilter<BloomStorageU8>;
|
||||||
|
|
||||||
/// A non-counting Bloom filter.
|
|
||||||
///
|
|
||||||
/// Effectively a counting Bloom filter with 1-bit counters.
|
|
||||||
pub type NonCountingBloomFilter = CountingBloomFilter<BloomStorageBool>;
|
|
||||||
|
|
||||||
/// A counting Bloom filter with parameterized storage to handle
|
/// A counting Bloom filter with parameterized storage to handle
|
||||||
/// counters of different sizes. For now we assume that having two hash
|
/// counters of different sizes. For now we assume that having two hash
|
||||||
/// functions is enough, but we may revisit that decision later.
|
/// functions is enough, but we may revisit that decision later.
|
||||||
|
|
|
@ -421,7 +421,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn apply_declaration<Phase: CascadePhase>(
|
fn apply_declaration(
|
||||||
&mut self,
|
&mut self,
|
||||||
longhand_id: LonghandId,
|
longhand_id: LonghandId,
|
||||||
declaration: &PropertyDeclaration,
|
declaration: &PropertyDeclaration,
|
||||||
|
@ -544,7 +544,7 @@ impl<'a, 'b: 'a> Cascade<'a, 'b> {
|
||||||
// FIXME(emilio): We should avoid generating code for logical
|
// FIXME(emilio): We should avoid generating code for logical
|
||||||
// longhands and just use the physical ones, then rename
|
// longhands and just use the physical ones, then rename
|
||||||
// physical_longhand_id to just longhand_id.
|
// physical_longhand_id to just longhand_id.
|
||||||
self.apply_declaration::<Phase>(longhand_id, &*declaration);
|
self.apply_declaration(longhand_id, &*declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if Phase::is_early() {
|
if Phase::is_early() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue