1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
diff --git a/webrender/build.rs b/webrender/build.rs
index 60b4a96c23..adc5dbf2e8 100644
--- a/webrender/build.rs
+++ b/webrender/build.rs
@@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-extern crate webrender_build;
-
use std::borrow::Cow;
use std::env;
use std::fs::{canonicalize, read_dir, File};
diff --git a/webrender/src/device/gl.rs b/webrender/src/device/gl.rs
index eb272e56d6..5e0c050378 100644
--- a/webrender/src/device/gl.rs
+++ b/webrender/src/device/gl.rs
@@ -386,6 +386,7 @@ impl<T> Drop for VBO<T> {
pub struct ExternalTexture {
id: gl::GLuint,
target: gl::GLuint,
+ #[allow(dead_code)]
swizzle: Swizzle,
uv_rect: TexelRect,
}
diff --git a/webrender/src/hit_test.rs b/webrender/src/hit_test.rs
index e095d8db0c..0bd02cd426 100644
--- a/webrender/src/hit_test.rs
+++ b/webrender/src/hit_test.rs
@@ -6,10 +6,9 @@ use api::{BorderRadius, ClipMode, HitTestItem, HitTestResult, ItemTag, Primitive
use api::{PipelineId, ApiHitTester, ClipId};
use api::units::*;
use crate::clip::{ClipItemKind, ClipStore, ClipNode, rounded_rectangle_contains_point};
-use crate::clip::{polygon_contains_point};
+use crate::clip::polygon_contains_point;
use crate::prim_store::PolygonKey;
use crate::scene_builder_thread::Interners;
-use crate::spatial_node::SpatialNodeType;
use crate::spatial_tree::{SpatialNodeIndex, SpatialTree};
use crate::internal_types::{FastHashMap, FastHashSet, LayoutPrimitiveInfo};
use std::ops;
diff --git a/webrender/src/internal_types.rs b/webrender/src/internal_types.rs
index 07f937c6a0..9819850db0 100644
--- a/webrender/src/internal_types.rs
+++ b/webrender/src/internal_types.rs
@@ -536,6 +536,7 @@ pub enum ResultMsg {
#[derive(Clone, Debug)]
pub struct ResourceCacheError {
+ #[allow(dead_code)]
description: String,
}
diff --git a/webrender/src/lib.rs b/webrender/src/lib.rs
index 34bc9fb49b..cc200e30eb 100644
--- a/webrender/src/lib.rs
+++ b/webrender/src/lib.rs
@@ -71,8 +71,7 @@ extern crate serde;
extern crate tracy_rs;
#[macro_use]
extern crate derive_more;
-extern crate malloc_size_of;
-extern crate svg_fmt;
+use malloc_size_of;
#[macro_use]
mod profiler;
@@ -163,41 +162,14 @@ mod platform {
}
}
-#[cfg(target_os = "macos")]
-extern crate core_foundation;
-#[cfg(target_os = "macos")]
-extern crate core_graphics;
-#[cfg(target_os = "macos")]
-extern crate core_text;
-
-#[cfg(all(unix, not(target_os = "macos")))]
-extern crate freetype;
-#[cfg(all(unix, not(target_os = "macos")))]
-extern crate libc;
-
-#[cfg(target_os = "windows")]
-extern crate dwrote;
-
-extern crate bincode;
-extern crate byteorder;
-pub extern crate euclid;
-extern crate fxhash;
-extern crate gleam;
-extern crate num_traits;
-extern crate plane_split;
-extern crate rayon;
-#[cfg(feature = "ron")]
-extern crate ron;
+pub use euclid;
#[macro_use]
extern crate smallvec;
-extern crate time;
-#[cfg(all(feature = "capture", feature = "png"))]
-extern crate png;
#[cfg(test)]
-extern crate rand;
+use rand;
-pub extern crate api;
-extern crate webrender_build;
+pub use api;
+use webrender_build;
#[doc(hidden)]
pub use crate::composite::{CompositorConfig, Compositor, CompositorCapabilities, CompositorSurfaceTransform};
diff --git a/webrender/src/profiler.rs b/webrender/src/profiler.rs
index 40c091d617..702fa634ff 100644
--- a/webrender/src/profiler.rs
+++ b/webrender/src/profiler.rs
@@ -1362,6 +1362,7 @@ pub struct Counter {
change_indicator: u8,
/// Only used to check that the constants match the real index.
+ #[allow(dead_code)]
index: usize,
graph: Option<Graph>,
diff --git a/webrender/src/render_target.rs b/webrender/src/render_target.rs
index d31176047b..301ce4ec4d 100644
--- a/webrender/src/render_target.rs
+++ b/webrender/src/render_target.rs
@@ -10,7 +10,7 @@ use crate::batch::{ClipBatcher, BatchBuilder};
use crate::spatial_tree::{SpatialTree, ROOT_SPATIAL_NODE_INDEX};
use crate::clip::ClipStore;
use crate::composite::CompositeState;
-use crate::frame_builder::{FrameGlobalResources};
+use crate::frame_builder::FrameGlobalResources;
use crate::gpu_cache::{GpuCache, GpuCacheAddress};
use crate::gpu_types::{BorderInstance, SvgFilterInstance, BlurDirection, BlurInstance, PrimitiveHeaders, ScalingInstance};
use crate::gpu_types::{TransformPalette, ZBufferIdGenerator};
@@ -819,10 +819,10 @@ fn add_svg_filter_instances(
let generic_int = match filter {
SvgFilterInfo::Blend(mode) => *mode as u16,
SvgFilterInfo::ComponentTransfer(data) =>
- ((data.r_func.to_int() << 12 |
+ (data.r_func.to_int() << 12 |
data.g_func.to_int() << 8 |
data.b_func.to_int() << 4 |
- data.a_func.to_int()) as u16),
+ data.a_func.to_int()) as u16,
SvgFilterInfo::Composite(operator) =>
operator.as_int() as u16,
SvgFilterInfo::LinearToSrgb |
diff --git a/webrender_api/src/image.rs b/webrender_api/src/image.rs
index 238d004814..23c660b647 100644
--- a/webrender_api/src/image.rs
+++ b/webrender_api/src/image.rs
@@ -326,10 +326,9 @@ pub enum ImageData {
}
mod serde_image_data_raw {
- extern crate serde_bytes;
-
- use std::sync::Arc;
use serde::{Deserializer, Serializer};
+ use serde_bytes;
+ use std::sync::Arc;
pub fn serialize<S: Serializer>(bytes: &Arc<Vec<u8>>, serializer: S) -> Result<S::Ok, S::Error> {
serde_bytes::serialize(bytes.as_slice(), serializer)
diff --git a/webrender_api/src/lib.rs b/webrender_api/src/lib.rs
index b0446c1d0b..f5cda1fbf6 100644
--- a/webrender_api/src/lib.rs
+++ b/webrender_api/src/lib.rs
@@ -15,29 +15,20 @@
#![cfg_attr(feature = "cargo-clippy", allow(clippy::float_cmp, clippy::too_many_arguments))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::unreadable_literal, clippy::new_without_default))]
-pub extern crate crossbeam_channel;
-pub extern crate euclid;
+pub use crossbeam_channel;
+pub use euclid;
-extern crate app_units;
#[macro_use]
extern crate bitflags;
-extern crate byteorder;
#[cfg(feature = "nightly")]
extern crate core;
-#[cfg(target_os = "macos")]
-extern crate core_foundation;
-#[cfg(target_os = "macos")]
-extern crate core_graphics;
-extern crate derive_more;
#[macro_use]
extern crate malloc_size_of_derive;
-extern crate serde;
#[macro_use]
extern crate serde_derive;
-extern crate time;
-extern crate malloc_size_of;
-extern crate peek_poke;
+use malloc_size_of;
+use peek_poke;
pub mod channel;
mod color;
diff --git a/wr_malloc_size_of/lib.rs b/wr_malloc_size_of/lib.rs
index 38b049095e..abd982ffe8 100644
--- a/wr_malloc_size_of/lib.rs
+++ b/wr_malloc_size_of/lib.rs
@@ -10,8 +10,8 @@
//! A reduced fork of Firefox's malloc_size_of crate, for bundling with WebRender.
-extern crate app_units;
-extern crate euclid;
+use app_units;
+use euclid;
use std::hash::{BuildHasher, Hash};
use std::mem::size_of;
|