Bug 1419440 - Update for API change in WR PR 2082. r?mstange draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 23 Nov 2017 09:40:00 -0500
changeset 702648 751a68a8e4bfb3f37dc20e1256adefe44fd2b8ea
parent 702647 f032c59b8b05b48bba404ff898b79f4e687e0811
child 741544 40ebae13af8a32868325c043a453f61767faeebc
push id90567
push userkgupta@mozilla.com
push dateThu, 23 Nov 2017 14:44:35 +0000
reviewersmstange
bugs1419440
milestone59.0a1
Bug 1419440 - Update for API change in WR PR 2082. r?mstange MozReview-Commit-ID: LA846SceCWX
gfx/src/CompositorHitTestInfo.h
gfx/webrender_bindings/WebRenderAPI.cpp
gfx/webrender_bindings/src/bindings.rs
gfx/webrender_bindings/webrender_ffi_generated.h
--- a/gfx/src/CompositorHitTestInfo.h
+++ b/gfx/src/CompositorHitTestInfo.h
@@ -12,17 +12,17 @@
 namespace mozilla {
 namespace gfx {
 
 // This set of flags is used to figure out what information a frame has
 // that is relevant to hit-testing in the compositor. The flags are
 // intentionally set up so that if all of them are 0 the item is effectively
 // invisible to hit-testing, and no information for this frame needs to be
 // sent to the compositor.
-enum class CompositorHitTestInfo : uint8_t {
+enum class CompositorHitTestInfo : uint16_t {
   // Shortcut for checking that none of the flags are set
   eInvisibleToHitTest = 0,
 
   // The frame participates in hit-testing
   eVisibleToHitTest = 1 << 0,
   // The frame requires main-thread handling for events
   eDispatchToContent = 1 << 1,
 
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -222,20 +222,20 @@ WebRenderAPI::UpdateScrollPosition(const
 }
 
 bool
 WebRenderAPI::HitTest(const wr::WorldPoint& aPoint,
                       wr::WrPipelineId& aOutPipelineId,
                       layers::FrameMetrics::ViewID& aOutScrollId,
                       gfx::CompositorHitTestInfo& aOutHitInfo)
 {
-  static_assert(sizeof(gfx::CompositorHitTestInfo) == sizeof(uint8_t),
-                "CompositorHitTestInfo should be u8-sized");
+  static_assert(sizeof(gfx::CompositorHitTestInfo) == sizeof(uint16_t),
+                "CompositorHitTestInfo should be u16-sized");
   return wr_api_hit_test(mDocHandle, aPoint,
-          &aOutPipelineId, &aOutScrollId, (uint8_t*)&aOutHitInfo);
+          &aOutPipelineId, &aOutScrollId, (uint16_t*)&aOutHitInfo);
 }
 
 void
 WebRenderAPI::GenerateFrame()
 {
   wr_api_generate_frame(mDocHandle);
 }
 
@@ -1258,19 +1258,19 @@ DisplayListBuilder::TopmostIsClip()
   }
   return mClipStack.back().is<wr::WrClipId>();
 }
 
 void
 DisplayListBuilder::SetHitTestInfo(const layers::FrameMetrics::ViewID& aScrollId,
                                    gfx::CompositorHitTestInfo aHitInfo)
 {
-  static_assert(sizeof(gfx::CompositorHitTestInfo) == sizeof(uint8_t),
-                "CompositorHitTestInfo should be u8-sized");
-  wr_set_item_tag(mWrState, aScrollId, static_cast<uint8_t>(aHitInfo));
+  static_assert(sizeof(gfx::CompositorHitTestInfo) == sizeof(uint16_t),
+                "CompositorHitTestInfo should be u16-sized");
+  wr_set_item_tag(mWrState, aScrollId, static_cast<uint16_t>(aHitInfo));
 }
 
 void
 DisplayListBuilder::ClearHitTestInfo()
 {
   wr_clear_item_tag(mWrState);
 }
 
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1928,31 +1928,31 @@ pub unsafe extern "C" fn wr_api_finalize
     let (data, descriptor) = dl.into_data();
     *dl_data = WrVecU8::from_vec(data);
     *dl_descriptor = descriptor;
 }
 
 #[no_mangle]
 pub extern "C" fn wr_set_item_tag(state: &mut WrState,
                                   scroll_id: u64,
-                                  hit_info: u8) {
+                                  hit_info: u16) {
     state.current_tag = Some((scroll_id, hit_info));
 }
 
 #[no_mangle]
 pub extern "C" fn wr_clear_item_tag(state: &mut WrState) {
     state.current_tag = None;
 }
 
 #[no_mangle]
 pub extern "C" fn wr_api_hit_test(dh: &mut DocumentHandle,
                                   point: WorldPoint,
                                   out_pipeline_id: &mut WrPipelineId,
                                   out_scroll_id: &mut u64,
-                                  out_hit_info: &mut u8) -> bool {
+                                  out_hit_info: &mut u16) -> bool {
     let result = dh.api.hit_test(dh.document_id, None, point, HitTestFlags::empty());
     for item in &result.items {
         // For now we should never be getting results back for which the tag is
         // 0 (== CompositorHitTestInfo::eInvisibleToHitTest). In the future if
         // we allow this, we'll want to |continue| on the loop in this scenario.
         debug_assert!(item.tag.1 != 0);
         *out_pipeline_id = item.pipeline;
         *out_scroll_id = item.tag.0;
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -1039,17 +1039,17 @@ WR_INLINE
 WrIdNamespace wr_api_get_namespace(DocumentHandle *aDh)
 WR_FUNC;
 
 WR_INLINE
 bool wr_api_hit_test(DocumentHandle *aDh,
                      WorldPoint aPoint,
                      WrPipelineId *aOutPipelineId,
                      uint64_t *aOutScrollId,
-                     uint8_t *aOutHitInfo)
+                     uint16_t *aOutHitInfo)
 WR_FUNC;
 
 WR_INLINE
 void wr_api_remove_pipeline(DocumentHandle *aDh,
                             WrPipelineId aPipelineId)
 WR_FUNC;
 
 WR_INLINE
@@ -1568,17 +1568,17 @@ void wr_scroll_layer_with_id(DocumentHan
                              WrPipelineId aPipelineId,
                              uint64_t aScrollId,
                              LayoutPoint aNewScrollOrigin)
 WR_FUNC;
 
 WR_INLINE
 void wr_set_item_tag(WrState *aState,
                      uint64_t aScrollId,
-                     uint8_t aHitInfo)
+                     uint16_t aHitInfo)
 WR_FUNC;
 
 WR_INLINE
 void wr_shutdown_external_log_handler()
 WR_FUNC;
 
 WR_INLINE
 void wr_state_delete(WrState *aState)