ecore-drm2: Factor in output rotation when getting output info

Summary:
Enlightenment uses this function to get information about a given
output, so we should be accounting for output rotation when returning
width/height values.

ref T7690

@fix

Depends on D8114

Reviewers: raster, cedric, zmike

Reviewed By: cedric

Subscribers: cedric

Tags: #efl, #do_not_merge

Maniphest Tasks: T7690

Differential Revision: https://phab.enlightenment.org/D8115
This commit is contained in:
Christopher Michael 2019-03-22 12:41:25 -04:00
parent 828984393e
commit e63c36056e
1 changed files with 15 additions and 2 deletions

View File

@ -1675,8 +1675,21 @@ ecore_drm2_output_info_get(Ecore_Drm2_Output *output, int *x, int *y, int *w, in
EINA_SAFETY_ON_NULL_RETURN(output);
EINA_SAFETY_ON_TRUE_RETURN(!output->current_mode);
if (w) *w = output->current_mode->width;
if (h) *h = output->current_mode->height;
switch (output->rotation)
{
case ECORE_DRM2_ROTATION_90:
case ECORE_DRM2_ROTATION_270:
if (w) *w = output->current_mode->height;
if (h) *h = output->current_mode->width;
break;
case ECORE_DRM2_ROTATION_NORMAL:
case ECORE_DRM2_ROTATION_180:
default:
if (w) *w = output->current_mode->width;
if (h) *h = output->current_mode->height;
break;
}
if (refresh) *refresh = output->current_mode->refresh;
if (x) *x = output->x;
if (y) *y = output->y;