return remote_buffer;
}
+
+EINTERN unsigned int
+e_comp_wl_tbm_aligned_width_get(tbm_surface_h tsurface)
+{
+ unsigned int aligned_width = 0;
+ tbm_surface_info_s surf_info;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(tsurface, 0);
+
+ tbm_surface_get_info(tsurface, &surf_info);
+
+ switch (surf_info.format)
+ {
+ case TBM_FORMAT_YUV420:
+ case TBM_FORMAT_YVU420:
+ case TBM_FORMAT_YUV422:
+ case TBM_FORMAT_YVU422:
+ case TBM_FORMAT_NV12:
+ case TBM_FORMAT_NV21:
+ aligned_width = surf_info.planes[0].stride;
+ break;
+ case TBM_FORMAT_YUYV:
+ case TBM_FORMAT_UYVY:
+ aligned_width = surf_info.planes[0].stride >> 1;
+ break;
+ case TBM_FORMAT_XRGB8888:
+ case TBM_FORMAT_XBGR8888:
+ case TBM_FORMAT_RGBX8888:
+ case TBM_FORMAT_BGRX8888:
+ case TBM_FORMAT_ARGB8888:
+ case TBM_FORMAT_ABGR8888:
+ case TBM_FORMAT_RGBA8888:
+ case TBM_FORMAT_BGRA8888:
+ case TBM_FORMAT_XRGB2101010:
+ case TBM_FORMAT_XBGR2101010:
+ case TBM_FORMAT_RGBX1010102:
+ case TBM_FORMAT_BGRX1010102:
+ case TBM_FORMAT_ARGB2101010:
+ case TBM_FORMAT_ABGR2101010:
+ case TBM_FORMAT_RGBA1010102:
+ case TBM_FORMAT_BGRA1010102:
+ aligned_width = surf_info.planes[0].stride >> 2;
+ break;
+ default:
+ ERR("not supported format: %c%c%c%c", FOURCC_STR(surf_info.format));
+ }
+
+ return aligned_width;
+}
EINTERN struct wl_resource *e_comp_wl_tbm_remote_buffer_get(struct wl_resource *wl_tbm, struct wl_resource *wl_buffer);
EINTERN struct wl_resource *e_comp_wl_tbm_remote_buffer_get_with_tbm(struct wl_resource *wl_tbm, tbm_surface_h tbm_surface);
+EINTERN unsigned int e_comp_wl_tbm_aligned_width_get(tbm_surface_h tsurface);
+
E_API Eina_Bool e_comp_wl_tbm_module_func_set(const char *module_name, E_Comp_Wl_Tbm_Funcs *fn);
E_API Eina_Bool e_comp_wl_tbm_module_func_unset(void);
return composition_type;
}
-static unsigned int
-_get_aligned_width(tbm_surface_h tsurface)
-{
- unsigned int aligned_width = 0;
- tbm_surface_info_s surf_info;
-
- tbm_surface_get_info(tsurface, &surf_info);
-
- switch (surf_info.format)
- {
- case TBM_FORMAT_YUV420:
- case TBM_FORMAT_YVU420:
- case TBM_FORMAT_YUV422:
- case TBM_FORMAT_YVU422:
- case TBM_FORMAT_NV12:
- case TBM_FORMAT_NV21:
- aligned_width = surf_info.planes[0].stride;
- break;
- case TBM_FORMAT_YUYV:
- case TBM_FORMAT_UYVY:
- aligned_width = surf_info.planes[0].stride >> 1;
- break;
- case TBM_FORMAT_ARGB8888:
- case TBM_FORMAT_XRGB8888:
- aligned_width = surf_info.planes[0].stride >> 2;
- break;
- default:
- EHWERR("not supported format: %x", NULL, NULL, NULL, surf_info.format);
- }
-
- return aligned_width;
-}
-
static void
_e_hwc_window_buffer_cb_queue_destroy(struct wl_listener *listener, void *data)
{
hwc_win_info->src_config.pos.w = surf_info.width;
hwc_win_info->src_config.pos.h = surf_info.height;
- hwc_win_info->src_config.size.h = _get_aligned_width(tsurface);
+ hwc_win_info->src_config.size.h = e_comp_wl_tbm_aligned_width_get(tsurface);
EINA_SAFETY_ON_TRUE_RETURN_VAL(hwc_win_info->src_config.size.h == 0, EINA_FALSE);
hwc_win_info->src_config.size.v = surf_info.height;
hwc_win_info->src_config.pos.w = surf_info.width;
hwc_win_info->src_config.pos.h = surf_info.height;
- hwc_win_info->src_config.size.h = _get_aligned_width(tsurface);
+ hwc_win_info->src_config.size.h = e_comp_wl_tbm_aligned_width_get(tsurface);
EINA_SAFETY_ON_TRUE_RETURN_VAL(hwc_win_info->src_config.size.h == 0, EINA_FALSE);
hwc_win_info->src_config.size.v = surf_info.height;
return hwc_mode;
}
-static unsigned int
-_e_hwc_windows_aligned_width_get(tbm_surface_h tsurface)
-{
- unsigned int aligned_width = 0;
- tbm_surface_info_s surf_info;
-
- tbm_surface_get_info(tsurface, &surf_info);
-
- switch (surf_info.format)
- {
- case TBM_FORMAT_YUV420:
- case TBM_FORMAT_YVU420:
- case TBM_FORMAT_YUV422:
- case TBM_FORMAT_YVU422:
- case TBM_FORMAT_NV12:
- case TBM_FORMAT_NV21:
- aligned_width = surf_info.planes[0].stride;
- break;
- case TBM_FORMAT_YUYV:
- case TBM_FORMAT_UYVY:
- aligned_width = surf_info.planes[0].stride >> 1;
- break;
- case TBM_FORMAT_ARGB8888:
- case TBM_FORMAT_XRGB8888:
- aligned_width = surf_info.planes[0].stride >> 2;
- break;
- default:
- EHWSERR("not supported format: %x", NULL, surf_info.format);
- }
-
- return aligned_width;
-}
-
static void
_e_hwc_windows_comp_info_rendered_buffers_set(E_Hwc_Windows_Comp_Info *comp_info,
Eina_List *rendered_buffers)
(!memcmp(&hwc->pp_set_dst_rect, dst_rect, sizeof(Eina_Rectangle))))
return EINA_TRUE;
- aligned_width_src = _e_hwc_windows_aligned_width_get(src);
+ aligned_width_src = e_comp_wl_tbm_aligned_width_get(src);
EINA_SAFETY_ON_FALSE_RETURN_VAL(aligned_width_src != 0, EINA_FALSE);
- aligned_width_dst = _e_hwc_windows_aligned_width_get(dst);
+ aligned_width_dst = e_comp_wl_tbm_aligned_width_get(dst);
EINA_SAFETY_ON_FALSE_RETURN_VAL(aligned_width_dst != 0, EINA_FALSE);
pp_info.src_config.size.h = aligned_width_src;
static void _e_output_stream_capture_mask_image_activate(E_Output *output);
static void _e_output_stream_capture_mask_image_deactivate(E_Output *output);
-static unsigned int
-_e_output_aligned_width_get(E_Output *output, tbm_surface_h tsurface)
-{
- unsigned int aligned_width = 0;
- tbm_surface_info_s surf_info;
-
- tbm_surface_get_info(tsurface, &surf_info);
-
- switch (surf_info.format)
- {
- case TBM_FORMAT_YUV420:
- case TBM_FORMAT_YVU420:
- case TBM_FORMAT_YUV422:
- case TBM_FORMAT_YVU422:
- case TBM_FORMAT_NV12:
- case TBM_FORMAT_NV21:
- aligned_width = surf_info.planes[0].stride;
- break;
- case TBM_FORMAT_YUYV:
- case TBM_FORMAT_UYVY:
- aligned_width = surf_info.planes[0].stride >> 1;
- break;
- case TBM_FORMAT_ARGB8888:
- case TBM_FORMAT_XRGB8888:
- aligned_width = surf_info.planes[0].stride >> 2;
- break;
- default:
- EOERR("not supported format: %x", output, surf_info.format);
- }
-
- return aligned_width;
-}
-
static inline void
_e_output_display_mode_set(E_Output *output, E_Output_Display_Mode display_mode)
{
tbm_error = tbm_surface_get_info(tsurface, &surf_info);
EINA_SAFETY_ON_FALSE_RETURN_VAL(tbm_error == TBM_ERROR_NONE, EINA_FALSE);
- width = _e_output_aligned_width_get(output, tsurface);
+ width = e_comp_wl_tbm_aligned_width_get(tsurface);
EINA_SAFETY_ON_TRUE_RETURN_VAL(width == 0, EINA_FALSE);
memset(&capture_info, 0, sizeof(tdm_info_capture));