Bug 1343984 - Fix trivial webrender_bindings warnings. r=jrmuizel
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 02 Mar 2017 16:26:07 -0500
changeset 374824 80ea84e1b5023141db7087fa08badb8c17307242
parent 374823 39628e255960d93b70dfc9b6b7891bfccf1130af
child 374825 ead89e056556d060d54decf3a996ffa0fe040358
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1343984
milestone54.0a1
Bug 1343984 - Fix trivial webrender_bindings warnings. r=jrmuizel MozReview-Commit-ID: 4jJu1ERRIz6
gfx/webrender_bindings/src/bindings.rs
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1,17 +1,17 @@
 use std::ffi::CString;
 use std::{mem, slice};
 use std::path::PathBuf;
 use std::os::raw::{c_void, c_char};
 use gleam::gl;
 use webrender_traits::{BorderSide, BorderStyle, BorderRadius, BorderWidths, BorderDetails, NormalBorder};
 use webrender_traits::{PipelineId, ClipRegion, PropertyBinding};
 use webrender_traits::{Epoch, ExtendMode, ColorF, GlyphInstance, GradientStop, ImageDescriptor};
-use webrender_traits::{FilterOp, ImageData, ImageFormat, ImageKey, ImageMask, ImageRendering, RendererKind, MixBlendMode};
+use webrender_traits::{FilterOp, ImageData, ImageFormat, ImageKey, ImageMask, ImageRendering, MixBlendMode};
 use webrender_traits::{ExternalImageId, RenderApi, FontKey};
 use webrender_traits::{DeviceUintSize, ExternalEvent};
 use webrender_traits::{LayoutPoint, LayoutRect, LayoutSize, LayoutTransform};
 use webrender_traits::{BoxShadowClipMode, LayerPixel, ServoScrollRootId, IdNamespace};
 use webrender_traits::{BuiltDisplayListDescriptor, AuxiliaryListsDescriptor};
 use webrender_traits::{BuiltDisplayList, AuxiliaryLists};
 use webrender::renderer::{Renderer, RendererOptions};
 use webrender::renderer::{ExternalImage, ExternalImageHandler, ExternalImageSource};
@@ -208,17 +208,17 @@ pub unsafe extern fn wr_api_delete(api: 
 pub unsafe extern fn wr_api_finalize_builder(state: &mut WrState,
                                              dl_descriptor: &mut BuiltDisplayListDescriptor,
                                              dl_data: &mut WrVecU8,
                                              aux_descriptor: &mut AuxiliaryListsDescriptor,
                                              aux_data: &mut WrVecU8)
 {
     let frame_builder = mem::replace(&mut state.frame_builder,
                                      WebRenderFrameBuilder::new(state.pipeline_id));
-    let (pipeline_id, dl, aux) = frame_builder.dl_builder.finalize();
+    let (_, dl, aux) = frame_builder.dl_builder.finalize();
     //XXX: get rid of the copies here
     *dl_data = WrVecU8::from_vec(dl.data().to_owned());
     *dl_descriptor = dl.descriptor().clone();
     *aux_data = WrVecU8::from_vec(aux.data().to_owned());
     *aux_descriptor = aux.descriptor().clone();
 }
 
 #[no_mangle]
@@ -234,27 +234,23 @@ pub unsafe extern fn wr_api_set_root_dis
                                                   aux_data: *mut u8,
                                                   aux_size: usize) {
     let root_background_color = ColorF::new(0.3, 0.0, 0.0, 1.0);
     // See the documentation of set_root_display_list in api.rs. I don't think
     // it makes a difference in gecko at the moment(until APZ is figured out)
     // but I suppose it is a good default.
     let preserve_frame_state = true;
 
-    let dl_slice = unsafe {
-        slice::from_raw_parts(dl_data, dl_size)
-    };
+    let dl_slice = slice::from_raw_parts(dl_data, dl_size);
     let mut dl_vec = Vec::new();
     // XXX: see if we can get rid of the copy here
     dl_vec.extend_from_slice(dl_slice);
     let dl = BuiltDisplayList::from_data(dl_vec, dl_descriptor);
 
-    let aux_slice = unsafe {
-        slice::from_raw_parts(aux_data, aux_size)
-    };
+    let aux_slice = slice::from_raw_parts(aux_data, aux_size);
     let mut aux_vec = Vec::new();
     // XXX: see if we can get rid of the copy here
     aux_vec.extend_from_slice(aux_slice);
     let aux = AuxiliaryLists::from_data(aux_vec, aux_descriptor);
 
     api.set_root_display_list(Some(root_background_color),
                               epoch,
                               LayoutSize::new(viewport_width, viewport_height),
@@ -293,17 +289,17 @@ pub extern fn wr_window_new(window_id: W
     let opts = RendererOptions {
         enable_aa: true,
         enable_subpixel_aa: true,
         enable_profiler: enable_profiler,
         recorder: recorder,
         .. Default::default()
     };
 
-    let (mut renderer, sender) = match Renderer::new(opts) {
+    let (renderer, sender) = match Renderer::new(opts) {
         Ok((renderer, sender)) => { (renderer, sender) }
         Err(e) => {
             println!(" Failed to create a Renderer: {:?}", e);
             return false;
         }
     };
 
     renderer.set_render_notifier(Box::new(CppNotifier { window_id: window_id }));
@@ -602,17 +598,17 @@ impl WrGradientExtendMode
 
 #[no_mangle]
 pub extern fn wr_dp_push_stacking_context(state:&mut WrState, bounds: WrRect, overflow: WrRect, mask: *const WrImageMask, opacity: f32, transform: &LayoutTransform, mix_blend_mode: WrMixBlendMode)
 {
     assert!( unsafe { is_in_main_thread() });
     state.z_index += 1;
 
     let bounds = bounds.to_rect();
-    let mut overflow = overflow.to_rect();
+    let overflow = overflow.to_rect();
     let mix_blend_mode = mix_blend_mode.to_mix_blend_mode();
     //println!("stacking context: {:?} {:?} {:?} {:?} {:?}", state.pipeline_id, bounds, overflow, mask, transform);
     // convert from the C type to the Rust type
     let mask = unsafe { mask.as_ref().map(|&WrImageMask{image, ref rect,repeat}| ImageMask{image: image, rect: rect.to_rect(), repeat: repeat}) };
 
     let clip_region2 = state.frame_builder.dl_builder.new_clip_region(&overflow, vec![], None);
     let clip_region = state.frame_builder.dl_builder.new_clip_region(&overflow, vec![], mask);