Bug 1355590 - Fix WrClipRegion/WrRect mismatch in a couple of Rust FFI functions. r?mtseng draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 11 Apr 2017 15:58:30 -0400
changeset 560682 d7d832d92022908b82abb54c0f9ae851c93dabfb
parent 560681 6393339d9b953142773db1c4d88eb6372bd4b364
child 623784 3350ace88a45a161edc358ed56e2d504c3769e3e
push id53514
push userkgupta@mozilla.com
push dateTue, 11 Apr 2017 19:59:16 +0000
reviewersmtseng
bugs1355590
milestone55.0a1
Bug 1355590 - Fix WrClipRegion/WrRect mismatch in a couple of Rust FFI functions. r?mtseng MozReview-Commit-ID: 4gUyk4cRTAo
gfx/webrender_bindings/src/bindings.rs
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1291,59 +1291,57 @@ pub extern "C" fn wr_dp_push_border_imag
     state.frame_builder.dl_builder.push_border(
                                     rect.to_rect(),
                                     clip.to_clip_region(),
                                     widths.to_border_widths(),
                                     border_details);
 }
 
 #[no_mangle]
-pub extern "C" fn wr_dp_push_border_gradient(state: &mut WrState, rect: WrRect, clip: WrRect,
+pub extern "C" fn wr_dp_push_border_gradient(state: &mut WrState, rect: WrRect, clip: WrClipRegion,
                                              widths: WrBorderWidths,
                                              start_point: WrPoint, end_point: WrPoint,
                                              stops: *const WrGradientStop, stops_count: usize,
                                              extend_mode: WrGradientExtendMode,
                                              outset: WrSideOffsets2Df32) {
     assert!( unsafe { is_in_main_thread() });
     let stops = WrGradientStop::to_gradient_stops(unsafe { slice::from_raw_parts(stops, stops_count) });
-    let clip_region = state.frame_builder.dl_builder.new_clip_region(&clip.to_rect(), Vec::new(), None);
     let border_details = BorderDetails::Gradient(GradientBorder {
         gradient: state.frame_builder.dl_builder.create_gradient(
                       start_point.to_point(), end_point.to_point(),
                       stops, extend_mode.to_gradient_extend_mode()),
         outset: outset.to_side_offsets_2d(),
     });
     state.frame_builder.dl_builder.push_border(
                                     rect.to_rect(),
-                                    clip_region,
+                                    clip.to_clip_region(),
                                     widths.to_border_widths(),
                                     border_details);
 }
 
 #[no_mangle]
-pub extern "C" fn wr_dp_push_border_radial_gradient(state: &mut WrState, rect: WrRect, clip: WrRect,
+pub extern "C" fn wr_dp_push_border_radial_gradient(state: &mut WrState, rect: WrRect, clip: WrClipRegion,
                                                     widths: WrBorderWidths,
                                                     center: WrPoint,
                                                     radius: WrSize,
                                                     stops: *const WrGradientStop, stops_count: usize,
                                                     extend_mode: WrGradientExtendMode,
                                                     outset: WrSideOffsets2Df32) {
     assert!( unsafe { is_in_main_thread() });
     let stops = WrGradientStop::to_gradient_stops(unsafe { slice::from_raw_parts(stops, stops_count) });
-    let clip_region = state.frame_builder.dl_builder.new_clip_region(&clip.to_rect(), Vec::new(), None);
     let border_details = BorderDetails::RadialGradient(RadialGradientBorder {
         gradient: state.frame_builder.dl_builder.create_radial_gradient(center.to_point(),
                                                                         radius.to_size(),
                                                                         stops,
                                                                         extend_mode.to_gradient_extend_mode()),
         outset: outset.to_side_offsets_2d(),
     });
     state.frame_builder.dl_builder.push_border(
                                     rect.to_rect(),
-                                    clip_region,
+                                    clip.to_clip_region(),
                                     widths.to_border_widths(),
                                     border_details);
 }
 
 #[no_mangle]
 pub extern "C" fn wr_dp_push_linear_gradient(state: &mut WrState,
                                              rect: WrRect,
                                              clip: WrClipRegion,