Bug 1387301 - webrender_bindings: Remove a bunch of now unneeded into()s. r=kats

This commit is contained in:
Jeff Muizelaar 2017-08-03 16:36:38 -04:00
Родитель d9c7901124
Коммит 7d06275014
2 изменённых файлов: 26 добавлений и 31 удалений

Просмотреть файл

@ -785,7 +785,7 @@ pub unsafe extern "C" fn wr_api_set_root_display_list(dh: &mut DocumentHandle,
let color = if color.a == 0.0 {
None
} else {
Some(color.into())
Some(color)
};
// See the documentation of set_display_list in api.rs. I don't think
// it makes a difference in gecko at the moment(until APZ is figured out)
@ -802,7 +802,7 @@ pub unsafe extern "C" fn wr_api_set_root_display_list(dh: &mut DocumentHandle,
epoch,
color,
LayoutSize::new(viewport_width, viewport_height),
(pipeline_id, content_size.into(), dl),
(pipeline_id, content_size, dl),
preserve_frame_state,
ResourceUpdates::new());
}
@ -929,7 +929,7 @@ impl WebRenderFrameBuilder {
content_size: LayoutSize) -> WebRenderFrameBuilder {
WebRenderFrameBuilder {
root_pipeline_id: root_pipeline_id,
dl_builder: webrender_api::DisplayListBuilder::new(root_pipeline_id, content_size.into()),
dl_builder: webrender_api::DisplayListBuilder::new(root_pipeline_id, content_size),
scroll_clips_defined: HashSet::new(),
}
}
@ -1004,8 +1004,6 @@ pub extern "C" fn wr_dp_push_stacking_context(state: &mut WrState,
filter_count: usize) {
assert!(unsafe { !is_in_render_thread() });
let bounds = bounds.into();
let c_filters = make_slice(filters, filter_count);
let mut filters : Vec<FilterOp> = c_filters.iter().map(|c_filter| {
match c_filter.filter_type {
@ -1063,13 +1061,12 @@ pub extern "C" fn wr_dp_pop_stacking_context(state: &mut WrState) {
#[no_mangle]
pub extern "C" fn wr_dp_define_clip(state: &mut WrState,
rect: LayoutRect,
clip_rect: LayoutRect,
complex: *const WrComplexClipRegion,
complex_count: usize,
mask: *const WrImageMask)
-> u64 {
assert!(unsafe { is_in_main_thread() });
let clip_rect: LayoutRect = rect.into();
let complex_slice = make_slice(complex, complex_count);
let complex_iter = complex_slice.iter().map(|x| x.into());
let mask : Option<ImageMask> = unsafe { mask.as_ref() }.map(|x| x.into());
@ -1109,8 +1106,6 @@ pub extern "C" fn wr_dp_push_scroll_layer(state: &mut WrState,
// Avoid defining multiple scroll clips with the same clip id, as that
// results in undefined behaviour or assertion failures.
if !state.frame_builder.scroll_clips_defined.contains(&clip_id) {
let content_rect: LayoutRect = content_rect.into();
let clip_rect: LayoutRect = clip_rect.into();
state.frame_builder.dl_builder.define_scroll_frame(
Some(clip_id), content_rect, clip_rect, vec![], None,
@ -1133,7 +1128,7 @@ pub extern "C" fn wr_scroll_layer_with_id(dh: &mut DocumentHandle,
new_scroll_origin: LayoutPoint) {
assert!(unsafe { is_in_compositor_thread() });
let clip_id = ClipId::new(scroll_id, pipeline_id);
dh.api.scroll_node_with_id(dh.document_id, new_scroll_origin.into(), clip_id, ScrollClamping::NoClamping);
dh.api.scroll_node_with_id(dh.document_id, new_scroll_origin, clip_id, ScrollClamping::NoClamping);
}
#[no_mangle]
@ -1164,7 +1159,7 @@ pub extern "C" fn wr_dp_push_iframe(state: &mut WrState,
pipeline_id: WrPipelineId) {
assert!(unsafe { is_in_main_thread() });
state.frame_builder.dl_builder.push_iframe(rect.into(), None, pipeline_id);
state.frame_builder.dl_builder.push_iframe(rect, None, pipeline_id);
}
#[no_mangle]
@ -1174,9 +1169,9 @@ pub extern "C" fn wr_dp_push_rect(state: &mut WrState,
color: ColorF) {
assert!(unsafe { !is_in_render_thread() });
state.frame_builder.dl_builder.push_rect(rect.into(),
Some(LocalClip::Rect(clip.into())),
color.into());
state.frame_builder.dl_builder.push_rect(rect,
Some(LocalClip::Rect(clip)),
color);
}
#[no_mangle]
@ -1191,10 +1186,10 @@ pub extern "C" fn wr_dp_push_image(state: &mut WrState,
state.frame_builder
.dl_builder
.push_image(bounds.into(),
Some(LocalClip::Rect(clip.into())),
stretch_size.into(),
tile_spacing.into(),
.push_image(bounds,
Some(LocalClip::Rect(clip)),
stretch_size,
tile_spacing,
image_rendering,
key);
}
@ -1213,7 +1208,7 @@ pub extern "C" fn wr_dp_push_yuv_planar_image(state: &mut WrState,
state.frame_builder
.dl_builder
.push_yuv_image(bounds.into(),
.push_yuv_image(bounds,
Some(LocalClip::Rect(clip.into())),
YuvData::PlanarYCbCr(image_key_0, image_key_1, image_key_2),
color_space,
@ -1233,7 +1228,7 @@ pub extern "C" fn wr_dp_push_yuv_NV12_image(state: &mut WrState,
state.frame_builder
.dl_builder
.push_yuv_image(bounds.into(),
.push_yuv_image(bounds,
Some(LocalClip::Rect(clip.into())),
YuvData::NV12(image_key_0, image_key_1),
color_space,
@ -1252,7 +1247,7 @@ pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
state.frame_builder
.dl_builder
.push_yuv_image(bounds.into(),
.push_yuv_image(bounds,
Some(LocalClip::Rect(clip.into())),
YuvData::InterleavedYCbCr(image_key_0),
color_space,
@ -1277,7 +1272,7 @@ pub extern "C" fn wr_dp_push_text(state: &mut WrState,
let glyph_options = None; // TODO
state.frame_builder
.dl_builder
.push_text(bounds.into(),
.push_text(bounds,
Some(LocalClip::Rect(clip.into())),
&glyph_slice,
font_key,
@ -1307,9 +1302,9 @@ pub extern "C" fn wr_dp_push_border(state: &mut WrState,
});
state.frame_builder
.dl_builder
.push_border(rect.into(),
.push_border(rect,
Some(LocalClip::Rect(clip.into())),
widths.into(),
widths,
border_details);
}
@ -1465,11 +1460,11 @@ pub extern "C" fn wr_dp_push_radial_gradient(state: &mut WrState,
extend_mode.into());
state.frame_builder
.dl_builder
.push_radial_gradient(rect.into(),
.push_radial_gradient(rect,
Some(LocalClip::Rect(clip.into())),
gradient,
tile_size.into(),
tile_spacing.into());
tile_size,
tile_spacing);
}
#[no_mangle]
@ -1487,11 +1482,11 @@ pub extern "C" fn wr_dp_push_box_shadow(state: &mut WrState,
state.frame_builder
.dl_builder
.push_box_shadow(rect.into(),
.push_box_shadow(rect,
Some(LocalClip::Rect(clip.into())),
box_bounds.into(),
box_bounds,
offset,
color.into(),
color,
blur_radius,
spread_radius,
border_radius,

Просмотреть файл

@ -774,7 +774,7 @@ WR_FUNC;
WR_INLINE
uint64_t wr_dp_define_clip(WrState *aState,
LayoutRect aRect,
LayoutRect aClipRect,
const WrComplexClipRegion *aComplex,
size_t aComplexCount,
const WrImageMask *aMask)