[mq]: wr-mr-3
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 10 Jul 2017 06:01:25 -0400
changeset 1180205 242c2fc9b94cd298a69451214d300ae9e9224576
parent 1180204 21506bdbc05b0be640b6e5968782530ae3f384f9
child 1180206 420a0d9030875021e8d0fd8b64001045743dc466
push id203609
push userkgupta@mozilla.com
push dateMon, 10 Jul 2017 10:01:41 +0000
treeherdertry@0f002a9457df [default view] [failures only]
milestone56.0a1
[mq]: wr-mr-3 MozReview-Commit-ID: KMeBumpgDXL
gfx/webrender_bindings/src/bindings.rs
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1427,33 +1427,35 @@ pub extern "C" fn wr_dp_push_iframe(stat
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_rect(state: &mut WrState,
                                   rect: WrRect,
                                   clip: WrRect,
                                   color: WrColor) {
     assert!(unsafe { !is_in_render_thread() });
 
-    state.frame_builder.dl_builder.push_rect(rect.into(), clip.into(), color.into());
+    state.frame_builder.dl_builder.push_rect(rect.into(),
+                                             Some(LocalClip::Rect(clip.into())),
+                                             color.into());
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_image(state: &mut WrState,
                                    bounds: WrRect,
                                    clip: WrRect,
                                    stretch_size: WrSize,
                                    tile_spacing: WrSize,
                                    image_rendering: WrImageRendering,
                                    key: WrImageKey) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_image(bounds.into(),
-                     clip.into(),
+                     Some(LocalClip::Rect(clip.into())),
                      stretch_size.into(),
                      tile_spacing.into(),
                      image_rendering,
                      key);
 }
 
 /// Push a 3 planar yuv image.
 #[no_mangle]
@@ -1465,17 +1467,17 @@ pub extern "C" fn wr_dp_push_yuv_planar_
                                               image_key_2: WrImageKey,
                                               color_space: WrYuvColorSpace,
                                               image_rendering: WrImageRendering) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(bounds.into(),
-                         clip.into(),
+                         Some(LocalClip::Rect(clip.into())),
                          YuvData::PlanarYCbCr(image_key_0, image_key_1, image_key_2),
                          color_space,
                          image_rendering);
 }
 
 /// Push a 2 planar NV12 image.
 #[no_mangle]
 pub extern "C" fn wr_dp_push_yuv_NV12_image(state: &mut WrState,
@@ -1485,17 +1487,17 @@ pub extern "C" fn wr_dp_push_yuv_NV12_im
                                             image_key_1: WrImageKey,
                                             color_space: WrYuvColorSpace,
                                             image_rendering: WrImageRendering) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(bounds.into(),
-                         clip.into(),
+                         Some(LocalClip::Rect(clip.into())),
                          YuvData::NV12(image_key_0, image_key_1),
                          color_space,
                          image_rendering);
 }
 
 /// Push a yuv interleaved image.
 #[no_mangle]
 pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
@@ -1504,17 +1506,17 @@ pub extern "C" fn wr_dp_push_yuv_interle
                                                    image_key_0: WrImageKey,
                                                    color_space: WrYuvColorSpace,
                                                    image_rendering: WrImageRendering) {
     assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(bounds.into(),
-                         clip.into(),
+                         Some(LocalClip::Rect(clip.into())),
                          YuvData::InterleavedYCbCr(image_key_0),
                          color_space,
                          image_rendering);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_text(state: &mut WrState,
                                   bounds: WrRect,
@@ -1530,17 +1532,17 @@ pub extern "C" fn wr_dp_push_text(state:
     let glyph_vector: Vec<_> = glyph_slice.iter().map(|x| x.into()).collect();
 
     let colorf = ColorF::new(color.r, color.g, color.b, color.a);
 
     let glyph_options = None; // TODO
     state.frame_builder
          .dl_builder
          .push_text(bounds.into(),
-                    clip.into(),
+                    Some(LocalClip::Rect(clip.into())),
                     &glyph_vector,
                     font_key,
                     colorf,
                     Au::from_f32_px(glyph_size),
                     0.0,
                     glyph_options);
 }
 
@@ -1560,17 +1562,20 @@ pub extern "C" fn wr_dp_push_border(stat
                                                    left: left.into(),
                                                    right: right.into(),
                                                    top: top.into(),
                                                    bottom: bottom.into(),
                                                    radius: radius.into(),
                                                });
     state.frame_builder
          .dl_builder
-         .push_border(rect.into(), clip.into(), widths.into(), border_details);
+         .push_border(rect.into(),
+                      Some(LocalClip::Rect(clip.into())),
+                      widths.into(),
+                      border_details);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_border_image(state: &mut WrState,
                                           rect: WrRect,
                                           clip: WrRect,
                                           widths: WrBorderWidths,
                                           image: WrImageKey,
@@ -1585,17 +1590,20 @@ pub extern "C" fn wr_dp_push_border_imag
                                  patch: patch.into(),
                                  fill: false,
                                  outset: outset.into(),
                                  repeat_horizontal: repeat_horizontal.into(),
                                  repeat_vertical: repeat_vertical.into(),
                              });
     state.frame_builder
          .dl_builder
