Bug 1366502 - Update the thread checking for WR image functions. r=sotaro
authorJerryShih <hshih@mozilla.com>
Wed, 07 Jun 2017 23:44:03 +0800
changeset 413189 a03ce839ba8f11d0274f9e14fe17881db4559a28
parent 413188 fcf47ea8ae7bea4575b6dd5133e88ea806b9e693
child 413190 abac100c9ba4b5dc1f675ff0787e509cb0671fe3
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1366502
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1366502 - Update the thread checking for WR image functions. r=sotaro With the video pipeline, we could call the WR image functions in compositor thread. MozReview-Commit-ID: LtaihkLnbL3
gfx/webrender_bindings/src/bindings.rs
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1398,17 +1398,17 @@ pub extern "C" fn wr_dp_push_rect(state:
 #[no_mangle]
 pub extern "C" fn wr_dp_push_image(state: &mut WrState,
                                    bounds: WrRect,
                                    clip: WrClipRegionToken,
                                    stretch_size: WrSize,
                                    tile_spacing: WrSize,
                                    image_rendering: WrImageRendering,
                                    key: WrImageKey) {
-    assert!(unsafe { !is_in_render_thread() });
+    assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_image(bounds.into(),
                      clip.into(),
                      stretch_size.into(),
                      tile_spacing.into(),
                      image_rendering,
@@ -1420,17 +1420,17 @@ pub extern "C" fn wr_dp_push_image(state
 pub extern "C" fn wr_dp_push_yuv_planar_image(state: &mut WrState,
                                               bounds: WrRect,
                                               clip: WrClipRegionToken,
                                               image_key_0: WrImageKey,
                                               image_key_1: WrImageKey,
                                               image_key_2: WrImageKey,
                                               color_space: WrYuvColorSpace,
                                               image_rendering: WrImageRendering) {
-    assert!(unsafe { is_in_main_thread() });
+    assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(bounds.into(),
                          clip.into(),
                          YuvData::PlanarYCbCr(image_key_0, image_key_1, image_key_2),
                          color_space,
                          image_rendering);
@@ -1440,17 +1440,17 @@ pub extern "C" fn wr_dp_push_yuv_planar_
 #[no_mangle]
 pub extern "C" fn wr_dp_push_yuv_NV12_image(state: &mut WrState,
                                             bounds: WrRect,
                                             clip: WrClipRegionToken,
                                             image_key_0: WrImageKey,
                                             image_key_1: WrImageKey,
                                             color_space: WrYuvColorSpace,
                                             image_rendering: WrImageRendering) {
-    assert!(unsafe { is_in_main_thread() });
+    assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(bounds.into(),
                          clip.into(),
                          YuvData::NV12(image_key_0, image_key_1),
                          color_space,
                          image_rendering);
@@ -1459,17 +1459,17 @@ pub extern "C" fn wr_dp_push_yuv_NV12_im
 /// Push a yuv interleaved image.
 #[no_mangle]
 pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
                                                    bounds: WrRect,
                                                    clip: WrClipRegionToken,
                                                    image_key_0: WrImageKey,
                                                    color_space: WrYuvColorSpace,
                                                    image_rendering: WrImageRendering) {
-    assert!(unsafe { is_in_main_thread() });
+    assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
 
     state.frame_builder
          .dl_builder
          .push_yuv_image(bounds.into(),
                          clip.into(),
                          YuvData::InterleavedYCbCr(image_key_0),
                          color_space,
                          image_rendering);