summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-09-11 14:30:39 -0300
committerRafael Antognolli <rafael.antognolli@intel.com>2013-09-23 19:28:36 -0300
commiteefb2386e61b8ca42a9b8e4d0d78e95e538ff726 (patch)
tree10de3f740bb6ce71bf10b336ff7511c8e1e821ff
parent0258a7c4660e9e987f3934045f5bd52fa13eb9aa (diff)
evas/wayland_egl: Subsurfaces handled as native surfaces.devs/antognolli/subsurfaces2
This code assumes that a wl_buffer will be passed as a native surface to an Evas image, and then Evas will handle it as appropriate. The image will be used as is, or converted to a subsurface if possible.
-rw-r--r--src/Makefile_Evas.am19
-rw-r--r--src/lib/ecore_wayland/Ecore_Wayland.h5
-rw-r--r--src/lib/ecore_wayland/ecore_wl.c30
-rw-r--r--src/lib/evas/Evas_Common.h14
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c2
-rw-r--r--src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h2
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c160
7 files changed, 225 insertions, 7 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 924e0e159b..dcb9f92a5b 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -895,10 +895,20 @@ WAYLAND_EGL_SOURCES = \
895modules/evas/engines/wayland_egl/evas_engine.c \ 895modules/evas/engines/wayland_egl/evas_engine.c \
896modules/evas/engines/wayland_egl/evas_wl_main.c \ 896modules/evas/engines/wayland_egl/evas_wl_main.c \
897modules/evas/engines/wayland_egl/evas_engine.h 897modules/evas/engines/wayland_egl/evas_engine.h
898
899module_wayland_BUILT_SOURCES = \
900modules/evas/engines/wayland_egl/subsurface-protocol.c \
901modules/evas/engines/wayland_egl/subsurface-client-protocol.h
902
903CLEANFILES += $(module_wayland_BUILT_SOURCES)
904BUILT_SOURCES += $(module_wayland_BUILT_SOURCES)
905WAYLAND_EGL_SOURCES += $(module_wayland_BUILT_SOURCES)
906
898if EVAS_STATIC_BUILD_WAYLAND_EGL 907if EVAS_STATIC_BUILD_WAYLAND_EGL
899lib_evas_libevas_la_SOURCES += $(WAYLAND_EGL_SOURCES) 908lib_evas_libevas_la_SOURCES += $(WAYLAND_EGL_SOURCES)
900lib_evas_libevas_la_CPPFLAGS += \ 909lib_evas_libevas_la_CPPFLAGS += \
901-I$(top_srcdir)/src/modules/evas/engines/gl_common \ 910-I$(top_srcdir)/src/modules/evas/engines/gl_common \
911-I$(top_builddir)/src/modules/evas/engines/wayland_egl \
902@evas_engine_wayland_egl_cflags@ 912@evas_engine_wayland_egl_cflags@
903lib_evas_libevas_la_LIBADD += @evas_engine_wayland_egl_libs@ 913lib_evas_libevas_la_LIBADD += @evas_engine_wayland_egl_libs@
904else 914else
@@ -909,6 +919,7 @@ modules_evas_engines_wayland_egl_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/
909-I$(top_srcdir)/src/lib/evas/include \ 919-I$(top_srcdir)/src/lib/evas/include \
910-I$(top_srcdir)/src/lib/evas/cserve2 \ 920-I$(top_srcdir)/src/lib/evas/cserve2 \
911-I$(top_srcdir)/src/modules/evas/engines/gl_common \ 921-I$(top_srcdir)/src/modules/evas/engines/gl_common \
922-I$(top_builddir)/src/modules/evas/engines/wayland_egl \
912@EVAS_CFLAGS@ \ 923@EVAS_CFLAGS@ \
913@evas_engine_wayland_egl_cflags@ 924@evas_engine_wayland_egl_cflags@
914modules_evas_engines_wayland_egl_module_la_LIBADD = \ 925modules_evas_engines_wayland_egl_module_la_LIBADD = \
@@ -921,6 +932,14 @@ modules/evas/engines/gl_common/libevas_engine_gl_common.la
921modules_evas_engines_wayland_egl_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ 932modules_evas_engines_wayland_egl_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
922modules_evas_engines_wayland_egl_module_la_LIBTOOLFLAGS = --tag=disable-static 933modules_evas_engines_wayland_egl_module_la_LIBTOOLFLAGS = --tag=disable-static
923endif 934endif
935
936modules/evas/engines/wayland_egl/subsurface-protocol.c: $(wayland_protocoldir)/subsurface.xml
937 $(AM_V_GEN)$(wayland_scanner) code < $< > $@
938
939modules/evas/engines/wayland_egl/subsurface-client-protocol.h: $(wayland_protocoldir)/subsurface.xml
940 $(AM_V_GEN)$(wayland_scanner) client-header < $< > $@
941
942
924endif 943endif
925 944
926if BUILD_ENGINE_WAYLAND_SHM 945if BUILD_ENGINE_WAYLAND_SHM
diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h
index 145dc3bc81..db9d4d6cb0 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -488,6 +488,8 @@ EAPI struct wl_shm *ecore_wl_shm_get(void);
488 */ 488 */
489EAPI struct wl_display *ecore_wl_display_get(void); 489EAPI struct wl_display *ecore_wl_display_get(void);
490 490
491EAPI struct wl_compositor *ecore_wl_compositor_get(void);
492
491/** 493/**
492 * Retrieves the size of the current screen. 494 * Retrieves the size of the current screen.
493 * 495 *
@@ -955,6 +957,9 @@ EAPI void ecore_wl_subsurf_sync_set(Ecore_Wl_Subsurf *ess, Eina_Bool val);
955 * @since 1.8 957 * @since 1.8
956 */ 958 */
957EAPI void ecore_wl_subsurf_opaque_region_set(Ecore_Wl_Subsurf *ess, int x, int y, int w, int h); 959EAPI void ecore_wl_subsurf_opaque_region_set(Ecore_Wl_Subsurf *ess, int x, int y, int w, int h);
960
961EAPI void *ecore_wl_subcompositor_get(void);
962
958#ifdef __cplusplus 963#ifdef __cplusplus
959} 964}
960#endif 965#endif
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index ee614e0e4b..af29cf7bd7 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -353,6 +353,36 @@ ecore_wl_server_mode_set(Eina_Bool on)
353 _ecore_wl_server_mode = on; 353 _ecore_wl_server_mode = on;
354} 354}
355 355
356EAPI struct wl_compositor *
357ecore_wl_compositor_get(void)
358{
359 LOGFN(__FILE__, __LINE__, __FUNCTION__);
360
361 if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return NULL;
362
363 if (!_ecore_wl_disp->wl.compositor)
364 ecore_wl_sync();
365
366 if (!_ecore_wl_disp->wl.compositor) return NULL;
367
368 return _ecore_wl_disp->wl.compositor;
369}
370
371EAPI void *
372ecore_wl_subcompositor_get(void)
373{
374 LOGFN(__FILE__, __LINE__, __FUNCTION__);
375
376 if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display)) return NULL;
377
378 if (!_ecore_wl_disp->wl.subcompositor)
379 ecore_wl_sync();
380
381 if (!_ecore_wl_disp->wl.subcompositor) return NULL;
382
383 return _ecore_wl_disp->wl.subcompositor;
384}
385
356/* local functions */ 386/* local functions */
357static Eina_Bool 387static Eina_Bool
358_ecore_wl_shutdown(Eina_Bool close) 388_ecore_wl_shutdown(Eina_Bool close)
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 77f65bd4d6..4bde1c98b7 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -443,13 +443,14 @@ struct _Evas_Pixel_Import_Source
443}; 443};
444 444
445/* magic version number to know what the native surf struct looks like */ 445/* magic version number to know what the native surf struct looks like */
446#define EVAS_NATIVE_SURFACE_VERSION 2 446#define EVAS_NATIVE_SURFACE_VERSION 3
447 447
448typedef enum _Evas_Native_Surface_Type 448typedef enum _Evas_Native_Surface_Type
449{ 449{
450 EVAS_NATIVE_SURFACE_NONE, 450 EVAS_NATIVE_SURFACE_NONE,
451 EVAS_NATIVE_SURFACE_X11, 451 EVAS_NATIVE_SURFACE_X11,
452 EVAS_NATIVE_SURFACE_OPENGL 452 EVAS_NATIVE_SURFACE_OPENGL,
453 EVAS_NATIVE_SURFACE_WL_BUFFER
453} Evas_Native_Surface_Type; 454} Evas_Native_Surface_Type;
454 455
455struct _Evas_Native_Surface 456struct _Evas_Native_Surface
@@ -470,6 +471,15 @@ struct _Evas_Native_Surface
470 unsigned int format; /**< same as 'format' for glTexImage2D() */ 471 unsigned int format; /**< same as 'format' for glTexImage2D() */
471 unsigned int x, y, w, h; /**< region inside the texture to use (image size is assumed as texture size, with 0, 0 being the top-left and co-ordinates working down to the right and bottom being positive) */ 472 unsigned int x, y, w, h; /**< region inside the texture to use (image size is assumed as texture size, with 0, 0 being the top-left and co-ordinates working down to the right and bottom being positive) */
472 } opengl; 473 } opengl;
474 struct
475 {
476 void *buffer; /**< wl_buffer pointer */
477 void *pixels; /**< pixel buffer pointer */
478 unsigned int id; /**< wl_proxy id (buffer id) */
479 unsigned int format;
480 unsigned int w, h;
481 Eina_Bool alpha;
482 } wayland;
473 } data; 483 } data;
474}; 484};
475 485
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
index 9959c085ed..256971e8f7 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
@@ -209,6 +209,8 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent,
209 einfo->info.rotation = ee->rotation; 209 einfo->info.rotation = ee->rotation;
210 einfo->info.depth = 32; 210 einfo->info.depth = 32;
211 einfo->info.surface = ecore_wl_window_surface_create(wdata->win); 211 einfo->info.surface = ecore_wl_window_surface_create(wdata->win);
212 einfo->info.compositor = ecore_wl_compositor_get();
213 einfo->info.subcompositor = ecore_wl_subcompositor_get();
212 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 214 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
213 { 215 {
214 ERR("Failed to set Evas Engine Info for '%s'", ee->driver); 216 ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
diff --git a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
index 259ccf7060..b593d482dd 100644
--- a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
+++ b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
@@ -25,6 +25,8 @@ struct _Evas_Engine_Info_Wayland_Egl
25 { 25 {
26 struct wl_display *display; 26 struct wl_display *display;
27 struct wl_surface *surface; 27 struct wl_surface *surface;
28 void *compositor;
29 void *subcompositor;
28 int depth, screen, rotation, edges; 30 int depth, screen, rotation, edges;
29 unsigned int destination_alpha : 1; 31 unsigned int destination_alpha : 1;
30 } info; 32 } info;
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 28f72b08de..f0fb360a99 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -1,6 +1,7 @@
1#include "evas_common_private.h" 1#include "evas_common_private.h"
2#include "evas_engine.h" 2#include "evas_engine.h"
3#include "evas_gl_core_private.h" 3#include "evas_gl_core_private.h"
4#include "subsurface-client-protocol.h"
4 5
5#ifdef HAVE_DLSYM 6#ifdef HAVE_DLSYM
6# include <dlfcn.h> 7# include <dlfcn.h>
@@ -51,11 +52,20 @@ struct _Render_Engine
51 } func; 52 } func;
52}; 53};
53 54
55typedef struct _Subsurface Subsurface;
56struct _Subsurface
57{
58 struct wl_surface *surface;
59 struct wl_surface *psurface;
60 struct wl_subsurface *subsurface;
61};
62
54typedef struct _Native Native; 63typedef struct _Native Native;
55struct _Native 64struct _Native
56{ 65{
57 Evas_Native_Surface ns; 66 Evas_Native_Surface ns;
58 void *egl_surface; 67 void *egl_surface;
68 Subsurface *subsurf;
59}; 69};
60 70
61/* local function prototypes */ 71/* local function prototypes */
@@ -1707,7 +1717,12 @@ eng_image_dirty_region(void *data, void *image, int x, int y, int w, int h)
1707 1717
1708 if (!(re = (Render_Engine *)data)) return NULL; 1718 if (!(re = (Render_Engine *)data)) return NULL;
1709 if (!(im = image)) return NULL; 1719 if (!(im = image)) return NULL;
1710 if (im->native.data) return image; 1720 if (im->native.data)
1721 {
1722 Native *n = im->native.data;
1723 if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
1724 return image;
1725 }
1711 eng_window_use(re->win); 1726 eng_window_use(re->win);
1712 evas_gl_common_image_dirty(image, x, y, w, h); 1727 evas_gl_common_image_dirty(image, x, y, w, h);
1713 return image; 1728 return image;
@@ -1995,6 +2010,52 @@ eng_image_border_get(void *data EINA_UNUSED, void *image EINA_UNUSED, int *l EIN
1995{ 2010{
1996} 2011}
1997 2012
2013static void
2014_subsurface_setup(Render_Engine *re, Native *n)
2015{
2016 struct wl_subcompositor *subcomp;
2017
2018 if (n->subsurf)
2019 return;
2020
2021 subcomp = re->info->info.subcompositor;
2022 if (!subcomp || !re->info->info.surface) return;
2023
2024 n->subsurf = malloc(sizeof(*n->subsurf));
2025 n->subsurf->surface = wl_compositor_create_surface(re->info->info.compositor);
2026 if (!n->subsurf->surface)
2027 goto error;
2028
2029 n->subsurf->psurface = re->info->info.surface;
2030 n->subsurf->subsurface = wl_subcompositor_get_subsurface
2031 (subcomp, n->subsurf->surface, n->subsurf->psurface);
2032 if (!n->subsurf->subsurface)
2033 goto subsurf_error;
2034
2035 printf("**** created surface: %p\n", n->subsurf);
2036
2037 return;
2038
2039subsurf_error:
2040 wl_surface_destroy(n->subsurf->surface);
2041error:
2042 free(n->subsurf);
2043 n->subsurf = NULL;
2044}
2045
2046static void
2047_subsurface_destroy(Native *n)
2048{
2049 if (!n->subsurf)
2050 return;
2051
2052 printf("**** destroying surface: %p\n", n->subsurf);
2053 wl_subsurface_destroy(n->subsurf->subsurface);
2054 wl_surface_destroy(n->subsurf->surface);
2055 free(n->subsurf);
2056 n->subsurf = NULL;
2057}
2058
1998static Eina_Bool 2059static Eina_Bool
1999eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth, Eina_Bool do_async EINA_UNUSED) 2060eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth, Eina_Bool do_async EINA_UNUSED)
2000{ 2061{
@@ -2029,8 +2090,23 @@ eng_image_draw(void *data, void *context, void *surface, void *image, int src_x,
2029 // Reset clip 2090 // Reset clip
2030 evgl_direct_img_clip_set(0, 0, 0, 0, 0); 2091 evgl_direct_img_clip_set(0, 0, 0, 0, 0);
2031 } 2092 }
2093 else if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_WL_BUFFER) &&
2094 ((src_w == dst_w) && (src_h == dst_h)))
2095 {
2096 _subsurface_setup(re, n);
2097 if (!n->subsurf) return EINA_FALSE;
2098
2099 wl_subsurface_set_position(n->subsurf->subsurface, dst_x, dst_y);
2100 wl_surface_attach(n->subsurf->surface, n->ns.data.wayland.buffer, 0, 0);
2101 wl_surface_damage(n->subsurf->surface, src_x, src_y, src_w, src_h);
2102 wl_surface_commit(n->subsurf->surface);
2103
2104 printf(">>> render subsurface for img: %p: %d, %d + %dx%d ==>>> %d,%d + %dx%d\n", im, src_x, src_y, src_w, src_h, dst_x, dst_y, dst_w, dst_h);
2105 }
2032 else 2106 else
2033 { 2107 {
2108 if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_WL_BUFFER))
2109 _subsurface_destroy(n);
2034 eng_window_use(re->win); 2110 eng_window_use(re->win);
2035 evas_gl_common_context_target_surface_set(re->win->gl_context, surface); 2111 evas_gl_common_context_target_surface_set(re->win->gl_context, surface);
2036 re->win->gl_context->dc = context; 2112 re->win->gl_context->dc = context;
@@ -2038,6 +2114,7 @@ eng_image_draw(void *data, void *context, void *surface, void *image, int src_x,
2038 src_x, src_y, src_w, src_h, 2114 src_x, src_y, src_w, src_h,
2039 dst_x, dst_y, dst_w, dst_h, 2115 dst_x, dst_y, dst_w, dst_h,
2040 smooth); 2116 smooth);
2117 printf(">>> render content for img: %p: %d, %d + %dx%d ==>>> %d,%d + %dx%d\n", im, src_x, src_y, src_w, src_h, dst_x, dst_y, dst_w, dst_h);
2041 } 2118 }
2042 2119
2043 return EINA_FALSE; 2120 return EINA_FALSE;
@@ -2152,6 +2229,15 @@ eng_image_native_set(void *data, void *image, void *native)
2152 NULL, 1, 2229 NULL, 1,
2153 EVAS_COLORSPACE_ARGB8888); 2230 EVAS_COLORSPACE_ARGB8888);
2154 } 2231 }
2232 else if ((ns) && (ns->type == EVAS_NATIVE_SURFACE_WL_BUFFER))
2233 {
2234 im = evas_gl_common_image_new_from_data(re->win->gl_context,
2235 ns->data.wayland.w,
2236 ns->data.wayland.h,
2237 ns->data.wayland.pixels,
2238 ns->data.wayland.alpha,
2239 ns->data.wayland.format);
2240 }
2155 else 2241 else
2156 return NULL; 2242 return NULL;
2157 } 2243 }
@@ -2172,6 +2258,20 @@ eng_image_native_set(void *data, void *image, void *native)
2172 return im; 2258 return im;
2173 } 2259 }
2174 } 2260 }
2261 else if (ns->type == EVAS_NATIVE_SURFACE_WL_BUFFER)
2262 {
2263 if (im->native.data)
2264 {
2265 Evas_Native_Surface *ens;
2266 void *buffer = ns->data.wayland.buffer;
2267 unsigned int bufferid = ns->data.wayland.id;
2268
2269 ens = im->native.data;
2270 if ((ens->data.wayland.buffer == buffer) &&
2271 (ens->data.wayland.id == bufferid))
2272 return im;
2273 }
2274 }
2175 } 2275 }
2176 2276
2177 if ((!ns) && (!im->native.data)) return im; 2277 if ((!ns) && (!im->native.data)) return im;
@@ -2203,10 +2303,38 @@ eng_image_native_set(void *data, void *image, void *native)
2203 } 2303 }
2204 } 2304 }
2205 } 2305 }
2306 else if (ns->type == EVAS_NATIVE_SURFACE_WL_BUFFER)
2307 {
2308 unsigned int bufferid = ns->data.wayland.id;
2309 im2 = eina_hash_find(re->win->gl_context->shared->native_tex_hash, &bufferid);
2310 if (im2 == im) return im;
2311 if (im2)
2312 {
2313 n = im2->native.data;
2314 if (n)
2315 {
2316 evas_gl_common_image_ref(im2);
2317 _subsurface_destroy(im->native.data);
2318 evas_gl_common_image_free(im);
2319 return im2;
2320 }
2321 }
2322 }
2323
2324 if (ns->type == EVAS_NATIVE_SURFACE_OPENGL)
2325 im2 = evas_gl_common_image_new_from_data(re->win->gl_context,
2326 im->w, im->h, NULL, im->alpha,
2327 EVAS_COLORSPACE_ARGB8888);
2328 else
2329 im2 = evas_gl_common_image_new_from_data(re->win->gl_context,
2330 ns->data.wayland.w,
2331 ns->data.wayland.h,
2332 ns->data.wayland.pixels,
2333 ns->data.wayland.alpha,
2334 ns->data.wayland.format);
2206 2335
2207 im2 = evas_gl_common_image_new_from_data(re->win->gl_context, 2336 if (im->native.data)
2208 im->w, im->h, NULL, im->alpha, 2337 _subsurface_destroy(im->native.data);
2209 EVAS_COLORSPACE_ARGB8888);
2210 evas_gl_common_image_free(im); 2338 evas_gl_common_image_free(im);
2211 if (!(im = im2)) return NULL; 2339 if (!(im = im2)) return NULL;
2212 2340
@@ -2239,7 +2367,29 @@ eng_image_native_set(void *data, void *image, void *native)
2239 evas_gl_common_image_native_enable(im); 2367 evas_gl_common_image_native_enable(im);
2240 } 2368 }
2241 } 2369 }
2242 } 2370 }
2371 else
2372 {
2373 n = calloc(1, sizeof(Native));
2374 if (n)
2375 {
2376 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2377
2378 eina_hash_add(re->win->gl_context->shared->native_tex_hash,
2379 &texid, im);
2380
2381 n->egl_surface = 0;
2382 im->native.yinvert = 1;
2383 im->native.loose = 0;
2384 im->native.data = n;
2385 // im->native.func.data = re;
2386 // im->native.func.bind = _native_bind_cb;
2387 // im->native.func.unbind = _native_unbind_cb;
2388 // im->native.func.free = _native_free_cb;
2389 // im->native.target = GL_TEXTURE_2D;
2390 // im->native.mipmap = 0;
2391 }
2392 }
2243 2393
2244 return im; 2394 return im;
2245} 2395}