Skip to content

Commit

Permalink
Fix warnings in the WebRender build
Browse files Browse the repository at this point in the history
  • Loading branch information
mrobinson committed Jan 24, 2024
1 parent 88019f7 commit b4eca54
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 58 deletions.
2 changes: 0 additions & 2 deletions webrender/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions webrender/src/device/gl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
3 changes: 1 addition & 2 deletions webrender/src/hit_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions webrender/src/internal_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ pub enum ResultMsg {

#[derive(Clone, Debug)]
pub struct ResourceCacheError {
#[allow(dead_code)]
description: String,
}

Expand Down
38 changes: 5 additions & 33 deletions webrender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions webrender/src/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
6 changes: 3 additions & 3 deletions webrender/src/render_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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 |
Expand Down
5 changes: 2 additions & 3 deletions webrender_api/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 4 additions & 13 deletions webrender_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions wr_malloc_size_of/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b4eca54

Please sign in to comment.