From 8318f4c8051f361b1413e549c6b723f5dd80ad18 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Tue, 11 Apr 2017 22:17:02 -0400 Subject: [PATCH] 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 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gfx/webrender_bindings/src/bindings.rs b/gfx/webrender_bindings/src/bindings.rs index f04f12cd3c76..6469a68eb562 100644 --- a/gfx/webrender_bindings/src/bindings.rs +++ b/gfx/webrender_bindings/src/bindings.rs @@ -1275,7 +1275,7 @@ pub extern "C" fn wr_dp_push_border_image(state: &mut WrState, } #[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, @@ -1283,7 +1283,6 @@ pub extern "C" fn wr_dp_push_border_gradient(state: &mut WrState, rect: WrRect, 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(), @@ -1292,13 +1291,13 @@ pub extern "C" fn wr_dp_push_border_gradient(state: &mut WrState, rect: WrRect, }); 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, @@ -1307,7 +1306,6 @@ pub extern "C" fn wr_dp_push_border_radial_gradient(state: &mut WrState, rect: W 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(), @@ -1317,7 +1315,7 @@ pub extern "C" fn wr_dp_push_border_radial_gradient(state: &mut WrState, rect: W }); state.frame_builder.dl_builder.push_border( rect.to_rect(), - clip_region, + clip.to_clip_region(), widths.to_border_widths(), border_details); }