-         .push_border(rect.into(), clip.into(), widths.into(), border_details);
+         .push_border(rect.into(),
+                      Some(LocalClip::Rect(clip.into())),
+                      widths.into(),
+                      border_details);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_border_gradient(state: &mut WrState,
                                              rect: WrRect,
                                              clip: WrRect,
                                              widths: WrBorderWidths,
                                              start_point: WrPoint,
@@ -1616,17 +1624,20 @@ pub extern "C" fn wr_dp_push_border_grad
                                                               .create_gradient(start_point.into(),
                                                                                end_point.into(),
                                                                                stops_vector,
                                                                                extend_mode.into()),
                                                      outset: outset.into(),
                                                  });
     state.frame_builder
          .dl_builder
-         .push_border(rect.into(), clip.into(), widths.into(), border_details);
+         .push_border(rect.into(),
+                      Some(LocalClip::Rect(clip.into())),
+                      widths.into(),
+                      border_details);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_border_radial_gradient(state: &mut WrState,
                                                     rect: WrRect,
                                                     clip: WrRect,
                                                     widths: WrBorderWidths,
                                                     center: WrPoint,
@@ -1648,17 +1659,20 @@ pub extern "C" fn wr_dp_push_border_radi
                                                    .create_radial_gradient(center.into(),
                                                                            radius.into(),
                                                                            stops_vector,
                                                                            extend_mode.into()),
                                           outset: outset.into(),
                                       });
     state.frame_builder
          .dl_builder
-         .push_border(rect.into(), clip.into(), widths.into(), border_details);
+         .push_border(rect.into(),
+                      Some(LocalClip::Rect(clip.into())),
+                      widths.into(),
+                      border_details);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_linear_gradient(state: &mut WrState,
                                              rect: WrRect,
                                              clip: WrRect,
                                              start_point: WrPoint,
                                              end_point: WrPoint,
@@ -1673,22 +1687,23 @@ pub extern "C" fn wr_dp_push_linear_grad
     let stops_vector = stops_slice.iter().map(|x| x.into()).collect();
 
     let gradient = state.frame_builder
                         .dl_builder
                         .create_gradient(start_point.into(),
                                          end_point.into(),
                                          stops_vector,
                                          extend_mode.into());
-    let rect = rect.into();
-    let tile_size = tile_size.into();
-    let tile_spacing = tile_spacing.into();
     state.frame_builder
          .dl_builder
-         .push_gradient(rect, clip.into(), gradient, tile_size, tile_spacing);
+         .push_gradient(rect.into(),
+                        Some(LocalClip::Rect(clip.into())),
+                        gradient,
+                        tile_size.into(),
+                        tile_spacing.into());
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_radial_gradient(state: &mut WrState,
                                              rect: WrRect,
                                              clip: WrRect,
                                              center: WrPoint,
                                              radius: WrSize,
@@ -1703,22 +1718,23 @@ pub extern "C" fn wr_dp_push_radial_grad
     let stops_vector = stops_slice.iter().map(|x| x.into()).collect();
 
     let gradient = state.frame_builder
                         .dl_builder
                         .create_radial_gradient(center.into(),
                                                 radius.into(),
                                                 stops_vector,
                                                 extend_mode.into());
-    let rect = rect.into();
-    let tile_size = tile_size.into();
-    let tile_spacing = tile_spacing.into();
     state.frame_builder
          .dl_builder
-         .push_radial_gradient(rect, clip.into(), gradient, tile_size, tile_spacing);
+         .push_radial_gradient(rect.into(),
+                               Some(LocalClip::Rect(clip.into())),
+                               gradient,
+                               tile_size.into(),
+                               tile_spacing.into());
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_box_shadow(state: &mut WrState,
                                         rect: WrRect,
                                         clip: WrRect,
                                         box_bounds: WrRect,
                                         offset: WrPoint,
@@ -1727,17 +1743,17 @@ pub extern "C" fn wr_dp_push_box_shadow(
                                         spread_radius: f32,
                                         border_radius: f32,
                                         clip_mode: WrBoxShadowClipMode) {
     assert!(unsafe { is_in_main_thread() });
 
     state.frame_builder
          .dl_builder
          .push_box_shadow(rect.into(),
-                          clip.into(),
+                          Some(LocalClip::Rect(clip.into())),
                           box_bounds.into(),
                           offset.into(),
                           color.into(),
                           blur_radius,
                           spread_radius,
                           border_radius,
                           clip_mode);
 }