Bug 1400216 - Update bindings.rs for interfaces changed in WR cset aabd0936. r=kats
authorMartin Robinson <mrobinson@igalia.com>
Tue, 19 Sep 2017 12:16:33 -0400
changeset 381658 7d6ade2d75d99866e1c343f61fb42991b0be2b7f
parent 381657 d7bf0ddc77a71c17e3ae6418eb486154843e288c
child 381659 d94508124715f39a2e3f7a13aae12a12bf311855
push id32535
push userkwierso@gmail.com
push dateTue, 19 Sep 2017 21:06:08 +0000
treeherdermozilla-central@c0d1f9eb2a40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1400216
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1400216 - Update bindings.rs for interfaces changed in WR cset aabd0936. r=kats MozReview-Commit-ID: HMNal0zNJZi
gfx/webrender_bindings/src/bindings.rs
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1080,22 +1080,17 @@ pub extern "C" fn wr_state_delete(state:
 pub extern "C" fn wr_dp_begin(state: &mut WrState,
                               width: u32,
                               height: u32) {
     assert!(unsafe { !is_in_render_thread() });
     state.frame_builder.dl_builder.data.clear();
 
     let bounds = LayoutRect::new(LayoutPoint::new(0.0, 0.0),
                                  LayoutSize::new(width as f32, height as f32));
-
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: None,
-        is_backface_visible: true,
-    };
+    let prim_info = LayoutPrimitiveInfo::new(bounds);
 
     state.frame_builder
          .dl_builder
          .push_stacking_context(&prim_info,
                                 webrender_api::ScrollPolicy::Scrollable,
                                 None,
                                 TransformStyle::Flat,
                                 None,
@@ -1156,22 +1151,17 @@ pub extern "C" fn wr_dp_push_stacking_co
     };
 
     let perspective_ref = unsafe { perspective.as_ref() };
     let perspective = match perspective_ref {
         Some(perspective) => Some(perspective.clone()),
         None => None,
     };
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: None,
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::new(bounds);
     state.frame_builder
          .dl_builder
          .push_stacking_context(&prim_info,
                                 webrender_api::ScrollPolicy::Scrollable,
                                 transform_binding,
                                 transform_style,
                                 perspective,
                                 mix_blend_mode,
@@ -1280,58 +1270,43 @@ pub extern "C" fn wr_dp_pop_clip_and_scr
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_iframe(state: &mut WrState,
                                     rect: LayoutRect,
                                     pipeline_id: WrPipelineId) {
     assert!(unsafe { is_in_main_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: None,
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::new(rect);
     state.frame_builder.dl_builder.push_iframe(&prim_info, pipeline_id);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_rect(state: &mut WrState,
                                   rect: LayoutRect,
                                   clip: LayoutRect,
                                   color: ColorF) {
     assert!(unsafe { !is_in_render_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder.dl_builder.push_rect(&prim_info,
                                              color);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_image(state: &mut WrState,
                                    bounds: LayoutRect,
                                    clip: LayoutRect,
                                    stretch_size: LayoutSize,
                                    tile_spacing: LayoutSize,
                                    image_rendering: ImageRendering,
                                    key: WrImageKey) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
     state.frame_builder
          .dl_builder
          .push_image(&prim_info,
                      stretch_size,
                      tile_spacing,
                      image_rendering,
                      key);
 }
@@ -1343,22 +1318,17 @@ pub extern "C" fn wr_dp_push_yuv_planar_
                                               clip: LayoutRect,
                                               image_key_0: WrImageKey,
                                               image_key_1: WrImageKey,
                                               image_key_2: WrImageKey,
                                               color_space: WrYuvColorSpace,
                                               image_rendering: ImageRendering) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
     state.frame_builder
          .dl_builder
          .push_yuv_image(&prim_info,
                          YuvData::PlanarYCbCr(image_key_0, image_key_1, image_key_2),
                          color_space,
                          image_rendering);
 }
 
@@ -1368,22 +1338,17 @@ pub extern "C" fn wr_dp_push_yuv_NV12_im
                                             bounds: LayoutRect,
                                             clip: LayoutRect,
                                             image_key_0: WrImageKey,
                                             image_key_1: WrImageKey,
                                             color_space: WrYuvColorSpace,
                                             image_rendering: ImageRendering) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
     state.frame_builder
          .dl_builder
          .push_yuv_image(&prim_info,
                          YuvData::NV12(image_key_0, image_key_1),
                          color_space,
                          image_rendering);
 }
 
@@ -1392,22 +1357,17 @@ pub extern "C" fn wr_dp_push_yuv_NV12_im
 pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
                                                    bounds: LayoutRect,
                                                    clip: LayoutRect,
                                                    image_key_0: WrImageKey,
                                                    color_space: WrYuvColorSpace,
                                                    image_rendering: ImageRendering) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
     state.frame_builder
          .dl_builder
          .push_yuv_image(&prim_info,
                          YuvData::InterleavedYCbCr(image_key_0),
                          color_space,
                          image_rendering);
 }
 
@@ -1419,44 +1379,34 @@ pub extern "C" fn wr_dp_push_text(state:
                                   font_key: WrFontInstanceKey,
                                   glyphs: *const GlyphInstance,
                                   glyph_count: u32,
                                   glyph_options: *const GlyphOptions) {
     assert!(unsafe { is_in_main_thread() });
 
     let glyph_slice = make_slice(glyphs, glyph_count as usize);
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
     state.frame_builder
          .dl_builder
          .push_text(&prim_info,
                     &glyph_slice,
                     font_key,
                     color,
                     unsafe { glyph_options.as_ref().cloned() });
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_text_shadow(state: &mut WrState,
                                          bounds: LayoutRect,
                                          clip: LayoutRect,
                                          shadow: TextShadow) {
     assert!(unsafe { is_in_main_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: bounds,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(bounds, clip.into());
     state.frame_builder.dl_builder.push_text_shadow(&prim_info, shadow.into());
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_pop_text_shadow(state: &mut WrState) {
     assert!(unsafe { is_in_main_thread() });
 
     state.frame_builder.dl_builder.pop_text_shadow();
@@ -1469,22 +1419,17 @@ pub extern "C" fn wr_dp_push_line(state:
                                   start: f32,
                                   end: f32,
                                   orientation: LineOrientation,
                                   width: f32,
                                   color: ColorF,
                                   style: LineStyle) {
     assert!(unsafe { is_in_main_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: LayoutRect::zero(),
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(LayoutRect::zero(), clip.into());
     state.frame_builder
          .dl_builder
          .push_line(&prim_info,
                     baseline,
                     start,
                     end,
                     orientation,
                     width,
@@ -1507,22 +1452,17 @@ pub extern "C" fn wr_dp_push_border(stat
 
     let border_details = BorderDetails::Normal(NormalBorder {
                                                    left: left.into(),
                                                    right: right.into(),
                                                    top: top.into(),
                                                    bottom: bottom.into(),
                                                    radius: radius.into(),
                                                });
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder
          .dl_builder
          .push_border(&prim_info,
                       widths,
                       border_details);
 }
 
 #[no_mangle]
@@ -1540,22 +1480,17 @@ pub extern "C" fn wr_dp_push_border_imag
         BorderDetails::Image(ImageBorder {
                                  image_key: image,
                                  patch: patch.into(),
                                  fill: false,
                                  outset: outset.into(),
                                  repeat_horizontal: repeat_horizontal.into(),
                                  repeat_vertical: repeat_vertical.into(),
                              });
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder
          .dl_builder
          .push_border(&prim_info,
                       widths.into(),
                       border_details);
 }
 
 #[no_mangle]
@@ -1579,22 +1514,17 @@ pub extern "C" fn wr_dp_push_border_grad
                                                          state.frame_builder
                                                               .dl_builder
                                                               .create_gradient(start_point.into(),
                                                                                end_point.into(),
                                                                                stops_vector,
                                                                                extend_mode.into()),
                                                      outset: outset.into(),
                                                  });
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder
          .dl_builder
          .push_border(&prim_info,
                       widths.into(),
                       border_details);
 }
 
 #[no_mangle]
@@ -1619,22 +1549,17 @@ pub extern "C" fn wr_dp_push_border_radi
                                               state.frame_builder
                                                    .dl_builder
                                                    .create_radial_gradient(center.into(),
                                                                            radius.into(),
                                                                            stops_vector,
                                                                            extend_mode.into()),
                                           outset: outset.into(),
                                       });
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder
          .dl_builder
          .push_border(&prim_info,
                       widths.into(),
                       border_details);
 }
 
 #[no_mangle]
@@ -1654,22 +1579,17 @@ pub extern "C" fn wr_dp_push_linear_grad
     let stops_vector = stops_slice.to_owned();
 
     let gradient = state.frame_builder
                         .dl_builder
                         .create_gradient(start_point.into(),
                                          end_point.into(),
                                          stops_vector,
                                          extend_mode.into());
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder
          .dl_builder
          .push_gradient(&prim_info,
                         gradient,
                         tile_size.into(),
                         tile_spacing.into());
 }
 
@@ -1690,22 +1610,17 @@ pub extern "C" fn wr_dp_push_radial_grad
     let stops_vector = stops_slice.to_owned();
 
     let gradient = state.frame_builder
                         .dl_builder
                         .create_radial_gradient(center.into(),
                                                 radius.into(),
                                                 stops_vector,
                                                 extend_mode.into());
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder
          .dl_builder
          .push_radial_gradient(&prim_info,
                                gradient,
                                tile_size,
                                tile_spacing);
 }
 
@@ -1717,22 +1632,17 @@ pub extern "C" fn wr_dp_push_box_shadow(
                                         offset: LayoutVector2D,
                                         color: ColorF,
                                         blur_radius: f32,
                                         spread_radius: f32,
                                         border_radius: f32,
                                         clip_mode: BoxShadowClipMode) {
     assert!(unsafe { is_in_main_thread() });
 
-    let prim_info = LayoutPrimitiveInfo {
-        rect: rect,
-        local_clip: Some(LocalClip::Rect(clip.into())),
-        is_backface_visible: true,
-    };
-
+    let prim_info = LayoutPrimitiveInfo::with_clip_rect(rect, clip.into());
     state.frame_builder
          .dl_builder
          .push_box_shadow(&prim_info,
                           box_bounds,
                           offset,
                           color,
                           blur_radius,
                           spread_radius,