summaryrefslogtreecommitdiff
path: root/legacy/evas
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-08-13 14:36:25 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-08-13 14:36:25 +0000
commit419c8178159f3f2cb30945100cfb39866e789b83 (patch)
tree8cd51c800e69939928ab9d73429a295496ee8b30 /legacy/evas
parenta5df8468b0e6e59b25c16607c35944a012fe7210 (diff)
Evas (wayland_egl): More bug fixes & cleanups ! :)
When we create the egl window we should take rotation into consideration, so account for that. Add an 'edges' variable to the engine info structure. This is needed so we can implement resizing windows from the top also. Make sure to use wl_egl_window_get_attached_size and determine the edge we are resizing from, so we can calculate the difference in sizes to send to wl_egl_window_resize. Add __UNUSED__ to function paramaters where it was missing, and fix some compiler warnings. SVN revision: 75215
Diffstat (limited to 'legacy/evas')
-rw-r--r--legacy/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h3
-rw-r--r--legacy/evas/src/modules/engines/wayland_egl/evas_engine.c61
-rw-r--r--legacy/evas/src/modules/engines/wayland_egl/evas_wl_main.c9
3 files changed, 47 insertions, 26 deletions
diff --git a/legacy/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h b/legacy/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
index 520753a290..ff5fcd83bb 100644
--- a/legacy/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
+++ b/legacy/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
@@ -24,7 +24,8 @@ struct _Evas_Engine_Info_Wayland_Egl
24 int depth; 24 int depth;
25 int screen; 25 int screen;
26 int rotation; 26 int rotation;
27 unsigned int destination_alpha : 1; 27 int edges;
28 unsigned int destination_alpha : 1;
28 } info; 29 } info;
29 /* engine specific function calls to query stuff about the destination */ 30 /* engine specific function calls to query stuff about the destination */
30 /* engine (what visual & colormap & depth to use, performance info etc. */ 31 /* engine (what visual & colormap & depth to use, performance info etc. */
diff --git a/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c b/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c
index f45c840771..545bdab8fb 100644
--- a/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c
+++ b/legacy/evas/src/modules/engines/wayland_egl/evas_engine.c
@@ -473,7 +473,7 @@ static Evas_Func func, pfunc;
473static Evas_GL_API gl_funcs; 473static Evas_GL_API gl_funcs;
474 474
475static void * 475static void *
476eng_info(Evas *e) 476eng_info(Evas *e __UNUSED__)
477{ 477{
478 Evas_Engine_Info_Wayland_Egl *info; 478 Evas_Engine_Info_Wayland_Egl *info;
479 479
@@ -481,8 +481,8 @@ eng_info(Evas *e)
481 info->magic.magic = rand(); 481 info->magic.magic = rand();
482 info->func.best_depth_get = eng_best_depth_get; 482 info->func.best_depth_get = eng_best_depth_get;
483 info->render_mode = EVAS_RENDER_MODE_BLOCKING; 483 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
484
484 return info; 485 return info;
485 e = NULL;
486} 486}
487 487
488static void 488static void
@@ -822,7 +822,22 @@ eng_output_resize(void *data, int w, int h)
822 eng_window_use(re->win); 822 eng_window_use(re->win);
823 823
824 if (re->win->win) 824 if (re->win->win)
825 wl_egl_window_resize(re->win->win, w, h, 0, 0); 825 {
826 int aw, ah, dx, dy;
827
828 wl_egl_window_get_attached_size(re->win->win, &aw, &ah);
829
830 if (re->info->info.edges & 4) // resize from left
831 dx = aw - w;
832 else
833 dx = 0;
834 if (re->info->info.edges & 1) // resize from top
835 dy = ah - h;
836 else
837 dy = 0;
838
839 wl_egl_window_resize(re->win->win, w, h, dx, dy);
840 }
826 841
827 evas_gl_common_context_resize(re->win->gl_context, w, h, re->win->rot); 842 evas_gl_common_context_resize(re->win->gl_context, w, h, re->win->rot);
828 evas_common_tilebuf_free(re->tb); 843 evas_common_tilebuf_free(re->tb);
@@ -1041,11 +1056,11 @@ eng_output_flush(void *data)
1041} 1056}
1042 1057
1043static void 1058static void
1044eng_output_idle_flush(void *data) 1059eng_output_idle_flush(void *data __UNUSED__)
1045{ 1060{
1046 Render_Engine *re; 1061 /* Render_Engine *re; */
1047 1062
1048 re = (Render_Engine *)data; 1063 /* re = (Render_Engine *)data; */
1049} 1064}
1050 1065
1051static void 1066static void
@@ -1105,20 +1120,20 @@ eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int x2,
1105} 1120}
1106 1121
1107static void * 1122static void *
1108eng_polygon_point_add(void *data, void *context __UNUSED__, void *polygon, int x, int y) 1123eng_polygon_point_add(void *data __UNUSED__, void *context __UNUSED__, void *polygon, int x, int y)
1109{ 1124{
1110 Render_Engine *re; 1125 /* Render_Engine *re; */
1111 1126
1112 re = (Render_Engine *)data; 1127 /* re = (Render_Engine *)data; */
1113 return evas_gl_common_poly_point_add(polygon, x, y); 1128 return evas_gl_common_poly_point_add(polygon, x, y);
1114} 1129}
1115 1130
1116static void * 1131static void *
1117eng_polygon_points_clear(void *data, void *context __UNUSED__, void *polygon) 1132eng_polygon_points_clear(void *data __UNUSED__, void *context __UNUSED__, void *polygon)
1118{ 1133{
1119 Render_Engine *re; 1134 /* Render_Engine *re; */
1120 1135
1121 re = (Render_Engine *)data; 1136 /* re = (Render_Engine *)data; */
1122 return evas_gl_common_poly_points_clear(polygon); 1137 return evas_gl_common_poly_points_clear(polygon);
1123} 1138}
1124 1139
@@ -1249,13 +1264,13 @@ eng_image_comment_get(void *data __UNUSED__, void *image, char *key __UNUSED__)
1249} 1264}
1250 1265
1251static char * 1266static char *
1252eng_image_format_get(void *data __UNUSED__, void *image) 1267eng_image_format_get(void *data __UNUSED__, void *image __UNUSED__)
1253{ 1268{
1254// Render_Engine *re; 1269// Render_Engine *re;
1255 Evas_GL_Image *im; 1270 /* Evas_GL_Image *im; */
1256 1271
1257// re = (Render_Engine *)data; 1272// re = (Render_Engine *)data;
1258 im = image; 1273 /* im = image; */
1259 return NULL; 1274 return NULL;
1260} 1275}
1261 1276
@@ -2414,13 +2429,13 @@ eng_gl_proc_address_get(void *data __UNUSED__, const char *name)
2414} 2429}
2415 2430
2416static int 2431static int
2417eng_gl_native_surface_get(void *data, void *surface, void *native_surface) 2432eng_gl_native_surface_get(void *data __UNUSED__, void *surface, void *native_surface)
2418{ 2433{
2419 Render_Engine *re; 2434 /* Render_Engine *re; */
2420 Render_Engine_GL_Surface *sfc; 2435 Render_Engine_GL_Surface *sfc;
2421 Evas_Native_Surface *ns; 2436 Evas_Native_Surface *ns;
2422 2437
2423 re = (Render_Engine *)data; 2438 /* re = (Render_Engine *)data; */
2424 sfc = (Render_Engine_GL_Surface*)surface; 2439 sfc = (Render_Engine_GL_Surface*)surface;
2425 ns = (Evas_Native_Surface*)native_surface; 2440 ns = (Evas_Native_Surface*)native_surface;
2426 2441
@@ -2440,9 +2455,9 @@ static const GLubyte *
2440evgl_glGetString(GLenum name) 2455evgl_glGetString(GLenum name)
2441{ 2456{
2442 if (name == GL_EXTENSIONS) 2457 if (name == GL_EXTENSIONS)
2443 return (GLubyte *)_gl_ext_string; //glGetString(GL_EXTENSIONS); 2458 return (GLubyte *)_gl_ext_string; //glGetString(GL_EXTENSIONS);
2444 else 2459 else
2445 return glGetString(name); 2460 return glGetString(name);
2446} 2461}
2447 2462
2448static void 2463static void
@@ -2553,11 +2568,11 @@ evgl_glEvasGLImageTargetRenderbufferStorageOES(GLenum target, EvasGLImage image)
2553 2568
2554 2569
2555static void * 2570static void *
2556eng_gl_api_get(void *data) 2571eng_gl_api_get(void *data __UNUSED__)
2557{ 2572{
2558 Render_Engine *re; 2573 /* Render_Engine *re; */
2559 2574
2560 re = (Render_Engine *)data; 2575 /* re = (Render_Engine *)data; */
2561 2576
2562 gl_funcs.version = EVAS_GL_API_VERSION; 2577 gl_funcs.version = EVAS_GL_API_VERSION;
2563 2578
diff --git a/legacy/evas/src/modules/engines/wayland_egl/evas_wl_main.c b/legacy/evas/src/modules/engines/wayland_egl/evas_wl_main.c
index 3b94cba402..b7ec16f018 100644
--- a/legacy/evas/src/modules/engines/wayland_egl/evas_wl_main.c
+++ b/legacy/evas/src/modules/engines/wayland_egl/evas_wl_main.c
@@ -137,7 +137,10 @@ eng_window_new(struct wl_display *disp, struct wl_surface *surface, int screen,
137 return NULL; 137 return NULL;
138 } 138 }
139 139
140 gw->win = wl_egl_window_create(gw->surface, gw->w, gw->h); 140 if ((gw->rot == 0) || (gw->rot == 180))
141 gw->win = wl_egl_window_create(gw->surface, gw->w, gw->h);
142 else if ((gw->rot == 90) || (gw->rot == 270))
143 gw->win = wl_egl_window_create(gw->surface, gw->h, gw->w);
141 144
142 gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config, 145 gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
143 (EGLNativeWindowType)gw->win, 146 (EGLNativeWindowType)gw->win,
@@ -150,7 +153,9 @@ eng_window_new(struct wl_display *disp, struct wl_surface *surface, int screen,
150 return NULL; 153 return NULL;
151 } 154 }
152 155
153 gw->egl_context[0] = eglCreateContext(gw->egl_disp, gw->egl_config, share_context, context_attrs); 156 gw->egl_context[0] =
157 eglCreateContext(gw->egl_disp, gw->egl_config, share_context,
158 context_attrs);
154 159
155 if (gw->egl_context[0] == EGL_NO_CONTEXT) 160 if (gw->egl_context[0] == EGL_NO_CONTEXT)
156 { 161 {