зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1319284 - create a WR imageKey from an external texture. r=nical?
add wr_add_external_image_texture() func to create a WR imageKey from an external texture. MozReview-Commit-ID: DJUsd15EKlw
This commit is contained in:
Родитель
7279a0ba4e
Коммит
3ba2bba5f2
|
@ -470,6 +470,11 @@ pub extern fn wr_add_image(window: &mut WrWindowState, width: u32, height: u32,
|
|||
window.api.add_image(width, height, stride_option, format, ImageData::new(bytes))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn wr_add_external_image_texture(window: &mut WrWindowState, width: u32, height: u32, format: ImageFormat, external_image_id: u64) -> ImageKey {
|
||||
window.api.add_image(width, height, None, format, ImageData::External(ExternalImageId(external_image_id)))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn wr_update_image(window: &mut WrWindowState, key: ImageKey, width: u32, height: u32, format: ImageFormat, bytes: * const u8, size: usize) {
|
||||
let bytes = unsafe { slice::from_raw_parts(bytes, size).to_owned() };
|
||||
|
|
|
@ -111,6 +111,17 @@ wr_add_image(wrwindowstate* wrWindow, uint32_t width, uint32_t height,
|
|||
uint32_t stride, WRImageFormat format, uint8_t *bytes, size_t size)
|
||||
WR_FUNC;
|
||||
|
||||
WR_INLINE WRImageKey
|
||||
wr_add_external_image_texture(wrwindowstate* wrWindow, uint32_t width, uint32_t height,
|
||||
WRImageFormat format, uint64_t external_image_id)
|
||||
WR_FUNC;
|
||||
|
||||
//TODO(Jerry): handle shmem in WR
|
||||
//// WR_INLINE WRImageKey
|
||||
//// wr_add_external_image_buffer(wrwindowstate* wrWindow, uint32_t width, uint32_t height,
|
||||
//// uint32_t stride, WRImageFormat format, uint8_t *bytes, size_t size)
|
||||
//// WR_FUNC;
|
||||
|
||||
WR_INLINE void
|
||||
wr_update_image(wrwindowstate* wrWindow, WRImageKey key,
|
||||
uint32_t width, uint32_t height,
|
||||
|
|
Загрузка…
Ссылка в новой задаче