mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1889034 - Remove unused code from webrender. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D206327
This commit is contained in:
parent
2b3f712ce5
commit
04e042263a
@ -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 {
|
||||
|
@ -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<ImageKey, ImageResource>,
|
||||
|
@ -57,8 +57,6 @@ pub trait AtlasAllocatorList<TextureParameters> {
|
||||
|
||||
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<Allocator, TextureParameters> {
|
||||
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);
|
||||
}
|
||||
|
@ -66,9 +66,6 @@ pub trait VecHelper<T> {
|
||||
/// 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<T> VecHelper<T> for Vec<T> {
|
||||
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<Src, Dst> {
|
||||
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<Point2D<f32, Src>>;
|
||||
/// 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<Src, Dst> MatrixHelpers<Src, Dst> for Transform3D<f32, Src, Dst> {
|
||||
self.m11 * self.m22 - self.m12 * self.m21
|
||||
}
|
||||
|
||||
fn inverse_project_2d_origin(&self) -> Option<Point2D<f32, Src>> {
|
||||
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<U> RectHelpers<U> for Box2D<f32, U> {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait VectorHelpers<U>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
fn snap(&self) -> Self;
|
||||
}
|
||||
|
||||
impl<U> VectorHelpers<U> for Vector2D<f32, U> {
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user