diff --git a/gfx/wr/webrender/src/device/gl.rs b/gfx/wr/webrender/src/device/gl.rs index 4e5471a4676f..b7ea8105c076 100644 --- a/gfx/wr/webrender/src/device/gl.rs +++ b/gfx/wr/webrender/src/device/gl.rs @@ -199,10 +199,6 @@ pub fn get_unoptimized_shader_source(shader_name: &str, base_path: Option<&PathB } } -pub trait FileWatcherHandler: Send { - fn file_changed(&self, path: PathBuf); -} - impl VertexAttributeKind { fn size_in_bytes(&self) -> u32 { match *self { diff --git a/gfx/wr/webrender/src/resource_cache.rs b/gfx/wr/webrender/src/resource_cache.rs index 349be25cb803..aee3cbe24121 100644 --- a/gfx/wr/webrender/src/resource_cache.rs +++ b/gfx/wr/webrender/src/resource_cache.rs @@ -193,12 +193,6 @@ struct ImageResource { generation: ImageGeneration, } -#[derive(Clone, Debug)] -pub struct ImageTiling { - pub image_size: DeviceIntSize, - pub tile_size: TileSize, -} - #[derive(Default)] struct ImageTemplates { images: FastHashMap, diff --git a/gfx/wr/webrender/src/texture_pack/mod.rs b/gfx/wr/webrender/src/texture_pack/mod.rs index f89a82b0a124..ebc92ccbe9ba 100644 --- a/gfx/wr/webrender/src/texture_pack/mod.rs +++ b/gfx/wr/webrender/src/texture_pack/mod.rs @@ -57,8 +57,6 @@ pub trait AtlasAllocatorList { fn set_handle(&mut self, texture_id: CacheTextureId, alloc_id: AllocId, handle: &TextureCacheHandle); - fn remove_handle(&mut self, texture_id: CacheTextureId, alloc_id: AllocId); - /// Deallocate a rectangle and return its size. fn deallocate(&mut self, texture_id: CacheTextureId, alloc_id: AllocId); @@ -235,14 +233,6 @@ for AllocatorList { unit.handles.insert(alloc_id, handle.clone()); } - fn remove_handle(&mut self, texture_id: CacheTextureId, alloc_id: AllocId) { - let unit = self.units - .iter_mut() - .find(|unit| unit.texture_id == texture_id) - .expect("Unable to find the associated texture array unit"); - unit.handles.remove(&alloc_id); - } - fn deallocate(&mut self, texture_id: CacheTextureId, alloc_id: AllocId) { self.deallocate(texture_id, alloc_id); } diff --git a/gfx/wr/webrender/src/util.rs b/gfx/wr/webrender/src/util.rs index 9b161313279f..3db68cd7ab65 100644 --- a/gfx/wr/webrender/src/util.rs +++ b/gfx/wr/webrender/src/util.rs @@ -66,9 +66,6 @@ pub trait VecHelper { /// Equivalent to `mem::replace(&mut vec, Vec::new())` fn take(&mut self) -> Self; - /// Call clear and return self (useful for chaining with calls that move the vector). - fn cleared(self) -> Self; - /// Functionally equivalent to `mem::replace(&mut vec, Vec::new())` but tries /// to keep the allocation in the caller if it is empty or replace it with a /// pre-allocated vector. @@ -102,12 +99,6 @@ impl VecHelper for Vec { replace(self, Vec::new()) } - fn cleared(mut self) -> Self { - self.clear(); - - self - } - fn take_and_preallocate(&mut self) -> Self { let len = self.len(); if len == 0 { @@ -399,10 +390,6 @@ pub trait MatrixHelpers { fn is_2d_scale_translation(&self) -> bool; /// Return the determinant of the 2D part of the matrix. fn determinant_2d(&self) -> f32; - /// This function returns a point in the `Src` space that projects into zero XY. - /// It ignores the Z coordinate and is usable for "flattened" transformations, - /// since they are not generally inversible. - fn inverse_project_2d_origin(&self) -> Option>; /// Turn Z transformation into identity. This is useful when crossing "flat" /// transform styled stacking contexts upon traversing the coordinate systems. fn flatten_z_output(&mut self); @@ -534,17 +521,6 @@ impl MatrixHelpers for Transform3D { self.m11 * self.m22 - self.m12 * self.m21 } - fn inverse_project_2d_origin(&self) -> Option> { - let det = self.determinant_2d(); - if det != 0.0 { - let x = (self.m21 * self.m42 - self.m41 * self.m22) / det; - let y = (self.m12 * self.m41 - self.m11 * self.m42) / det; - Some(Point2D::new(x, y)) - } else { - None - } - } - fn flatten_z_output(&mut self) { self.m13 = 0.0; self.m23 = 0.0; @@ -623,22 +599,6 @@ impl RectHelpers for Box2D { } } -pub trait VectorHelpers -where - Self: Sized, -{ - fn snap(&self) -> Self; -} - -impl VectorHelpers for Vector2D { - fn snap(&self) -> Self { - Vector2D::new( - (self.x + 0.5).floor(), - (self.y + 0.5).floor(), - ) - } -} - pub fn lerp(a: f32, b: f32, t: f32) -> f32 { (b - a) * t + a }