summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-09-19 11:58:55 -0400
committerChris Michael <cp.michael@samsung.com>2017-09-19 13:10:33 -0400
commit9efac538ccce5f22fde05824ae7e25857c10a412 (patch)
tree78aa0e530152be565026c0570911235da63aae74 /src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
parent7198fe568b837cea62a82f17165086785147da08 (diff)
ecore-evas-drm: Implement actual evas engine rotations in drm
This patch implements handling of evas output rotation for the ecore_evas drm engine. ref T5999 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/modules/ecore_evas/engines/drm/ecore_evas_drm.c')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c62
1 files changed, 60 insertions, 2 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 561dd3092c..bd569ddbd5 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -218,17 +218,75 @@ _drm_free(Ecore_Evas *ee)
218} 218}
219 219
220static void 220static void
221_drm_rotation_do(Ecore_Evas *ee, int rotation, int resize EINA_UNUSED) 221_drm_rotation_do(Ecore_Evas *ee, int rotation, int resize)
222{ 222{
223 Evas_Engine_Info_Drm *einfo; 223 Evas_Engine_Info_Drm *einfo;
224 int diff;
224 225
225 if (ee->rotation == rotation) return; 226 if (ee->rotation == rotation) return;
226 ee->rotation = rotation; 227
227 einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas); 228 einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas);
228 if (!einfo) return; 229 if (!einfo) return;
230
229 einfo->info.rotation = rotation; 231 einfo->info.rotation = rotation;
230 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 232 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
231 ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); 233 ERR("evas_engine_info_set() for engine '%s' failed", ee->driver);
234
235 diff = ee->rotation - rotation;
236 if (diff < 0) diff = -diff;
237
238 if (diff != 180)
239 {
240 if (!resize)
241 {
242 int ww, hh;
243
244 if (ECORE_EVAS_PORTRAIT(ee))
245 evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h);
246 else
247 evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.h, ee->req.w);
248
249 ww = ee->h;
250 hh = ee->w;
251 ee->w = ww;
252 ee->h = hh;
253 ee->req.w = ww;
254 ee->req.h = hh;
255 }
256 else
257 {
258 if ((rotation == 0) || (rotation == 180))
259 {
260 evas_output_size_set(ee->evas, ee->w, ee->h);
261 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
262 }
263 else
264 {
265 evas_output_size_set(ee->evas, ee->h, ee->w);
266 evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
267 }
268
269 if (ee->func.fn_resize) ee->func.fn_resize(ee);
270
271 if (ECORE_EVAS_PORTRAIT(ee))
272 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
273 else
274 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
275 }
276
277 ee->rotation = rotation;
278 }
279 else
280 {
281 ee->rotation = rotation;
282
283 if (ee->func.fn_resize) ee->func.fn_resize(ee);
284
285 if (ECORE_EVAS_PORTRAIT(ee))
286 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
287 else
288 evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
289 }
232} 290}
233 291
234static void 292static void