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.
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@75215
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
int depth;
int screen;
int rotation;
int depth;
int screen;
int rotation;
- unsigned int destination_alpha : 1;
+ int edges;
+ unsigned int destination_alpha : 1;
} info;
/* engine specific function calls to query stuff about the destination */
/* engine (what visual & colormap & depth to use, performance info etc. */
} info;
/* engine specific function calls to query stuff about the destination */
/* engine (what visual & colormap & depth to use, performance info etc. */
static Evas_GL_API gl_funcs;
static void *
static Evas_GL_API gl_funcs;
static void *
+eng_info(Evas *e __UNUSED__)
{
Evas_Engine_Info_Wayland_Egl *info;
{
Evas_Engine_Info_Wayland_Egl *info;
info->magic.magic = rand();
info->func.best_depth_get = eng_best_depth_get;
info->render_mode = EVAS_RENDER_MODE_BLOCKING;
info->magic.magic = rand();
info->func.best_depth_get = eng_best_depth_get;
info->render_mode = EVAS_RENDER_MODE_BLOCKING;
eng_window_use(re->win);
if (re->win->win)
eng_window_use(re->win);
if (re->win->win)
- wl_egl_window_resize(re->win->win, w, h, 0, 0);
+ {
+ int aw, ah, dx, dy;
+
+ wl_egl_window_get_attached_size(re->win->win, &aw, &ah);
+
+ if (re->info->info.edges & 4) // resize from left
+ dx = aw - w;
+ else
+ dx = 0;
+ if (re->info->info.edges & 1) // resize from top
+ dy = ah - h;
+ else
+ dy = 0;
+
+ wl_egl_window_resize(re->win->win, w, h, dx, dy);
+ }
evas_gl_common_context_resize(re->win->gl_context, w, h, re->win->rot);
evas_common_tilebuf_free(re->tb);
evas_gl_common_context_resize(re->win->gl_context, w, h, re->win->rot);
evas_common_tilebuf_free(re->tb);
-eng_output_idle_flush(void *data)
+eng_output_idle_flush(void *data __UNUSED__)
+ /* Render_Engine *re; */
- re = (Render_Engine *)data;
+ /* re = (Render_Engine *)data; */
-eng_polygon_point_add(void *data, void *context __UNUSED__, void *polygon, int x, int y)
+eng_polygon_point_add(void *data __UNUSED__, void *context __UNUSED__, void *polygon, int x, int y)
+ /* Render_Engine *re; */
- re = (Render_Engine *)data;
+ /* re = (Render_Engine *)data; */
return evas_gl_common_poly_point_add(polygon, x, y);
}
static void *
return evas_gl_common_poly_point_add(polygon, x, y);
}
static void *
-eng_polygon_points_clear(void *data, void *context __UNUSED__, void *polygon)
+eng_polygon_points_clear(void *data __UNUSED__, void *context __UNUSED__, void *polygon)
+ /* Render_Engine *re; */
- re = (Render_Engine *)data;
+ /* re = (Render_Engine *)data; */
return evas_gl_common_poly_points_clear(polygon);
}
return evas_gl_common_poly_points_clear(polygon);
}
-eng_image_format_get(void *data __UNUSED__, void *image)
+eng_image_format_get(void *data __UNUSED__, void *image __UNUSED__)
+ /* Evas_GL_Image *im; */
// re = (Render_Engine *)data;
// re = (Render_Engine *)data;
-eng_gl_native_surface_get(void *data, void *surface, void *native_surface)
+eng_gl_native_surface_get(void *data __UNUSED__, void *surface, void *native_surface)
+ /* Render_Engine *re; */
Render_Engine_GL_Surface *sfc;
Evas_Native_Surface *ns;
Render_Engine_GL_Surface *sfc;
Evas_Native_Surface *ns;
- re = (Render_Engine *)data;
+ /* re = (Render_Engine *)data; */
sfc = (Render_Engine_GL_Surface*)surface;
ns = (Evas_Native_Surface*)native_surface;
sfc = (Render_Engine_GL_Surface*)surface;
ns = (Evas_Native_Surface*)native_surface;
evgl_glGetString(GLenum name)
{
if (name == GL_EXTENSIONS)
evgl_glGetString(GLenum name)
{
if (name == GL_EXTENSIONS)
- return (GLubyte *)_gl_ext_string; //glGetString(GL_EXTENSIONS);
+ return (GLubyte *)_gl_ext_string; //glGetString(GL_EXTENSIONS);
- return glGetString(name);
+ return glGetString(name);
-eng_gl_api_get(void *data)
+eng_gl_api_get(void *data __UNUSED__)
+ /* Render_Engine *re; */
- re = (Render_Engine *)data;
+ /* re = (Render_Engine *)data; */
gl_funcs.version = EVAS_GL_API_VERSION;
gl_funcs.version = EVAS_GL_API_VERSION;
- gw->win = wl_egl_window_create(gw->surface, gw->w, gw->h);
+ if ((gw->rot == 0) || (gw->rot == 180))
+ gw->win = wl_egl_window_create(gw->surface, gw->w, gw->h);
+ else if ((gw->rot == 90) || (gw->rot == 270))
+ gw->win = wl_egl_window_create(gw->surface, gw->h, gw->w);
gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config,
(EGLNativeWindowType)gw->win,
- gw->egl_context[0] = eglCreateContext(gw->egl_disp, gw->egl_config, share_context, context_attrs);
+ gw->egl_context[0] =
+ eglCreateContext(gw->egl_disp, gw->egl_config, share_context,
+ context_attrs);
if (gw->egl_context[0] == EGL_NO_CONTEXT)
{
if (gw->egl_context[0] == EGL_NO_CONTEXT)
{