Bug 1359738 - Add push_yuv_image() in WR binding.

Please check [1] for webrender_ffi_generated.h updates.

[1]
https://dxr.mozilla.org/mozilla-central/rev/f229b7e5d91eb70d23d3e31db7caff9d69a2ef04/gfx/webrender_bindings/webrender_ffi_generated.h#7

MozReview-Commit-ID: 3PolFzfQB0l
This commit is contained in:
JerryShih 2017-04-27 15:08:20 +08:00
Родитель e00af8354a
Коммит 51510de95b
2 изменённых файлов: 45 добавлений и 3 удалений

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

@ -49,6 +49,8 @@ type WrPipelineId = PipelineId;
type WrImageKey = ImageKey; type WrImageKey = ImageKey;
/// cbindgen:field-names=[mNamespace, mHandle] /// cbindgen:field-names=[mNamespace, mHandle]
type WrFontKey = FontKey; type WrFontKey = FontKey;
/// cbindgen:field-names=[mNamespace, mHandle]
type WrYuvColorSpace = YuvColorSpace;
/// cbindgen:field-names=[mHandle] /// cbindgen:field-names=[mHandle]
#[repr(C)] #[repr(C)]
@ -1328,11 +1330,9 @@ pub extern "C" fn wr_dp_push_image(state: &mut WrState,
key: WrImageKey) { key: WrImageKey) {
assert!(unsafe { is_in_main_thread() }); assert!(unsafe { is_in_main_thread() });
let bounds = bounds.into();
state.frame_builder state.frame_builder
.dl_builder .dl_builder
.push_image(bounds, .push_image(bounds.into(),
clip.into(), clip.into(),
stretch_size.into(), stretch_size.into(),
tile_spacing.into(), tile_spacing.into(),
@ -1340,6 +1340,32 @@ pub extern "C" fn wr_dp_push_image(state: &mut WrState,
key); key);
} }
#[no_mangle]
pub extern "C" fn wr_dp_push_yuv_image(state: &mut WrState,
bounds: WrRect,
clip: WrClipRegion,
image_keys: *const WrImageKey,
key_num: u8,
color_space: WrYuvColorSpace) {
assert!(unsafe { is_in_main_thread() });
assert!(key_num == 3);
unsafe {
for key_index in 0..key_num {
assert!(!image_keys.offset(key_index as isize).is_null());
}
}
let key_slice = make_slice(image_keys, key_num as usize);
state.frame_builder
.dl_builder
.push_yuv_image(bounds.into(),
clip.into(),
key_slice[0],
key_slice[1],
key_slice[2],
color_space);
}
#[no_mangle] #[no_mangle]
pub extern "C" fn wr_dp_push_text(state: &mut WrState, pub extern "C" fn wr_dp_push_text(state: &mut WrState,
bounds: WrRect, bounds: WrRect,

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

@ -94,6 +94,13 @@ enum class WrRepeatMode : uint32_t {
Sentinel /* this must be last for serialization purposes. */ Sentinel /* this must be last for serialization purposes. */
}; };
enum class WrYuvColorSpace : uint32_t {
Rec601 = 1,
Rec709 = 2,
Sentinel /* this must be last for serialization purposes. */
};
struct WrAPI; struct WrAPI;
struct WrImageKey { struct WrImageKey {
@ -805,6 +812,15 @@ wr_dp_push_text(WrState* state,
float glyph_size) float glyph_size)
WR_FUNC; WR_FUNC;
WR_INLINE void
wr_dp_push_yuv_image(WrState* state,
WrRect bounds,
WrClipRegion clip,
const WrImageKey* image_keys,
uint8_t key_num,
WrYuvColorSpace color_space)
WR_FUNC;
WR_INLINE void WR_INLINE void
wr_rendered_epochs_delete(WrRenderedEpochs* pipeline_epochs) wr_rendered_epochs_delete(WrRenderedEpochs* pipeline_epochs)
WR_DESTRUCTOR_SAFE_FUNC; WR_DESTRUCTOR_SAFE_FUNC;