Eina_Rectangle output_r; /* video plane rect in physical output coordinates */
uint transform; /* rotate, flip in physical output coordinates */
} tdm;
+
+ Eina_Bool is_viewport_offscreen;
};
struct _E_Video_Hwc
output_rect = &in_out->tdm.output_r;
screen_rect = _screen_rect_get(zone, output_transform);
- /* No need to crop in case output region doesn't stick out of screen region. */
- if (E_CONTAINS(screen_rect.x, screen_rect.y,
- screen_rect.w, screen_rect.h,
- output_rect->x, output_rect->y,
- output_rect->w, output_rect->h))
- return;
-
- EINA_RECTANGLE_SET(&cropped_output_rect,
- output_rect->x, output_rect->y,
- output_rect->w, output_rect->h);
- if (!eina_rectangle_intersection(&cropped_output_rect, &screen_rect))
+ in_out->is_viewport_offscreen = !E_INTERSECTS(screen_rect.x, screen_rect.y,
+ screen_rect.w, screen_rect.h,
+ output_rect->x, output_rect->y,
+ output_rect->w, output_rect->h);
+ if (in_out->is_viewport_offscreen)
{
VER("Video won't be displayed because there is no intersection between "
"screen region and output region.\n"
return;
}
+ /* No need to crop in case output region doesn't stick out of screen region. */
+ if (E_CONTAINS(screen_rect.x, screen_rect.y,
+ screen_rect.w, screen_rect.h,
+ output_rect->x, output_rect->y,
+ output_rect->w, output_rect->h))
+ return;
+
VIN("Crop video viewport by screen", NULL);
VIN("Screen(%d,%d %dx%d)", NULL, EINA_RECTANGLE_ARGS(&screen_rect));
VIN("Viewport: source of buffer(%d,%d %dx%d) destination of screen(%d,%d %dx%d)",
NULL, EINA_RECTANGLE_ARGS(buffer_rect), EINA_RECTANGLE_ARGS(output_rect));
+ EINA_RECTANGLE_SET(&cropped_output_rect,
+ output_rect->x, output_rect->y,
+ output_rect->w, output_rect->h);
+ assert(eina_rectangle_intersection(&cropped_output_rect, &screen_rect) == EINA_TRUE);
+
_rect_to_points(&cropped_output_rect, points);
/* Get points of cropped rectangle mapped on output_rect-local coordinates. */
return evh->commit_data.buffer;
}
+static Eina_Bool
+_e_video_hwc_iface_is_viewport_offscreen(E_Video_Comp_Iface *iface)
+{
+ IFACE_ENTRY;
+
+ return evh->geo.is_viewport_offscreen;
+}
+
static E_Video_Hwc *
_e_video_hwc_create(E_Client *ec)
{
evh->iface.info_get = _e_video_hwc_iface_info_get;
evh->iface.commit_data_release = _e_video_hwc_iface_commit_data_release;
evh->iface.tbm_surface_get = _e_video_hwc_iface_tbm_surface_get;
+ evh->iface.is_viewport_offscreen = _e_video_hwc_iface_is_viewport_offscreen;
/* This ec is a video client now. */
e_client_video_hw_composition_set(ecv);