diff options
author | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-23 23:30:42 +1000 |
commit | 825a3d837a33f226c879cd02ad15c3fba57e8b2c (patch) | |
tree | 75f57bd9c4253508d338dc79ba8e57a7abc42255 /libraries/evas/src/modules | |
parent | Add ability to disable the test harness, or the Lua compile test. (diff) | |
download | SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.zip SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.gz SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.bz2 SledjHamr-825a3d837a33f226c879cd02ad15c3fba57e8b2c.tar.xz |
Update the EFL to what I'm actually using, coz I'm using some stuff not yet released.
Diffstat (limited to '')
80 files changed, 8619 insertions, 712 deletions
diff --git a/libraries/evas/src/modules/Makefile.in b/libraries/evas/src/modules/Makefile.in index 9cd0201..e4f1cbc 100644 --- a/libraries/evas/src/modules/Makefile.in +++ b/libraries/evas/src/modules/Makefile.in | |||
@@ -206,8 +206,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
206 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 206 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
207 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 207 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
208 | PKG_CONFIG = @PKG_CONFIG@ | 208 | PKG_CONFIG = @PKG_CONFIG@ |
209 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
210 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
211 | PNG_CFLAGS = @PNG_CFLAGS@ | 209 | PNG_CFLAGS = @PNG_CFLAGS@ |
212 | PNG_LIBS = @PNG_LIBS@ | 210 | PNG_LIBS = @PNG_LIBS@ |
213 | RANLIB = @RANLIB@ | 211 | RANLIB = @RANLIB@ |
@@ -224,6 +222,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
224 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 222 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
225 | VERSION = @VERSION@ | 223 | VERSION = @VERSION@ |
226 | VMAJ = @VMAJ@ | 224 | VMAJ = @VMAJ@ |
225 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
226 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
227 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 227 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
228 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 228 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
229 | XCB_CFLAGS = @XCB_CFLAGS@ | 229 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -305,6 +305,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
305 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 305 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
306 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 306 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
307 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 307 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
308 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
309 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
310 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
311 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
308 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 312 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
309 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 313 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
310 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 314 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/Makefile.am b/libraries/evas/src/modules/engines/Makefile.am index 7d870a1..42585cc 100644 --- a/libraries/evas/src/modules/engines/Makefile.am +++ b/libraries/evas/src/modules/engines/Makefile.am | |||
@@ -68,4 +68,9 @@ endif | |||
68 | if !EVAS_STATIC_BUILD_SOFTWARE_X11 | 68 | if !EVAS_STATIC_BUILD_SOFTWARE_X11 |
69 | SUBDIRS += software_x11 | 69 | SUBDIRS += software_x11 |
70 | endif | 70 | endif |
71 | 71 | if !EVAS_STATIC_BUILD_WAYLAND_SHM | |
72 | SUBDIRS += wayland_shm | ||
73 | endif | ||
74 | if !EVAS_STATIC_BUILD_WAYLAND_EGL | ||
75 | SUBDIRS += wayland_egl | ||
76 | endif | ||
diff --git a/libraries/evas/src/modules/engines/Makefile.in b/libraries/evas/src/modules/engines/Makefile.in index 3994fca..5820026 100644 --- a/libraries/evas/src/modules/engines/Makefile.in +++ b/libraries/evas/src/modules/engines/Makefile.in | |||
@@ -54,6 +54,8 @@ host_triplet = @host@ | |||
54 | @EVAS_STATIC_BUILD_SOFTWARE_DDRAW_FALSE@am__append_19 = software_ddraw | 54 | @EVAS_STATIC_BUILD_SOFTWARE_DDRAW_FALSE@am__append_19 = software_ddraw |
55 | @EVAS_STATIC_BUILD_SOFTWARE_GDI_FALSE@am__append_20 = software_gdi | 55 | @EVAS_STATIC_BUILD_SOFTWARE_GDI_FALSE@am__append_20 = software_gdi |
56 | @EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@am__append_21 = software_x11 | 56 | @EVAS_STATIC_BUILD_SOFTWARE_X11_FALSE@am__append_21 = software_x11 |
57 | @EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@am__append_22 = wayland_shm | ||
58 | @EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@am__append_23 = wayland_egl | ||
57 | subdir = src/modules/engines | 59 | subdir = src/modules/engines |
58 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | 60 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in |
59 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | 61 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
@@ -102,7 +104,7 @@ DIST_SUBDIRS = software_generic buffer direct3d directfb fb psl1ght \ | |||
102 | gl_common gl_x11 gl_sdl gl_cocoa software_8 software_8_x11 \ | 104 | gl_common gl_x11 gl_sdl gl_cocoa software_8 software_8_x11 \ |
103 | software_16 software_16_ddraw software_16_wince \ | 105 | software_16 software_16_ddraw software_16_wince \ |
104 | software_16_x11 software_sdl software_16_sdl software_ddraw \ | 106 | software_16_x11 software_sdl software_16_sdl software_ddraw \ |
105 | software_gdi software_x11 | 107 | software_gdi software_x11 wayland_shm wayland_egl |
106 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | 108 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
107 | am__relativize = \ | 109 | am__relativize = \ |
108 | dir0=`pwd`; \ | 110 | dir0=`pwd`; \ |
@@ -231,8 +233,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 233 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 234 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 235 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 236 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 237 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 238 | RANLIB = @RANLIB@ |
@@ -249,6 +249,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 249 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 250 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 251 | VMAJ = @VMAJ@ |
252 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
253 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 254 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 255 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 256 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +332,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 332 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 333 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 334 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
335 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
336 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
337 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
338 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 339 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 340 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 341 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
@@ -411,7 +417,8 @@ SUBDIRS = $(am__append_1) $(am__append_2) $(am__append_3) \ | |||
411 | $(am__append_10) $(am__append_11) $(am__append_12) \ | 417 | $(am__append_10) $(am__append_11) $(am__append_12) \ |
412 | $(am__append_13) $(am__append_14) $(am__append_15) \ | 418 | $(am__append_13) $(am__append_14) $(am__append_15) \ |
413 | $(am__append_16) $(am__append_17) $(am__append_18) \ | 419 | $(am__append_16) $(am__append_17) $(am__append_18) \ |
414 | $(am__append_19) $(am__append_20) $(am__append_21) | 420 | $(am__append_19) $(am__append_20) $(am__append_21) \ |
421 | $(am__append_22) $(am__append_23) | ||
415 | all: all-recursive | 422 | all: all-recursive |
416 | 423 | ||
417 | .SUFFIXES: | 424 | .SUFFIXES: |
diff --git a/libraries/evas/src/modules/engines/buffer/Makefile.in b/libraries/evas/src/modules/engines/buffer/Makefile.in index 2311344..ec9c0b8 100644 --- a/libraries/evas/src/modules/engines/buffer/Makefile.in +++ b/libraries/evas/src/modules/engines/buffer/Makefile.in | |||
@@ -240,8 +240,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
240 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 240 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
241 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 241 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
242 | PKG_CONFIG = @PKG_CONFIG@ | 242 | PKG_CONFIG = @PKG_CONFIG@ |
243 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
244 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
245 | PNG_CFLAGS = @PNG_CFLAGS@ | 243 | PNG_CFLAGS = @PNG_CFLAGS@ |
246 | PNG_LIBS = @PNG_LIBS@ | 244 | PNG_LIBS = @PNG_LIBS@ |
247 | RANLIB = @RANLIB@ | 245 | RANLIB = @RANLIB@ |
@@ -258,6 +256,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
258 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 256 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
259 | VERSION = @VERSION@ | 257 | VERSION = @VERSION@ |
260 | VMAJ = @VMAJ@ | 258 | VMAJ = @VMAJ@ |
259 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
260 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
261 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 261 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
262 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 262 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
263 | XCB_CFLAGS = @XCB_CFLAGS@ | 263 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -339,6 +339,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
341 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 341 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
342 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
343 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
344 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
345 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
342 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 346 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
343 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 347 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
344 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 348 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/direct3d/Makefile.in b/libraries/evas/src/modules/engines/direct3d/Makefile.in index 03d892e..85baff8 100644 --- a/libraries/evas/src/modules/engines/direct3d/Makefile.in +++ b/libraries/evas/src/modules/engines/direct3d/Makefile.in | |||
@@ -293,8 +293,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
293 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 293 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
294 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 294 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
295 | PKG_CONFIG = @PKG_CONFIG@ | 295 | PKG_CONFIG = @PKG_CONFIG@ |
296 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
297 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
298 | PNG_CFLAGS = @PNG_CFLAGS@ | 296 | PNG_CFLAGS = @PNG_CFLAGS@ |
299 | PNG_LIBS = @PNG_LIBS@ | 297 | PNG_LIBS = @PNG_LIBS@ |
300 | RANLIB = @RANLIB@ | 298 | RANLIB = @RANLIB@ |
@@ -311,6 +309,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
311 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 309 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
312 | VERSION = @VERSION@ | 310 | VERSION = @VERSION@ |
313 | VMAJ = @VMAJ@ | 311 | VMAJ = @VMAJ@ |
312 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
313 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
314 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 314 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
315 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 315 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
316 | XCB_CFLAGS = @XCB_CFLAGS@ | 316 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -392,6 +392,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
392 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 392 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
393 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 393 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
394 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 394 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
395 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
396 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
397 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
398 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
395 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 399 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
396 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 400 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
397 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 401 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/directfb/Makefile.in b/libraries/evas/src/modules/engines/directfb/Makefile.in index cd5651a..df2f63b 100644 --- a/libraries/evas/src/modules/engines/directfb/Makefile.in +++ b/libraries/evas/src/modules/engines/directfb/Makefile.in | |||
@@ -240,8 +240,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
240 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 240 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
241 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 241 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
242 | PKG_CONFIG = @PKG_CONFIG@ | 242 | PKG_CONFIG = @PKG_CONFIG@ |
243 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
244 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
245 | PNG_CFLAGS = @PNG_CFLAGS@ | 243 | PNG_CFLAGS = @PNG_CFLAGS@ |
246 | PNG_LIBS = @PNG_LIBS@ | 244 | PNG_LIBS = @PNG_LIBS@ |
247 | RANLIB = @RANLIB@ | 245 | RANLIB = @RANLIB@ |
@@ -258,6 +256,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
258 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 256 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
259 | VERSION = @VERSION@ | 257 | VERSION = @VERSION@ |
260 | VMAJ = @VMAJ@ | 258 | VMAJ = @VMAJ@ |
259 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
260 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
261 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 261 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
262 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 262 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
263 | XCB_CFLAGS = @XCB_CFLAGS@ | 263 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -339,6 +339,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
341 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 341 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
342 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
343 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
344 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
345 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
342 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 346 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
343 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 347 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
344 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 348 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/fb/Makefile.in b/libraries/evas/src/modules/engines/fb/Makefile.in index aec24ff..1e82b34 100644 --- a/libraries/evas/src/modules/engines/fb/Makefile.in +++ b/libraries/evas/src/modules/engines/fb/Makefile.in | |||
@@ -244,8 +244,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
245 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 245 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
246 | PKG_CONFIG = @PKG_CONFIG@ | 246 | PKG_CONFIG = @PKG_CONFIG@ |
247 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
248 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
249 | PNG_CFLAGS = @PNG_CFLAGS@ | 247 | PNG_CFLAGS = @PNG_CFLAGS@ |
250 | PNG_LIBS = @PNG_LIBS@ | 248 | PNG_LIBS = @PNG_LIBS@ |
251 | RANLIB = @RANLIB@ | 249 | RANLIB = @RANLIB@ |
@@ -262,6 +260,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
262 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 260 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
263 | VERSION = @VERSION@ | 261 | VERSION = @VERSION@ |
264 | VMAJ = @VMAJ@ | 262 | VMAJ = @VMAJ@ |
263 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
264 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
265 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 265 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
267 | XCB_CFLAGS = @XCB_CFLAGS@ | 267 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -343,6 +343,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
346 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
347 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
348 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
349 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
346 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 350 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
347 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 351 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
348 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 352 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/gl_cocoa/Makefile.in b/libraries/evas/src/modules/engines/gl_cocoa/Makefile.in index ceea03d..6e616f4 100644 --- a/libraries/evas/src/modules/engines/gl_cocoa/Makefile.in +++ b/libraries/evas/src/modules/engines/gl_cocoa/Makefile.in | |||
@@ -258,8 +258,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
258 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 258 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
259 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 259 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
260 | PKG_CONFIG = @PKG_CONFIG@ | 260 | PKG_CONFIG = @PKG_CONFIG@ |
261 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
262 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
263 | PNG_CFLAGS = @PNG_CFLAGS@ | 261 | PNG_CFLAGS = @PNG_CFLAGS@ |
264 | PNG_LIBS = @PNG_LIBS@ | 262 | PNG_LIBS = @PNG_LIBS@ |
265 | RANLIB = @RANLIB@ | 263 | RANLIB = @RANLIB@ |
@@ -276,6 +274,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
276 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 274 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
277 | VERSION = @VERSION@ | 275 | VERSION = @VERSION@ |
278 | VMAJ = @VMAJ@ | 276 | VMAJ = @VMAJ@ |
277 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
278 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
279 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 279 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
280 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 280 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
281 | XCB_CFLAGS = @XCB_CFLAGS@ | 281 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -357,6 +357,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
357 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 357 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
358 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 358 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
359 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 359 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
360 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
361 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
362 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
363 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
360 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 364 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
361 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 365 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
362 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 366 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/gl_common/Makefile.in b/libraries/evas/src/modules/engines/gl_common/Makefile.in index 61ed478..27284f9 100644 --- a/libraries/evas/src/modules/engines/gl_common/Makefile.in +++ b/libraries/evas/src/modules/engines/gl_common/Makefile.in | |||
@@ -245,8 +245,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
245 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 245 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
246 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 246 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
247 | PKG_CONFIG = @PKG_CONFIG@ | 247 | PKG_CONFIG = @PKG_CONFIG@ |
248 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
249 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
250 | PNG_CFLAGS = @PNG_CFLAGS@ | 248 | PNG_CFLAGS = @PNG_CFLAGS@ |
251 | PNG_LIBS = @PNG_LIBS@ | 249 | PNG_LIBS = @PNG_LIBS@ |
252 | RANLIB = @RANLIB@ | 250 | RANLIB = @RANLIB@ |
@@ -263,6 +261,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
263 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 261 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
264 | VERSION = @VERSION@ | 262 | VERSION = @VERSION@ |
265 | VMAJ = @VMAJ@ | 263 | VMAJ = @VMAJ@ |
264 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
265 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
266 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 266 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
267 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 267 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
268 | XCB_CFLAGS = @XCB_CFLAGS@ | 268 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -344,6 +344,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
344 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 344 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
345 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 345 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
346 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 346 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
347 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
348 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
349 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
350 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
347 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 351 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
348 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 352 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
349 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 353 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_common.h b/libraries/evas/src/modules/engines/gl_common/evas_gl_common.h index a088748..051fb3b 100644 --- a/libraries/evas/src/modules/engines/gl_common/evas_gl_common.h +++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_common.h | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #define GL_GLEXT_PROTOTYPES | 16 | #define GL_GLEXT_PROTOTYPES |
17 | 17 | ||
18 | #ifdef BUILD_ENGINE_GL_QUARTZ | 18 | #ifdef BUILD_ENGINE_GL_COCOA |
19 | # include <OpenGL/gl.h> | 19 | # include <OpenGL/gl.h> |
20 | # include <OpenGL/glext.h> | 20 | # include <OpenGL/glext.h> |
21 | #else | 21 | #else |
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c index c99f4bd..8162cd1 100644 --- a/libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c +++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_texture.c | |||
@@ -109,7 +109,9 @@ _tex_format_index(GLuint format) | |||
109 | static void | 109 | static void |
110 | _tex_2d(int intfmt, int w, int h, int fmt, int type) | 110 | _tex_2d(int intfmt, int w, int h, int fmt, int type) |
111 | { | 111 | { |
112 | #ifdef GL_TEXTURE_INTERNAL_FORMAT | ||
112 | int intfmtret = -1; | 113 | int intfmtret = -1; |
114 | #endif | ||
113 | glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL); | 115 | glTexImage2D(GL_TEXTURE_2D, 0, intfmt, w, h, 0, fmt, type, NULL); |
114 | GLERR(__FUNCTION__, __FILE__, __LINE__, ""); | 116 | GLERR(__FUNCTION__, __FILE__, __LINE__, ""); |
115 | #ifdef GL_TEXTURE_INTERNAL_FORMAT | 117 | #ifdef GL_TEXTURE_INTERNAL_FORMAT |
@@ -479,7 +481,6 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i | |||
479 | #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) | 481 | #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) |
480 | int fmt; // EGL_MAP_GL_TEXTURE_RGBA_SEC or EGL_MAP_GL_TEXTURE_RGB_SEC or bust | 482 | int fmt; // EGL_MAP_GL_TEXTURE_RGBA_SEC or EGL_MAP_GL_TEXTURE_RGB_SEC or bust |
481 | int pixtype; // EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC or bust | 483 | int pixtype; // EGL_MAP_GL_TEXTURE_UNSIGNED_BYTE_SEC or bust |
482 | int glformat; | ||
483 | int attr[] = | 484 | int attr[] = |
484 | { | 485 | { |
485 | EGL_MAP_GL_TEXTURE_WIDTH_SEC, 32, | 486 | EGL_MAP_GL_TEXTURE_WIDTH_SEC, 32, |
@@ -914,7 +915,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im) | |||
914 | tpix = alloca(im->cache_entry.h * sizeof(DATA32)); | 915 | tpix = alloca(im->cache_entry.h * sizeof(DATA32)); |
915 | pd = tpix; | 916 | pd = tpix; |
916 | ps = im->image.data; | 917 | ps = im->image.data; |
917 | for (i = 0; i < im->cache_entry.h; i++) | 918 | for (i = 0; i < (int)im->cache_entry.h; i++) |
918 | { | 919 | { |
919 | *pd = *ps; | 920 | *pd = *ps; |
920 | pd++; | 921 | pd++; |
@@ -929,7 +930,7 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im) | |||
929 | tpix); | 930 | tpix); |
930 | pd = tpix; | 931 | pd = tpix; |
931 | ps = im->image.data + (im->cache_entry.w - 1); | 932 | ps = im->image.data + (im->cache_entry.w - 1); |
932 | for (i = 0; i < im->cache_entry.h; i++) | 933 | for (i = 0; i < (int)im->cache_entry.h; i++) |
933 | { | 934 | { |
934 | *pd = *ps; | 935 | *pd = *ps; |
935 | pd++; | 936 | pd++; |
diff --git a/libraries/evas/src/modules/engines/gl_sdl/Makefile.in b/libraries/evas/src/modules/engines/gl_sdl/Makefile.in index 5d4135d..bfb29ac 100644 --- a/libraries/evas/src/modules/engines/gl_sdl/Makefile.in +++ b/libraries/evas/src/modules/engines/gl_sdl/Makefile.in | |||
@@ -239,8 +239,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
239 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 239 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
240 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 240 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
241 | PKG_CONFIG = @PKG_CONFIG@ | 241 | PKG_CONFIG = @PKG_CONFIG@ |
242 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
243 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
244 | PNG_CFLAGS = @PNG_CFLAGS@ | 242 | PNG_CFLAGS = @PNG_CFLAGS@ |
245 | PNG_LIBS = @PNG_LIBS@ | 243 | PNG_LIBS = @PNG_LIBS@ |
246 | RANLIB = @RANLIB@ | 244 | RANLIB = @RANLIB@ |
@@ -257,6 +255,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
257 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 255 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
258 | VERSION = @VERSION@ | 256 | VERSION = @VERSION@ |
259 | VMAJ = @VMAJ@ | 257 | VMAJ = @VMAJ@ |
258 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
259 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
260 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 260 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
261 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 261 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
262 | XCB_CFLAGS = @XCB_CFLAGS@ | 262 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -338,6 +338,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
338 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 338 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
339 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 339 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
340 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 340 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
341 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
342 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
343 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
344 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
341 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 345 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
342 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 346 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
343 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 347 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/gl_x11/Makefile.in b/libraries/evas/src/modules/engines/gl_x11/Makefile.in index f589e61..ad4944e 100644 --- a/libraries/evas/src/modules/engines/gl_x11/Makefile.in +++ b/libraries/evas/src/modules/engines/gl_x11/Makefile.in | |||
@@ -242,8 +242,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
242 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 242 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
243 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 243 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
244 | PKG_CONFIG = @PKG_CONFIG@ | 244 | PKG_CONFIG = @PKG_CONFIG@ |
245 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
246 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
247 | PNG_CFLAGS = @PNG_CFLAGS@ | 245 | PNG_CFLAGS = @PNG_CFLAGS@ |
248 | PNG_LIBS = @PNG_LIBS@ | 246 | PNG_LIBS = @PNG_LIBS@ |
249 | RANLIB = @RANLIB@ | 247 | RANLIB = @RANLIB@ |
@@ -260,6 +258,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
260 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 258 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
261 | VERSION = @VERSION@ | 259 | VERSION = @VERSION@ |
262 | VMAJ = @VMAJ@ | 260 | VMAJ = @VMAJ@ |
261 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
262 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
263 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 263 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
264 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 264 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
265 | XCB_CFLAGS = @XCB_CFLAGS@ | 265 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -341,6 +341,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
341 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 341 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
342 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 342 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
343 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 343 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
344 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
345 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
346 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
347 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
344 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 348 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
345 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 349 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
346 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 350 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/gl_x11/evas_engine.c b/libraries/evas/src/modules/engines/gl_x11/evas_engine.c index 38e0c13..fbbd1a2 100644 --- a/libraries/evas/src/modules/engines/gl_x11/evas_engine.c +++ b/libraries/evas/src/modules/engines/gl_x11/evas_engine.c | |||
@@ -584,25 +584,30 @@ _extensions_init(Render_Engine *re) | |||
584 | 584 | ||
585 | #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) | 585 | #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) |
586 | // EGL Extensions | 586 | // EGL Extensions |
587 | evasglexts = glsym_eglQueryString(re->win->egl_disp, EGL_EXTENSIONS); | 587 | if (glsym_eglQueryString) |
588 | { | ||
589 | evasglexts = glsym_eglQueryString(re->win->egl_disp, EGL_EXTENSIONS); | ||
588 | #else | 590 | #else |
589 | evasglexts = glXQueryExtensionsString(re->info->info.display, | 591 | if (glsym_glXQueryExtensionsString) |
590 | re->info->info.screen); | 592 | { |
593 | evasglexts = glXQueryExtensionsString(re->info->info.display, | ||
594 | re->info->info.screen); | ||
591 | #endif | 595 | #endif |
592 | 596 | ||
593 | DBG("--------EvasGL Extensions----------"); | 597 | DBG("--------EvasGL Extensions----------"); |
594 | for (i = 0; _evasgl_ext_entries[i].name != NULL; i++) | 598 | for (i = 0; _evasgl_ext_entries[i].name != NULL; i++) |
595 | { | ||
596 | if ( (strstr(evasglexts, _evasgl_ext_entries[i].name) != NULL) || | ||
597 | (strstr(evasglexts, _evasgl_ext_entries[i].real_name) != NULL) ) | ||
598 | { | 599 | { |
599 | _evasgl_ext_entries[i].supported = 1; | 600 | if ( (strstr(evasglexts, _evasgl_ext_entries[i].name) != NULL) || |
600 | strcat(_evasgl_ext_string, _evasgl_ext_entries[i].name); | 601 | (strstr(evasglexts, _evasgl_ext_entries[i].real_name) != NULL) ) |
601 | strcat(_evasgl_ext_string, " "); | 602 | { |
602 | DBG("\t%s", _evasgl_ext_entries[i].name); | 603 | _evasgl_ext_entries[i].supported = 1; |
604 | strcat(_evasgl_ext_string, _evasgl_ext_entries[i].name); | ||
605 | strcat(_evasgl_ext_string, " "); | ||
606 | DBG("\t%s", _evasgl_ext_entries[i].name); | ||
607 | } | ||
603 | } | 608 | } |
609 | DBG(" "); | ||
604 | } | 610 | } |
605 | DBG(" "); | ||
606 | } | 611 | } |
607 | 612 | ||
608 | int _evas_engine_GL_X11_log_dom = -1; | 613 | int _evas_engine_GL_X11_log_dom = -1; |
@@ -1125,12 +1130,12 @@ eng_output_redraws_rect_add(void *data, int x, int y, int w, int h) | |||
1125 | eng_window_use(re->win); | 1130 | eng_window_use(re->win); |
1126 | evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot); | 1131 | evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot); |
1127 | evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); | 1132 | evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); |
1128 | /* | 1133 | |
1129 | RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->w, re->win->h); | 1134 | RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->w, re->win->h); |
1130 | if ((w <= 0) || (h <= 0)) return; | 1135 | if ((w <= 0) || (h <= 0)) return; |
1131 | if (!re->win->draw.redraw) | 1136 | if (!re->win->draw.redraw) |
1132 | { | 1137 | { |
1133 | #if 0 | 1138 | #if 1 |
1134 | re->win->draw.x1 = x; | 1139 | re->win->draw.x1 = x; |
1135 | re->win->draw.y1 = y; | 1140 | re->win->draw.y1 = y; |
1136 | re->win->draw.x2 = x + w - 1; | 1141 | re->win->draw.x2 = x + w - 1; |
@@ -1150,11 +1155,10 @@ eng_output_redraws_rect_add(void *data, int x, int y, int w, int h) | |||
1150 | if ((y + h - 1) > re->win->draw.y2) re->win->draw.y2 = y + h - 1; | 1155 | if ((y + h - 1) > re->win->draw.y2) re->win->draw.y2 = y + h - 1; |
1151 | } | 1156 | } |
1152 | re->win->draw.redraw = 1; | 1157 | re->win->draw.redraw = 1; |
1153 | */ | ||
1154 | } | 1158 | } |
1155 | 1159 | ||
1156 | static void | 1160 | static void |
1157 | eng_output_redraws_rect_del(void *data __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | 1161 | eng_output_redraws_rect_del(void *data, int x, int y, int w, int h) |
1158 | { | 1162 | { |
1159 | Render_Engine *re; | 1163 | Render_Engine *re; |
1160 | 1164 | ||
@@ -1244,10 +1248,10 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i | |||
1244 | //#define FRAMECOUNT 1 | 1248 | //#define FRAMECOUNT 1 |
1245 | 1249 | ||
1246 | #ifdef FRAMECOUNT | 1250 | #ifdef FRAMECOUNT |
1247 | double | 1251 | static double |
1248 | get_time(void) | 1252 | get_time(void) |
1249 | { | 1253 | { |
1250 | struct timeval timev; | 1254 | struct timeval timev; |
1251 | 1255 | ||
1252 | gettimeofday(&timev, NULL); | 1256 | gettimeofday(&timev, NULL); |
1253 | return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); | 1257 | return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); |
@@ -1391,44 +1395,46 @@ eng_output_flush(void *data) | |||
1391 | { | 1395 | { |
1392 | re->info->callback.pre_swap(re->info->callback.data, re->evas); | 1396 | re->info->callback.pre_swap(re->info->callback.data, re->evas); |
1393 | } | 1397 | } |
1394 | /* | 1398 | #if 1 |
1395 | if ((1) | 1399 | if (1) |
1396 | // (re->win->draw.x1 == 0) && | 1400 | #else |
1397 | // (re->win->draw.y1 == 0) && | 1401 | if ((re->win->draw.x1 == 0) && (re->win->draw.y1 == 0) && (re->win->draw.x2 == (re->win->w - 1)) && (re->win->draw.y2 == (re->win->h - 1))) |
1398 | // (re->win->draw.x2 == (re->win->w - 1)) && | 1402 | #endif |
1399 | // (re->win->draw.y2 == (re->win->h - 1)) | ||
1400 | ) | ||
1401 | */ | ||
1402 | { | 1403 | { |
1404 | // double t, t2 = 0.0; | ||
1405 | // t = get_time(); | ||
1403 | glXSwapBuffers(re->win->disp, re->win->win); | 1406 | glXSwapBuffers(re->win->disp, re->win->win); |
1404 | if (!safe_native) glXWaitGL(); | 1407 | // t = get_time() - t; |
1408 | // if (!safe_native) | ||
1409 | // { | ||
1410 | // t2 = get_time(); | ||
1411 | // glXWaitGL(); | ||
1412 | // t2 = get_time() - t2; | ||
1413 | // } | ||
1414 | // printf("swap: %3.5f (%3.5fms), x wait gl: %3.5f (%3.5fms)\n", | ||
1415 | // t, t * 1000.0, t2, t2 * 1000.0); | ||
1405 | } | 1416 | } |
1406 | /* | ||
1407 | else | 1417 | else |
1408 | { | 1418 | { |
1409 | // FIXME: this doesn't work.. why oh why? | 1419 | // FIXME: this doesn't work.. why oh why? |
1410 | int sx, sy, sw, sh; | 1420 | int sx, sy, sw, sh; |
1411 | 1421 | ||
1412 | // fimxe - reset when done | ||
1413 | // glEnable(GL_SCISSOR_TEST); | ||
1414 | glDrawBuffer(GL_FRONT); | ||
1415 | |||
1416 | sx = re->win->draw.x1; | 1422 | sx = re->win->draw.x1; |
1417 | sy = re->win->draw.y1; | 1423 | sy = re->win->draw.y1; |
1418 | sw = (re->win->draw.x2 - re->win->draw.x1) + 1; | 1424 | sw = (re->win->draw.x2 - re->win->draw.x1) + 1; |
1419 | sh = (re->win->draw.y2 - re->win->draw.y1) + 1; | 1425 | sh = (re->win->draw.y2 - re->win->draw.y1) + 1; |
1420 | sy = re->win->h - sy - sh; | 1426 | sy = re->win->h - sy - sh; |
1421 | 1427 | ||
1422 | // glScissor(sx, sy, sw, sh); | 1428 | glBitmap(0, 0, 0, 0, sx, re->win->h - sy, NULL); |
1423 | glRasterPos2i(sx, re->win->h - sy); | 1429 | glEnable(GL_SCISSOR_TEST); |
1430 | glScissor(sx, sy, sw, sh); | ||
1431 | glDrawBuffer(GL_FRONT); | ||
1424 | glCopyPixels(sx, sy, sw, sh, GL_COLOR); | 1432 | glCopyPixels(sx, sy, sw, sh, GL_COLOR); |
1425 | glRasterPos2i(0, 0); | ||
1426 | |||
1427 | // glDisable(GL_SCISSOR_TEST); | ||
1428 | glDrawBuffer(GL_BACK); | 1433 | glDrawBuffer(GL_BACK); |
1434 | glDisable(GL_SCISSOR_TEST); | ||
1435 | glBitmap(0, 0, 0, 0, 0, 0, NULL); | ||
1429 | glFlush(); | 1436 | glFlush(); |
1430 | } | 1437 | } |
1431 | */ | ||
1432 | if (re->info->callback.post_swap) | 1438 | if (re->info->callback.post_swap) |
1433 | { | 1439 | { |
1434 | re->info->callback.post_swap(re->info->callback.data, re->evas); | 1440 | re->info->callback.post_swap(re->info->callback.data, re->evas); |
@@ -3469,7 +3475,10 @@ evgl_evasglCreateImage(int target, void* buffer, int *attrib_list) | |||
3469 | attrib_list); | 3475 | attrib_list); |
3470 | } | 3476 | } |
3471 | else | 3477 | else |
3472 | ERR("Invalid Engine... (Can't acccess EGL Display)\n"); | 3478 | { |
3479 | ERR("Invalid Engine... (Can't acccess EGL Display)\n"); | ||
3480 | return NULL; | ||
3481 | } | ||
3473 | } | 3482 | } |
3474 | 3483 | ||
3475 | static void | 3484 | static void |
@@ -3826,6 +3835,18 @@ eng_image_animated_frame_set(void *data __UNUSED__, void *image, int frame_index | |||
3826 | return EINA_TRUE; | 3835 | return EINA_TRUE; |
3827 | } | 3836 | } |
3828 | 3837 | ||
3838 | static Eina_Bool | ||
3839 | eng_image_can_region_get(void *data __UNUSED__, void *image) | ||
3840 | { | ||
3841 | Evas_GL_Image *gim = image; | ||
3842 | Image_Entry *im; | ||
3843 | if (!gim) return EINA_FALSE; | ||
3844 | im = (Image_Entry *)gim->im; | ||
3845 | if (!im) return EINA_FALSE; | ||
3846 | return ((Evas_Image_Load_Func*) im->info.loader)->do_region; | ||
3847 | } | ||
3848 | |||
3849 | |||
3829 | static void | 3850 | static void |
3830 | eng_image_max_size_get(void *data, int *maxw, int *maxh) | 3851 | eng_image_max_size_get(void *data, int *maxw, int *maxh) |
3831 | { | 3852 | { |
@@ -3903,6 +3924,7 @@ module_open(Evas_Module *em) | |||
3903 | ORD(image_format_get); | 3924 | ORD(image_format_get); |
3904 | ORD(image_colorspace_set); | 3925 | ORD(image_colorspace_set); |
3905 | ORD(image_colorspace_get); | 3926 | ORD(image_colorspace_get); |
3927 | ORD(image_can_region_get); | ||
3906 | ORD(image_mask_create); | 3928 | ORD(image_mask_create); |
3907 | ORD(image_native_set); | 3929 | ORD(image_native_set); |
3908 | ORD(image_native_get); | 3930 | ORD(image_native_get); |
diff --git a/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c b/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c index 323c976..c29ab67 100644 --- a/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c +++ b/libraries/evas/src/modules/engines/gl_x11/evas_x_main.c | |||
@@ -531,13 +531,13 @@ eng_window_free(Evas_GL_X11_Window *gw) | |||
531 | #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) | 531 | #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) |
532 | if (gw->egl_surface[0] != EGL_NO_SURFACE) | 532 | if (gw->egl_surface[0] != EGL_NO_SURFACE) |
533 | eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); | 533 | eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); |
534 | eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
534 | if (ref == 0) | 535 | if (ref == 0) |
535 | { | 536 | { |
536 | if (context) eglDestroyContext(gw->egl_disp, context); | 537 | if (context) eglDestroyContext(gw->egl_disp, context); |
537 | eglTerminate(gw->egl_disp); | 538 | eglTerminate(gw->egl_disp); |
538 | context = EGL_NO_CONTEXT; | 539 | context = EGL_NO_CONTEXT; |
539 | } | 540 | } |
540 | eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
541 | #else | 541 | #else |
542 | if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin); | 542 | if (gw->glxwin) glXDestroyWindow(gw->disp, gw->glxwin); |
543 | if (ref == 0) | 543 | if (ref == 0) |
diff --git a/libraries/evas/src/modules/engines/psl1ght/Makefile.in b/libraries/evas/src/modules/engines/psl1ght/Makefile.in index 6b553ac..f8524a4 100644 --- a/libraries/evas/src/modules/engines/psl1ght/Makefile.in +++ b/libraries/evas/src/modules/engines/psl1ght/Makefile.in | |||
@@ -240,8 +240,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
240 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 240 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
241 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 241 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
242 | PKG_CONFIG = @PKG_CONFIG@ | 242 | PKG_CONFIG = @PKG_CONFIG@ |
243 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
244 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
245 | PNG_CFLAGS = @PNG_CFLAGS@ | 243 | PNG_CFLAGS = @PNG_CFLAGS@ |
246 | PNG_LIBS = @PNG_LIBS@ | 244 | PNG_LIBS = @PNG_LIBS@ |
247 | RANLIB = @RANLIB@ | 245 | RANLIB = @RANLIB@ |
@@ -258,6 +256,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
258 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 256 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
259 | VERSION = @VERSION@ | 257 | VERSION = @VERSION@ |
260 | VMAJ = @VMAJ@ | 258 | VMAJ = @VMAJ@ |
259 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
260 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
261 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 261 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
262 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 262 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
263 | XCB_CFLAGS = @XCB_CFLAGS@ | 263 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -339,6 +339,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
341 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 341 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
342 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
343 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
344 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
345 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
342 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 346 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
343 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 347 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
344 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 348 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_16/Makefile.in b/libraries/evas/src/modules/engines/software_16/Makefile.in index 1fc95cf..88164e1 100644 --- a/libraries/evas/src/modules/engines/software_16/Makefile.in +++ b/libraries/evas/src/modules/engines/software_16/Makefile.in | |||
@@ -235,8 +235,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
235 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 235 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
236 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 236 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
237 | PKG_CONFIG = @PKG_CONFIG@ | 237 | PKG_CONFIG = @PKG_CONFIG@ |
238 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
239 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
240 | PNG_CFLAGS = @PNG_CFLAGS@ | 238 | PNG_CFLAGS = @PNG_CFLAGS@ |
241 | PNG_LIBS = @PNG_LIBS@ | 239 | PNG_LIBS = @PNG_LIBS@ |
242 | RANLIB = @RANLIB@ | 240 | RANLIB = @RANLIB@ |
@@ -253,6 +251,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
253 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 251 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
254 | VERSION = @VERSION@ | 252 | VERSION = @VERSION@ |
255 | VMAJ = @VMAJ@ | 253 | VMAJ = @VMAJ@ |
254 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
255 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
256 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 256 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
257 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 257 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
258 | XCB_CFLAGS = @XCB_CFLAGS@ | 258 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -334,6 +334,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
334 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 334 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
335 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 335 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
336 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 336 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
337 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
338 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
339 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
340 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 341 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 342 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 343 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_16_ddraw/Makefile.in b/libraries/evas/src/modules/engines/software_16_ddraw/Makefile.in index f588c4f..0039410 100644 --- a/libraries/evas/src/modules/engines/software_16_ddraw/Makefile.in +++ b/libraries/evas/src/modules/engines/software_16_ddraw/Makefile.in | |||
@@ -265,8 +265,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
265 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 265 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
266 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 266 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
267 | PKG_CONFIG = @PKG_CONFIG@ | 267 | PKG_CONFIG = @PKG_CONFIG@ |
268 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
269 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
270 | PNG_CFLAGS = @PNG_CFLAGS@ | 268 | PNG_CFLAGS = @PNG_CFLAGS@ |
271 | PNG_LIBS = @PNG_LIBS@ | 269 | PNG_LIBS = @PNG_LIBS@ |
272 | RANLIB = @RANLIB@ | 270 | RANLIB = @RANLIB@ |
@@ -283,6 +281,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
283 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 281 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
284 | VERSION = @VERSION@ | 282 | VERSION = @VERSION@ |
285 | VMAJ = @VMAJ@ | 283 | VMAJ = @VMAJ@ |
284 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
285 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
286 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 286 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
287 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 287 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
288 | XCB_CFLAGS = @XCB_CFLAGS@ | 288 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -364,6 +364,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
364 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 364 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
365 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 365 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
366 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 366 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
367 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
368 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
369 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
370 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
367 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 371 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
368 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 372 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
369 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 373 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_16_sdl/Makefile.in b/libraries/evas/src/modules/engines/software_16_sdl/Makefile.in index 219e392..6ebf0db 100644 --- a/libraries/evas/src/modules/engines/software_16_sdl/Makefile.in +++ b/libraries/evas/src/modules/engines/software_16_sdl/Makefile.in | |||
@@ -238,8 +238,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
238 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 238 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
239 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 239 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
240 | PKG_CONFIG = @PKG_CONFIG@ | 240 | PKG_CONFIG = @PKG_CONFIG@ |
241 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
242 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
243 | PNG_CFLAGS = @PNG_CFLAGS@ | 241 | PNG_CFLAGS = @PNG_CFLAGS@ |
244 | PNG_LIBS = @PNG_LIBS@ | 242 | PNG_LIBS = @PNG_LIBS@ |
245 | RANLIB = @RANLIB@ | 243 | RANLIB = @RANLIB@ |
@@ -256,6 +254,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
256 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 254 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
257 | VERSION = @VERSION@ | 255 | VERSION = @VERSION@ |
258 | VMAJ = @VMAJ@ | 256 | VMAJ = @VMAJ@ |
257 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
258 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
259 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 259 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
260 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 260 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
261 | XCB_CFLAGS = @XCB_CFLAGS@ | 261 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -337,6 +337,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
337 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 337 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
338 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 338 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
339 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 339 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
340 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
341 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
342 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
343 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
340 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 344 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
341 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 345 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
342 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 346 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_16_wince/Makefile.in b/libraries/evas/src/modules/engines/software_16_wince/Makefile.in index 571891e..95c484e 100644 --- a/libraries/evas/src/modules/engines/software_16_wince/Makefile.in +++ b/libraries/evas/src/modules/engines/software_16_wince/Makefile.in | |||
@@ -271,8 +271,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
271 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 271 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
272 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 272 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
273 | PKG_CONFIG = @PKG_CONFIG@ | 273 | PKG_CONFIG = @PKG_CONFIG@ |
274 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
275 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
276 | PNG_CFLAGS = @PNG_CFLAGS@ | 274 | PNG_CFLAGS = @PNG_CFLAGS@ |
277 | PNG_LIBS = @PNG_LIBS@ | 275 | PNG_LIBS = @PNG_LIBS@ |
278 | RANLIB = @RANLIB@ | 276 | RANLIB = @RANLIB@ |
@@ -289,6 +287,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
289 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 287 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
290 | VERSION = @VERSION@ | 288 | VERSION = @VERSION@ |
291 | VMAJ = @VMAJ@ | 289 | VMAJ = @VMAJ@ |
290 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
291 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
292 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 292 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
293 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 293 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
294 | XCB_CFLAGS = @XCB_CFLAGS@ | 294 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -370,6 +370,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
370 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 370 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
371 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 371 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
372 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 372 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
373 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
374 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
375 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
376 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
373 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 377 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
374 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 378 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
375 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 379 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_16_x11/Makefile.in b/libraries/evas/src/modules/engines/software_16_x11/Makefile.in index be43dad..3232681 100644 --- a/libraries/evas/src/modules/engines/software_16_x11/Makefile.in +++ b/libraries/evas/src/modules/engines/software_16_x11/Makefile.in | |||
@@ -244,8 +244,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
245 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 245 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
246 | PKG_CONFIG = @PKG_CONFIG@ | 246 | PKG_CONFIG = @PKG_CONFIG@ |
247 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
248 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
249 | PNG_CFLAGS = @PNG_CFLAGS@ | 247 | PNG_CFLAGS = @PNG_CFLAGS@ |
250 | PNG_LIBS = @PNG_LIBS@ | 248 | PNG_LIBS = @PNG_LIBS@ |
251 | RANLIB = @RANLIB@ | 249 | RANLIB = @RANLIB@ |
@@ -262,6 +260,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
262 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 260 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
263 | VERSION = @VERSION@ | 261 | VERSION = @VERSION@ |
264 | VMAJ = @VMAJ@ | 262 | VMAJ = @VMAJ@ |
263 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
264 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
265 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 265 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
267 | XCB_CFLAGS = @XCB_CFLAGS@ | 267 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -343,6 +343,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
346 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
347 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
348 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
349 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
346 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 350 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
347 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 351 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
348 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 352 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_8/Makefile.in b/libraries/evas/src/modules/engines/software_8/Makefile.in index bf16fcf..3ee42fd 100644 --- a/libraries/evas/src/modules/engines/software_8/Makefile.in +++ b/libraries/evas/src/modules/engines/software_8/Makefile.in | |||
@@ -234,8 +234,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
234 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 234 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
235 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 235 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
236 | PKG_CONFIG = @PKG_CONFIG@ | 236 | PKG_CONFIG = @PKG_CONFIG@ |
237 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
238 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
239 | PNG_CFLAGS = @PNG_CFLAGS@ | 237 | PNG_CFLAGS = @PNG_CFLAGS@ |
240 | PNG_LIBS = @PNG_LIBS@ | 238 | PNG_LIBS = @PNG_LIBS@ |
241 | RANLIB = @RANLIB@ | 239 | RANLIB = @RANLIB@ |
@@ -252,6 +250,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
252 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 250 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
253 | VERSION = @VERSION@ | 251 | VERSION = @VERSION@ |
254 | VMAJ = @VMAJ@ | 252 | VMAJ = @VMAJ@ |
253 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
254 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
255 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 255 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
256 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 256 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
257 | XCB_CFLAGS = @XCB_CFLAGS@ | 257 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -333,6 +333,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
333 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 333 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
334 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 334 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
335 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 335 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
336 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
337 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
338 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
339 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
336 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 340 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
337 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 341 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
338 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 342 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_8_x11/Makefile.in b/libraries/evas/src/modules/engines/software_8_x11/Makefile.in index fa88a4d..22577af 100644 --- a/libraries/evas/src/modules/engines/software_8_x11/Makefile.in +++ b/libraries/evas/src/modules/engines/software_8_x11/Makefile.in | |||
@@ -244,8 +244,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
245 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 245 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
246 | PKG_CONFIG = @PKG_CONFIG@ | 246 | PKG_CONFIG = @PKG_CONFIG@ |
247 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
248 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
249 | PNG_CFLAGS = @PNG_CFLAGS@ | 247 | PNG_CFLAGS = @PNG_CFLAGS@ |
250 | PNG_LIBS = @PNG_LIBS@ | 248 | PNG_LIBS = @PNG_LIBS@ |
251 | RANLIB = @RANLIB@ | 249 | RANLIB = @RANLIB@ |
@@ -262,6 +260,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
262 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 260 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
263 | VERSION = @VERSION@ | 261 | VERSION = @VERSION@ |
264 | VMAJ = @VMAJ@ | 262 | VMAJ = @VMAJ@ |
263 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
264 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
265 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 265 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
267 | XCB_CFLAGS = @XCB_CFLAGS@ | 267 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -343,6 +343,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
346 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
347 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
348 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
349 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
346 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 350 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
347 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 351 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
348 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 352 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_ddraw/Makefile.in b/libraries/evas/src/modules/engines/software_ddraw/Makefile.in index be4c977..da65f92 100644 --- a/libraries/evas/src/modules/engines/software_ddraw/Makefile.in +++ b/libraries/evas/src/modules/engines/software_ddraw/Makefile.in | |||
@@ -266,8 +266,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
266 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 266 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
267 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 267 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
268 | PKG_CONFIG = @PKG_CONFIG@ | 268 | PKG_CONFIG = @PKG_CONFIG@ |
269 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
270 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
271 | PNG_CFLAGS = @PNG_CFLAGS@ | 269 | PNG_CFLAGS = @PNG_CFLAGS@ |
272 | PNG_LIBS = @PNG_LIBS@ | 270 | PNG_LIBS = @PNG_LIBS@ |
273 | RANLIB = @RANLIB@ | 271 | RANLIB = @RANLIB@ |
@@ -284,6 +282,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
284 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 282 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
285 | VERSION = @VERSION@ | 283 | VERSION = @VERSION@ |
286 | VMAJ = @VMAJ@ | 284 | VMAJ = @VMAJ@ |
285 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
286 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
287 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 287 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
288 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 288 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
289 | XCB_CFLAGS = @XCB_CFLAGS@ | 289 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -365,6 +365,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
365 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 365 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
366 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 366 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
367 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 367 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
368 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
369 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
370 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
371 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
368 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 372 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
369 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 373 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
370 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 374 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_gdi/Makefile.in b/libraries/evas/src/modules/engines/software_gdi/Makefile.in index 5dea632..a2421ef 100644 --- a/libraries/evas/src/modules/engines/software_gdi/Makefile.in +++ b/libraries/evas/src/modules/engines/software_gdi/Makefile.in | |||
@@ -249,8 +249,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
249 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 249 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
250 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 250 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
251 | PKG_CONFIG = @PKG_CONFIG@ | 251 | PKG_CONFIG = @PKG_CONFIG@ |
252 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
253 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
254 | PNG_CFLAGS = @PNG_CFLAGS@ | 252 | PNG_CFLAGS = @PNG_CFLAGS@ |
255 | PNG_LIBS = @PNG_LIBS@ | 253 | PNG_LIBS = @PNG_LIBS@ |
256 | RANLIB = @RANLIB@ | 254 | RANLIB = @RANLIB@ |
@@ -267,6 +265,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
267 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 265 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
268 | VERSION = @VERSION@ | 266 | VERSION = @VERSION@ |
269 | VMAJ = @VMAJ@ | 267 | VMAJ = @VMAJ@ |
268 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
269 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
270 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 270 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
271 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 271 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
272 | XCB_CFLAGS = @XCB_CFLAGS@ | 272 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -348,6 +348,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
348 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 348 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
349 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 349 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
350 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 350 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
351 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
352 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
353 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
354 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
351 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 355 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
352 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 356 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
353 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 357 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_generic/Makefile.in b/libraries/evas/src/modules/engines/software_generic/Makefile.in index 6d75f23..4f66536 100644 --- a/libraries/evas/src/modules/engines/software_generic/Makefile.in +++ b/libraries/evas/src/modules/engines/software_generic/Makefile.in | |||
@@ -236,8 +236,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
236 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 236 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
237 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 237 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
238 | PKG_CONFIG = @PKG_CONFIG@ | 238 | PKG_CONFIG = @PKG_CONFIG@ |
239 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
240 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
241 | PNG_CFLAGS = @PNG_CFLAGS@ | 239 | PNG_CFLAGS = @PNG_CFLAGS@ |
242 | PNG_LIBS = @PNG_LIBS@ | 240 | PNG_LIBS = @PNG_LIBS@ |
243 | RANLIB = @RANLIB@ | 241 | RANLIB = @RANLIB@ |
@@ -254,6 +252,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
254 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 252 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
255 | VERSION = @VERSION@ | 253 | VERSION = @VERSION@ |
256 | VMAJ = @VMAJ@ | 254 | VMAJ = @VMAJ@ |
255 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
256 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
257 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 257 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
258 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 258 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
259 | XCB_CFLAGS = @XCB_CFLAGS@ | 259 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -335,6 +335,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
335 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 335 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
336 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 336 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
337 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 337 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
338 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
339 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
340 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
341 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
338 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 342 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
339 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 343 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
340 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 344 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_generic/evas_engine.c b/libraries/evas/src/modules/engines/software_generic/evas_engine.c index b2c53c5..48944dd 100644 --- a/libraries/evas/src/modules/engines/software_generic/evas_engine.c +++ b/libraries/evas/src/modules/engines/software_generic/evas_engine.c | |||
@@ -1,6 +1,275 @@ | |||
1 | #include "evas_common.h" /* Also includes international specific stuff */ | 1 | #include "evas_common.h" /* Also includes international specific stuff */ |
2 | #include "evas_private.h" | 2 | #include "evas_private.h" |
3 | 3 | ||
4 | #ifdef HAVE_DLSYM | ||
5 | # include <dlfcn.h> /* dlopen,dlclose,etc */ | ||
6 | |||
7 | # define EVAS_GL 1 | ||
8 | # define EVAS_GL_NO_GL_H_CHECK 1 | ||
9 | # include "Evas_GL.h" | ||
10 | |||
11 | #else | ||
12 | # warning software_generic will not be able to have Evas_GL API. | ||
13 | #endif | ||
14 | |||
15 | #ifdef EVAS_GL | ||
16 | //----------------------------------// | ||
17 | // OSMesa... | ||
18 | |||
19 | #define OSMESA_MAJOR_VERSION 6 | ||
20 | #define OSMESA_MINOR_VERSION 5 | ||
21 | #define OSMESA_PATCH_VERSION 0 | ||
22 | |||
23 | /* | ||
24 | * Values for the format parameter of OSMesaCreateContext() | ||
25 | * New in version 2.0. | ||
26 | */ | ||
27 | #define OSMESA_COLOR_INDEX GL_COLOR_INDEX | ||
28 | #define OSMESA_RGBA GL_RGBA | ||
29 | #define OSMESA_BGRA 0x1 | ||
30 | #define OSMESA_ARGB 0x2 | ||
31 | #define OSMESA_RGB GL_RGB | ||
32 | #define OSMESA_BGR 0x4 | ||
33 | #define OSMESA_RGB_565 0x5 | ||
34 | |||
35 | |||
36 | /* | ||
37 | * OSMesaPixelStore() parameters: | ||
38 | * New in version 2.0. | ||
39 | */ | ||
40 | #define OSMESA_ROW_LENGTH 0x10 | ||
41 | #define OSMESA_Y_UP 0x11 | ||
42 | |||
43 | |||
44 | /* | ||
45 | * Accepted by OSMesaGetIntegerv: | ||
46 | */ | ||
47 | #define OSMESA_WIDTH 0x20 | ||
48 | #define OSMESA_HEIGHT 0x21 | ||
49 | #define OSMESA_FORMAT 0x22 | ||
50 | #define OSMESA_TYPE 0x23 | ||
51 | #define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */ | ||
52 | #define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */ | ||
53 | |||
54 | |||
55 | typedef void (*OSMESAproc)(); | ||
56 | typedef struct osmesa_context *OSMesaContext; | ||
57 | #endif | ||
58 | |||
59 | typedef struct _Render_Engine_GL_Surface Render_Engine_GL_Surface; | ||
60 | typedef struct _Render_Engine_GL_Context Render_Engine_GL_Context; | ||
61 | |||
62 | struct _Render_Engine_GL_Surface | ||
63 | { | ||
64 | int initialized; | ||
65 | int w, h; | ||
66 | |||
67 | #ifdef EVAS_GL | ||
68 | GLenum internal_fmt; | ||
69 | #endif | ||
70 | int internal_cpp; // Component per pixel. ie. RGB = 3 | ||
71 | |||
72 | int depth_bits; | ||
73 | int stencil_bits; | ||
74 | |||
75 | // Data | ||
76 | void *buffer; | ||
77 | |||
78 | Render_Engine_GL_Context *current_ctx; | ||
79 | }; | ||
80 | |||
81 | #ifdef EVAS_GL | ||
82 | struct _Render_Engine_GL_Context | ||
83 | { | ||
84 | int initialized; | ||
85 | |||
86 | OSMesaContext context; | ||
87 | |||
88 | Render_Engine_GL_Context *share_ctx; | ||
89 | |||
90 | Render_Engine_GL_Surface *current_sfc; | ||
91 | }; | ||
92 | |||
93 | //------------------------------------------------------// | ||
94 | typedef void (*_eng_fn) (void ); | ||
95 | typedef _eng_fn (*glsym_func_eng_fn) (); | ||
96 | typedef void (*glsym_func_void) (); | ||
97 | typedef unsigned int (*glsym_func_uint) (); | ||
98 | typedef int (*glsym_func_int) (); | ||
99 | typedef unsigned char (*glsym_func_uchar) (); | ||
100 | typedef unsigned char *(*glsym_func_uchar_ptr) (); | ||
101 | typedef const unsigned char *(*glsym_func_const_uchar_ptr) (); | ||
102 | typedef char const *(*glsym_func_char_const_ptr) (); | ||
103 | typedef GLboolean (*glsym_func_bool) (); | ||
104 | typedef OSMesaContext (*glsym_func_osm_ctx) (); | ||
105 | //------------------------------------------------------// | ||
106 | |||
107 | /* Function table for GL APIs */ | ||
108 | static Evas_GL_API gl_funcs; | ||
109 | static void *gl_lib_handle; | ||
110 | static int gl_lib_is_gles = 0; | ||
111 | static Evas_GL_API gl_funcs; | ||
112 | |||
113 | //------------------------------------------------------// | ||
114 | // OSMesa APIS... | ||
115 | static OSMesaContext (*_sym_OSMesaCreateContextExt) (GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, OSMesaContext sharelist) = NULL; | ||
116 | static void (*_sym_OSMesaDestroyContext) (OSMesaContext ctx) = NULL; | ||
117 | static GLboolean (*_sym_OSMesaMakeCurrent) (OSMesaContext ctx, void *buffer, GLenum type, GLsizei width, GLsizei height) = NULL; | ||
118 | static void (*_sym_OSMesaPixelStore) (GLint pname, GLint value) = NULL; | ||
119 | static OSMESAproc (*_sym_OSMesaGetProcAddress) (const char *funcName); | ||
120 | |||
121 | |||
122 | //------------------------------------------------------// | ||
123 | // GLES 2.0 APIs... | ||
124 | static void (*_sym_glActiveTexture) (GLenum texture) = NULL; | ||
125 | static void (*_sym_glAttachShader) (GLuint program, GLuint shader) = NULL; | ||
126 | static void (*_sym_glBindAttribLocation) (GLuint program, GLuint index, const char* name) = NULL; | ||
127 | static void (*_sym_glBindBuffer) (GLenum target, GLuint buffer) = NULL; | ||
128 | static void (*_sym_glBindFramebuffer) (GLenum target, GLuint framebuffer) = NULL; | ||
129 | static void (*_sym_glBindRenderbuffer) (GLenum target, GLuint renderbuffer) = NULL; | ||
130 | static void (*_sym_glBindTexture) (GLenum target, GLuint texture) = NULL; | ||
131 | static void (*_sym_glBlendColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) = NULL; | ||
132 | static void (*_sym_glBlendEquation) (GLenum mode) = NULL; | ||
133 | static void (*_sym_glBlendEquationSeparate) (GLenum modeRGB, GLenum modeAlpha) = NULL; | ||
134 | static void (*_sym_glBlendFunc) (GLenum sfactor, GLenum dfactor) = NULL; | ||
135 | static void (*_sym_glBlendFuncSeparate) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) = NULL; | ||
136 | static void (*_sym_glBufferData) (GLenum target, GLsizeiptr size, const void* data, GLenum usage) = NULL; | ||
137 | static void (*_sym_glBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data) = NULL; | ||
138 | static GLenum (*_sym_glCheckFramebufferStatus) (GLenum target) = NULL; | ||
139 | static void (*_sym_glClear) (GLbitfield mask) = NULL; | ||
140 | static void (*_sym_glClearColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) = NULL; | ||
141 | static void (*_sym_glClearDepthf) (GLclampf depth) = NULL; | ||
142 | static void (*_sym_glClearStencil) (GLint s) = NULL; | ||
143 | static void (*_sym_glColorMask) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) = NULL; | ||
144 | static void (*_sym_glCompileShader) (GLuint shader) = NULL; | ||
145 | static void (*_sym_glCompressedTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) = NULL; | ||
146 | static void (*_sym_glCompressedTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) = NULL; | ||
147 | static void (*_sym_glCopyTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) = NULL; | ||
148 | static void (*_sym_glCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) = NULL; | ||
149 | static GLuint (*_sym_glCreateProgram) (void) = NULL; | ||
150 | static GLuint (*_sym_glCreateShader) (GLenum type) = NULL; | ||
151 | static void (*_sym_glCullFace) (GLenum mode) = NULL; | ||
152 | static void (*_sym_glDeleteBuffers) (GLsizei n, const GLuint* buffers) = NULL; | ||
153 | static void (*_sym_glDeleteFramebuffers) (GLsizei n, const GLuint* framebuffers) = NULL; | ||
154 | static void (*_sym_glDeleteProgram) (GLuint program) = NULL; | ||
155 | static void (*_sym_glDeleteRenderbuffers) (GLsizei n, const GLuint* renderbuffers) = NULL; | ||
156 | static void (*_sym_glDeleteShader) (GLuint shader) = NULL; | ||
157 | static void (*_sym_glDeleteTextures) (GLsizei n, const GLuint* textures) = NULL; | ||
158 | static void (*_sym_glDepthFunc) (GLenum func) = NULL; | ||
159 | static void (*_sym_glDepthMask) (GLboolean flag) = NULL; | ||
160 | static void (*_sym_glDepthRangef) (GLclampf zNear, GLclampf zFar) = NULL; | ||
161 | static void (*_sym_glDetachShader) (GLuint program, GLuint shader) = NULL; | ||
162 | static void (*_sym_glDisable) (GLenum cap) = NULL; | ||
163 | static void (*_sym_glDisableVertexAttribArray) (GLuint index) = NULL; | ||
164 | static void (*_sym_glDrawArrays) (GLenum mode, GLint first, GLsizei count) = NULL; | ||
165 | static void (*_sym_glDrawElements) (GLenum mode, GLsizei count, GLenum type, const void* indices) = NULL; | ||
166 | static void (*_sym_glEnable) (GLenum cap) = NULL; | ||
167 | static void (*_sym_glEnableVertexAttribArray) (GLuint index) = NULL; | ||
168 | static void (*_sym_glFinish) (void) = NULL; | ||
169 | static void (*_sym_glFlush) (void) = NULL; | ||
170 | static void (*_sym_glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) = NULL; | ||
171 | static void (*_sym_glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) = NULL; | ||
172 | static void (*_sym_glFrontFace) (GLenum mode) = NULL; | ||
173 | static void (*_sym_glGenBuffers) (GLsizei n, GLuint* buffers) = NULL; | ||
174 | static void (*_sym_glGenerateMipmap) (GLenum target) = NULL; | ||
175 | static void (*_sym_glGenFramebuffers) (GLsizei n, GLuint* framebuffers) = NULL; | ||
176 | static void (*_sym_glGenRenderbuffers) (GLsizei n, GLuint* renderbuffers) = NULL; | ||
177 | static void (*_sym_glGenTextures) (GLsizei n, GLuint* textures) = NULL; | ||
178 | static void (*_sym_glGetActiveAttrib) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) = NULL; | ||
179 | static void (*_sym_glGetActiveUniform) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) = NULL; | ||
180 | static void (*_sym_glGetAttachedShaders) (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) = NULL; | ||
181 | static int (*_sym_glGetAttribLocation) (GLuint program, const char* name) = NULL; | ||
182 | static void (*_sym_glGetBooleanv) (GLenum pname, GLboolean* params) = NULL; | ||
183 | static void (*_sym_glGetBufferParameteriv) (GLenum target, GLenum pname, GLint* params) = NULL; | ||
184 | static GLenum (*_sym_glGetError) (void) = NULL; | ||
185 | static void (*_sym_glGetFloatv) (GLenum pname, GLfloat* params) = NULL; | ||
186 | static void (*_sym_glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname, GLint* params) = NULL; | ||
187 | static void (*_sym_glGetIntegerv) (GLenum pname, GLint* params) = NULL; | ||
188 | static void (*_sym_glGetProgramiv) (GLuint program, GLenum pname, GLint* params) = NULL; | ||
189 | static void (*_sym_glGetProgramInfoLog) (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) = NULL; | ||
190 | static void (*_sym_glGetRenderbufferParameteriv) (GLenum target, GLenum pname, GLint* params) = NULL; | ||
191 | static void (*_sym_glGetShaderiv) (GLuint shader, GLenum pname, GLint* params) = NULL; | ||
192 | static void (*_sym_glGetShaderInfoLog) (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) = NULL; | ||
193 | static void (*_sym_glGetShaderPrecisionFormat) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) = NULL; | ||
194 | static void (*_sym_glGetShaderSource) (GLuint shader, GLsizei bufsize, GLsizei* length, char* source) = NULL; | ||
195 | static const GLubyte *(*_sym_glGetString) (GLenum name) = NULL; | ||
196 | static void (*_sym_glGetTexParameterfv) (GLenum target, GLenum pname, GLfloat* params) = NULL; | ||
197 | static void (*_sym_glGetTexParameteriv) (GLenum target, GLenum pname, GLint* params) = NULL; | ||
198 | static void (*_sym_glGetUniformfv) (GLuint program, GLint location, GLfloat* params) = NULL; | ||
199 | static void (*_sym_glGetUniformiv) (GLuint program, GLint location, GLint* params) = NULL; | ||
200 | static int (*_sym_glGetUniformLocation) (GLuint program, const char* name) = NULL; | ||
201 | static void (*_sym_glGetVertexAttribfv) (GLuint index, GLenum pname, GLfloat* params) = NULL; | ||
202 | static void (*_sym_glGetVertexAttribiv) (GLuint index, GLenum pname, GLint* params) = NULL; | ||
203 | static void (*_sym_glGetVertexAttribPointerv) (GLuint index, GLenum pname, void** pointer) = NULL; | ||
204 | static void (*_sym_glHint) (GLenum target, GLenum mode) = NULL; | ||
205 | static GLboolean (*_sym_glIsBuffer) (GLuint buffer) = NULL; | ||
206 | static GLboolean (*_sym_glIsEnabled) (GLenum cap) = NULL; | ||
207 | static GLboolean (*_sym_glIsFramebuffer) (GLuint framebuffer) = NULL; | ||
208 | static GLboolean (*_sym_glIsProgram) (GLuint program) = NULL; | ||
209 | static GLboolean (*_sym_glIsRenderbuffer) (GLuint renderbuffer) = NULL; | ||
210 | static GLboolean (*_sym_glIsShader) (GLuint shader) = NULL; | ||
211 | static GLboolean (*_sym_glIsTexture) (GLuint texture) = NULL; | ||
212 | static void (*_sym_glLineWidth) (GLfloat width) = NULL; | ||
213 | static void (*_sym_glLinkProgram) (GLuint program) = NULL; | ||
214 | static void (*_sym_glPixelStorei) (GLenum pname, GLint param) = NULL; | ||
215 | static void (*_sym_glPolygonOffset) (GLfloat factor, GLfloat units) = NULL; | ||
216 | static void (*_sym_glReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) = NULL; | ||
217 | static void (*_sym_glReleaseShaderCompiler) (void) = NULL; | ||
218 | static void (*_sym_glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) = NULL; | ||
219 | static void (*_sym_glSampleCoverage) (GLclampf value, GLboolean invert) = NULL; | ||
220 | static void (*_sym_glScissor) (GLint x, GLint y, GLsizei width, GLsizei height) = NULL; | ||
221 | static void (*_sym_glShaderBinary) (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) = NULL; | ||
222 | static void (*_sym_glShaderSource) (GLuint shader, GLsizei count, const char** string, const GLint* length) = NULL; | ||
223 | static void (*_sym_glStencilFunc) (GLenum func, GLint ref, GLuint mask) = NULL; | ||
224 | static void (*_sym_glStencilFuncSeparate) (GLenum face, GLenum func, GLint ref, GLuint mask) = NULL; | ||
225 | static void (*_sym_glStencilMask) (GLuint mask) = NULL; | ||
226 | static void (*_sym_glStencilMaskSeparate) (GLenum face, GLuint mask) = NULL; | ||
227 | static void (*_sym_glStencilOp) (GLenum fail, GLenum zfail, GLenum zpass) = NULL; | ||
228 | static void (*_sym_glStencilOpSeparate) (GLenum face, GLenum fail, GLenum zfail, GLenum zpass) = NULL; | ||
229 | static void (*_sym_glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) = NULL; | ||
230 | static void (*_sym_glTexParameterf) (GLenum target, GLenum pname, GLfloat param) = NULL; | ||
231 | static void (*_sym_glTexParameterfv) (GLenum target, GLenum pname, const GLfloat* params) = NULL; | ||
232 | static void (*_sym_glTexParameteri) (GLenum target, GLenum pname, GLint param) = NULL; | ||
233 | static void (*_sym_glTexParameteriv) (GLenum target, GLenum pname, const GLint* params) = NULL; | ||
234 | static void (*_sym_glTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) = NULL; | ||
235 | static void (*_sym_glUniform1f) (GLint location, GLfloat x) = NULL; | ||
236 | static void (*_sym_glUniform1fv) (GLint location, GLsizei count, const GLfloat* v) = NULL; | ||
237 | static void (*_sym_glUniform1i) (GLint location, GLint x) = NULL; | ||
238 | static void (*_sym_glUniform1iv) (GLint location, GLsizei count, const GLint* v) = NULL; | ||
239 | static void (*_sym_glUniform2f) (GLint location, GLfloat x, GLfloat y) = NULL; | ||
240 | static void (*_sym_glUniform2fv) (GLint location, GLsizei count, const GLfloat* v) = NULL; | ||
241 | static void (*_sym_glUniform2i) (GLint location, GLint x, GLint y) = NULL; | ||
242 | static void (*_sym_glUniform2iv) (GLint location, GLsizei count, const GLint* v) = NULL; | ||
243 | static void (*_sym_glUniform3f) (GLint location, GLfloat x, GLfloat y, GLfloat z) = NULL; | ||
244 | static void (*_sym_glUniform3fv) (GLint location, GLsizei count, const GLfloat* v) = NULL; | ||
245 | static void (*_sym_glUniform3i) (GLint location, GLint x, GLint y, GLint z) = NULL; | ||
246 | static void (*_sym_glUniform3iv) (GLint location, GLsizei count, const GLint* v) = NULL; | ||
247 | static void (*_sym_glUniform4f) (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) = NULL; | ||
248 | static void (*_sym_glUniform4fv) (GLint location, GLsizei count, const GLfloat* v) = NULL; | ||
249 | static void (*_sym_glUniform4i) (GLint location, GLint x, GLint y, GLint z, GLint w) = NULL; | ||
250 | static void (*_sym_glUniform4iv) (GLint location, GLsizei count, const GLint* v) = NULL; | ||
251 | static void (*_sym_glUniformMatrix2fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL; | ||
252 | static void (*_sym_glUniformMatrix3fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL; | ||
253 | static void (*_sym_glUniformMatrix4fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) = NULL; | ||
254 | static void (*_sym_glUseProgram) (GLuint program) = NULL; | ||
255 | static void (*_sym_glValidateProgram) (GLuint program) = NULL; | ||
256 | static void (*_sym_glVertexAttrib1f) (GLuint indx, GLfloat x) = NULL; | ||
257 | static void (*_sym_glVertexAttrib1fv) (GLuint indx, const GLfloat* values) = NULL; | ||
258 | static void (*_sym_glVertexAttrib2f) (GLuint indx, GLfloat x, GLfloat y) = NULL; | ||
259 | static void (*_sym_glVertexAttrib2fv) (GLuint indx, const GLfloat* values) = NULL; | ||
260 | static void (*_sym_glVertexAttrib3f) (GLuint indx, GLfloat x, GLfloat y, GLfloat z) = NULL; | ||
261 | static void (*_sym_glVertexAttrib3fv) (GLuint indx, const GLfloat* values) = NULL; | ||
262 | static void (*_sym_glVertexAttrib4f) (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) = NULL; | ||
263 | static void (*_sym_glVertexAttrib4fv) (GLuint indx, const GLfloat* values) = NULL; | ||
264 | static void (*_sym_glVertexAttribPointer) (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) = NULL; | ||
265 | static void (*_sym_glViewport) (GLint x, GLint y, GLsizei width, GLsizei height) = NULL; | ||
266 | |||
267 | // GLES Extensions... | ||
268 | /* static void (*_sym_glGetProgramBinary) (GLuint a, GLsizei b, GLsizei* c, GLenum* d, void* e) = NULL; */ | ||
269 | /* static void (*_sym_glProgramBinary) (GLuint a, GLenum b, const void* c, GLint d) = NULL; */ | ||
270 | /* static void (*_sym_glProgramParameteri) (GLuint a, GLuint b, GLint d) = NULL; */ | ||
271 | #endif | ||
272 | |||
4 | /* | 273 | /* |
5 | ***** | 274 | ***** |
6 | ** | 275 | ** |
@@ -258,6 +527,15 @@ eng_image_colorspace_get(void *data __UNUSED__, void *image) | |||
258 | return im->space; | 527 | return im->space; |
259 | } | 528 | } |
260 | 529 | ||
530 | static Eina_Bool | ||
531 | eng_image_can_region_get(void *data __UNUSED__, void *image) | ||
532 | { | ||
533 | Image_Entry *im; | ||
534 | if (!image) return EINA_FALSE; | ||
535 | im = image; | ||
536 | return ((Evas_Image_Load_Func*) im->info.loader)->do_region; | ||
537 | } | ||
538 | |||
261 | static void | 539 | static void |
262 | eng_image_mask_create(void *data __UNUSED__, void *image) | 540 | eng_image_mask_create(void *data __UNUSED__, void *image) |
263 | { | 541 | { |
@@ -349,7 +627,37 @@ eng_image_colorspace_set(void *data __UNUSED__, void *image, int cspace) | |||
349 | static void * | 627 | static void * |
350 | eng_image_native_set(void *data __UNUSED__, void *image, void *native __UNUSED__) | 628 | eng_image_native_set(void *data __UNUSED__, void *image, void *native __UNUSED__) |
351 | { | 629 | { |
352 | return image; | 630 | //return image; |
631 | Evas_Native_Surface *ns = native; | ||
632 | Image_Entry *im = image, *im2 = NULL; | ||
633 | |||
634 | if (!im) | ||
635 | { | ||
636 | if ((!ns) && (ns->data.x11.visual)) | ||
637 | { | ||
638 | im = evas_cache_image_data(evas_common_image_cache_get(), | ||
639 | im->w, im->h, | ||
640 | ns->data.x11.visual, 1, | ||
641 | EVAS_COLORSPACE_ARGB8888); | ||
642 | return im; | ||
643 | } | ||
644 | else | ||
645 | return NULL; | ||
646 | } | ||
647 | |||
648 | if ((!ns) && (!im)) return im; | ||
649 | |||
650 | if (!ns) return im; | ||
651 | |||
652 | im2 = evas_cache_image_data(evas_common_image_cache_get(), | ||
653 | im->w, im->h, | ||
654 | ns->data.x11.visual, 1, | ||
655 | EVAS_COLORSPACE_ARGB8888); | ||
656 | evas_cache_image_drop(im); | ||
657 | im = im2; | ||
658 | |||
659 | return im; | ||
660 | |||
353 | } | 661 | } |
354 | 662 | ||
355 | static void * | 663 | static void * |
@@ -1035,6 +1343,311 @@ eng_image_load_error_get(void *data __UNUSED__, void *image) | |||
1035 | return im->cache_entry.load_error; | 1343 | return im->cache_entry.load_error; |
1036 | } | 1344 | } |
1037 | 1345 | ||
1346 | //------------ Evas GL engine code ---------------// | ||
1347 | static void * | ||
1348 | eng_gl_surface_create(void *data __UNUSED__, void *config, int w, int h) | ||
1349 | { | ||
1350 | #ifdef EVAS_GL | ||
1351 | Render_Engine_GL_Surface *sfc; | ||
1352 | Evas_GL_Config *cfg; | ||
1353 | |||
1354 | sfc = calloc(1, sizeof(Render_Engine_GL_Surface)); | ||
1355 | if (!sfc) return NULL; | ||
1356 | |||
1357 | cfg = (Evas_GL_Config *)config; | ||
1358 | |||
1359 | sfc->initialized = 0; | ||
1360 | sfc->w = w; | ||
1361 | sfc->h = h; | ||
1362 | |||
1363 | // Color Format | ||
1364 | switch (cfg->color_format) | ||
1365 | { | ||
1366 | |||
1367 | case EVAS_GL_RGB_888: | ||
1368 | sfc->internal_fmt = OSMESA_RGB; | ||
1369 | sfc->internal_cpp = 3; | ||
1370 | break; | ||
1371 | case EVAS_GL_RGBA_8888: | ||
1372 | sfc->internal_fmt = OSMESA_BGRA; | ||
1373 | sfc->internal_cpp = 4; | ||
1374 | break; | ||
1375 | default: | ||
1376 | sfc->internal_fmt = OSMESA_RGBA; | ||
1377 | sfc->internal_cpp = 4; | ||
1378 | break; | ||
1379 | } | ||
1380 | |||
1381 | // Depth Bits | ||
1382 | switch (cfg->depth_bits) | ||
1383 | { | ||
1384 | case EVAS_GL_DEPTH_BIT_8: | ||
1385 | sfc->depth_bits = 8; | ||
1386 | break; | ||
1387 | case EVAS_GL_DEPTH_BIT_16: | ||
1388 | sfc->depth_bits = 16; | ||
1389 | break; | ||
1390 | case EVAS_GL_DEPTH_BIT_24: | ||
1391 | sfc->depth_bits = 24; | ||
1392 | break; | ||
1393 | case EVAS_GL_DEPTH_BIT_32: | ||
1394 | sfc->depth_bits = 32; | ||
1395 | break; | ||
1396 | case EVAS_GL_DEPTH_NONE: | ||
1397 | default: | ||
1398 | sfc->depth_bits = 0; | ||
1399 | break; | ||
1400 | } | ||
1401 | |||
1402 | // Stencil Bits | ||
1403 | switch (cfg->stencil_bits) | ||
1404 | { | ||
1405 | case EVAS_GL_STENCIL_BIT_1: | ||
1406 | sfc->stencil_bits = 1; | ||
1407 | break; | ||
1408 | case EVAS_GL_STENCIL_BIT_2: | ||
1409 | sfc->stencil_bits = 2; | ||
1410 | break; | ||
1411 | case EVAS_GL_STENCIL_BIT_4: | ||
1412 | sfc->stencil_bits = 4; | ||
1413 | break; | ||
1414 | case EVAS_GL_STENCIL_BIT_8: | ||
1415 | sfc->stencil_bits = 8; | ||
1416 | break; | ||
1417 | case EVAS_GL_STENCIL_BIT_16: | ||
1418 | sfc->stencil_bits = 16; | ||
1419 | break; | ||
1420 | case EVAS_GL_STENCIL_NONE: | ||
1421 | default: | ||
1422 | sfc->stencil_bits = 0; | ||
1423 | break; | ||
1424 | } | ||
1425 | |||
1426 | sfc->buffer = malloc(sizeof(unsigned char)*sfc->internal_cpp*w*h); | ||
1427 | |||
1428 | if (!sfc->buffer) | ||
1429 | { | ||
1430 | free(sfc); | ||
1431 | return NULL; | ||
1432 | } | ||
1433 | |||
1434 | return sfc; | ||
1435 | #else | ||
1436 | (void) config; | ||
1437 | (void) w; | ||
1438 | (void) h; | ||
1439 | return NULL; | ||
1440 | #endif | ||
1441 | } | ||
1442 | |||
1443 | static int | ||
1444 | eng_gl_surface_destroy(void *data __UNUSED__, void *surface) | ||
1445 | { | ||
1446 | #ifdef EVAS_GL | ||
1447 | Render_Engine_GL_Surface *sfc; | ||
1448 | |||
1449 | sfc = (Render_Engine_GL_Surface*)surface; | ||
1450 | |||
1451 | if (!sfc) return 0; | ||
1452 | |||
1453 | if (sfc->buffer) free(sfc->buffer); | ||
1454 | |||
1455 | free(sfc); | ||
1456 | |||
1457 | surface = NULL; | ||
1458 | |||
1459 | return 1; | ||
1460 | #else | ||
1461 | (void) surface; | ||
1462 | return 1; | ||
1463 | #endif | ||
1464 | } | ||
1465 | |||
1466 | static void * | ||
1467 | eng_gl_context_create(void *data __UNUSED__, void *share_context) | ||
1468 | { | ||
1469 | #ifdef EVAS_GL | ||
1470 | Render_Engine_GL_Context *ctx; | ||
1471 | Render_Engine_GL_Context *share_ctx; | ||
1472 | |||
1473 | ctx = calloc(1, sizeof(Render_Engine_GL_Context)); | ||
1474 | |||
1475 | if (!ctx) return NULL; | ||
1476 | |||
1477 | share_ctx = (Render_Engine_GL_Context *)share_context; | ||
1478 | |||
1479 | ctx->share_ctx = share_ctx; | ||
1480 | |||
1481 | /* | ||
1482 | if (share_ctx) | ||
1483 | ctx->context = OSMesaCreateContextExt( OSMESA_RGBA, 8, 0, 0, share_ctx->context ); | ||
1484 | else | ||
1485 | ctx->context = OSMesaCreateContextExt( OSMESA_RGBA, 8, 0, 0, NULL ); | ||
1486 | |||
1487 | |||
1488 | if (!ctx->context) | ||
1489 | { | ||
1490 | ERR("Error creating OSMesa Context."); | ||
1491 | free(ctx); | ||
1492 | return NULL; | ||
1493 | } | ||
1494 | */ | ||
1495 | |||
1496 | ctx->initialized = 0; | ||
1497 | |||
1498 | return ctx; | ||
1499 | #else | ||
1500 | (void) share_context; | ||
1501 | return NULL; | ||
1502 | #endif | ||
1503 | } | ||
1504 | |||
1505 | static int | ||
1506 | eng_gl_context_destroy(void *data __UNUSED__, void *context) | ||
1507 | { | ||
1508 | #ifdef EVAS_GL | ||
1509 | Render_Engine_GL_Context *ctx; | ||
1510 | |||
1511 | ctx = (Render_Engine_GL_Context*)context; | ||
1512 | |||
1513 | if (!ctx) return 0; | ||
1514 | |||
1515 | _sym_OSMesaDestroyContext(ctx->context); | ||
1516 | |||
1517 | free(ctx); | ||
1518 | context = NULL; | ||
1519 | |||
1520 | return 1; | ||
1521 | #else | ||
1522 | (void) context; | ||
1523 | return 0; | ||
1524 | #endif | ||
1525 | } | ||
1526 | |||
1527 | static int | ||
1528 | eng_gl_make_current(void *data __UNUSED__, void *surface, void *context) | ||
1529 | { | ||
1530 | #ifdef EVAS_GL | ||
1531 | Render_Engine_GL_Surface *sfc; | ||
1532 | Render_Engine_GL_Context *ctx; | ||
1533 | OSMesaContext share_ctx; | ||
1534 | GLboolean ret; | ||
1535 | |||
1536 | sfc = (Render_Engine_GL_Surface*)surface; | ||
1537 | ctx = (Render_Engine_GL_Context*)context; | ||
1538 | |||
1539 | // Unset surface/context | ||
1540 | if ((!sfc) || (!ctx)) | ||
1541 | { | ||
1542 | if (ctx) ctx->current_sfc = NULL; | ||
1543 | if (sfc) sfc->current_ctx = NULL; | ||
1544 | return 1; | ||
1545 | } | ||
1546 | |||
1547 | // Initialize Context if it hasn't been. | ||
1548 | if (!ctx->initialized) | ||
1549 | { | ||
1550 | if (ctx->share_ctx) | ||
1551 | share_ctx = ctx->share_ctx->context; | ||
1552 | else | ||
1553 | share_ctx = NULL; | ||
1554 | |||
1555 | ctx->context = _sym_OSMesaCreateContextExt(sfc->internal_fmt, | ||
1556 | sfc->depth_bits, | ||
1557 | sfc->stencil_bits, | ||
1558 | 0, | ||
1559 | share_ctx); | ||
1560 | if (!ctx->context) | ||
1561 | { | ||
1562 | ERR("Error initializing context."); | ||
1563 | return 0; | ||
1564 | } | ||
1565 | |||
1566 | ctx->initialized = 1; | ||
1567 | } | ||
1568 | |||
1569 | |||
1570 | // Call MakeCurrent | ||
1571 | ret = _sym_OSMesaMakeCurrent(ctx->context, sfc->buffer, GL_UNSIGNED_BYTE, | ||
1572 | sfc->w, sfc->h); | ||
1573 | |||
1574 | if (ret == GL_FALSE) | ||
1575 | { | ||
1576 | ERR("Error doing MakeCurrent."); | ||
1577 | return 0; | ||
1578 | } | ||
1579 | |||
1580 | _sym_OSMesaPixelStore(OSMESA_Y_UP, 0); | ||
1581 | |||
1582 | // Set the current surface/context | ||
1583 | ctx->current_sfc = sfc; | ||
1584 | sfc->current_ctx = ctx; | ||
1585 | |||
1586 | return 1; | ||
1587 | #else | ||
1588 | (void) surface; | ||
1589 | (void) context; | ||
1590 | return 1; | ||
1591 | #endif | ||
1592 | } | ||
1593 | |||
1594 | // FIXME!!! Implement later | ||
1595 | static void * | ||
1596 | eng_gl_string_query(void *data __UNUSED__, int name __UNUSED__) | ||
1597 | { | ||
1598 | return NULL; | ||
1599 | } | ||
1600 | |||
1601 | static void * | ||
1602 | eng_gl_proc_address_get(void *data __UNUSED__, const char *name) | ||
1603 | { | ||
1604 | #ifdef EVAS_GL | ||
1605 | if (_sym_OSMesaGetProcAddress) return _sym_OSMesaGetProcAddress(name); | ||
1606 | return dlsym(RTLD_DEFAULT, name); | ||
1607 | #else | ||
1608 | (void) name; | ||
1609 | return NULL; | ||
1610 | #endif | ||
1611 | } | ||
1612 | |||
1613 | static int | ||
1614 | eng_gl_native_surface_get(void *data __UNUSED__, void *surface, void *native_surface) | ||
1615 | { | ||
1616 | #ifdef EVAS_GL | ||
1617 | Render_Engine_GL_Surface *sfc; | ||
1618 | Evas_Native_Surface *ns; | ||
1619 | |||
1620 | sfc = (Render_Engine_GL_Surface*)surface; | ||
1621 | ns = (Evas_Native_Surface*)native_surface; | ||
1622 | |||
1623 | if (!sfc) return 0; | ||
1624 | |||
1625 | ns->type = EVAS_NATIVE_SURFACE_OPENGL; | ||
1626 | ns->version = EVAS_NATIVE_SURFACE_VERSION; | ||
1627 | ns->data.x11.visual = sfc->buffer; | ||
1628 | |||
1629 | return 1; | ||
1630 | #else | ||
1631 | (void) surface; | ||
1632 | (void) native_surface; | ||
1633 | return 1; | ||
1634 | #endif | ||
1635 | } | ||
1636 | |||
1637 | |||
1638 | static void * | ||
1639 | eng_gl_api_get(void *data __UNUSED__) | ||
1640 | { | ||
1641 | #ifdef EVAS_GL | ||
1642 | return &gl_funcs; | ||
1643 | #else | ||
1644 | return NULL; | ||
1645 | #endif | ||
1646 | } | ||
1647 | |||
1648 | //------------------------------------------------// | ||
1649 | |||
1650 | |||
1038 | /* | 1651 | /* |
1039 | ***** | 1652 | ***** |
1040 | ** | 1653 | ** |
@@ -1112,6 +1725,7 @@ static Evas_Func func = | |||
1112 | eng_image_format_get, | 1725 | eng_image_format_get, |
1113 | eng_image_colorspace_set, | 1726 | eng_image_colorspace_set, |
1114 | eng_image_colorspace_get, | 1727 | eng_image_colorspace_get, |
1728 | eng_image_can_region_get, | ||
1115 | eng_image_mask_create, | 1729 | eng_image_mask_create, |
1116 | eng_image_native_set, | 1730 | eng_image_native_set, |
1117 | eng_image_native_get, | 1731 | eng_image_native_get, |
@@ -1161,15 +1775,15 @@ static Evas_Func func = | |||
1161 | eng_image_filtered_save, | 1775 | eng_image_filtered_save, |
1162 | eng_image_filtered_free, | 1776 | eng_image_filtered_free, |
1163 | #endif | 1777 | #endif |
1164 | NULL, // FIXME: need software mesa for gl rendering <- gl_surface_create | 1778 | NULL, // need software mesa for gl rendering <- gl_surface_create |
1165 | NULL, // FIXME: need software mesa for gl rendering <- gl_surface_destroy | 1779 | NULL, // need software mesa for gl rendering <- gl_surface_destroy |
1166 | NULL, // FIXME: need software mesa for gl rendering <- gl_context_create | 1780 | NULL, // need software mesa for gl rendering <- gl_context_create |
1167 | NULL, // FIXME: need software mesa for gl rendering <- gl_context_destroy | 1781 | NULL, // need software mesa for gl rendering <- gl_context_destroy |
1168 | NULL, // FIXME: need software mesa for gl rendering <- gl_make_current | 1782 | NULL, // need software mesa for gl rendering <- gl_make_current |
1169 | NULL, // FIXME: need software mesa for gl rendering <- gl_string_query | 1783 | NULL, // need software mesa for gl rendering <- gl_string_query |
1170 | NULL, // FIXME: need software mesa for gl rendering <- gl_proc_address_get | 1784 | NULL, // need software mesa for gl rendering <- gl_proc_address_get |
1171 | NULL, // FIXME: need software mesa for gl rendering <- gl_native_surface_get | 1785 | NULL, // need software mesa for gl rendering <- gl_native_surface_get |
1172 | NULL, // FIXME: need software mesa for gl rendering <- gl_api_get | 1786 | NULL, // need software mesa for gl rendering <- gl_api_get |
1173 | eng_image_load_error_get, | 1787 | eng_image_load_error_get, |
1174 | eng_font_run_font_end_get, | 1788 | eng_font_run_font_end_get, |
1175 | eng_image_animated_get, | 1789 | eng_image_animated_get, |
@@ -1182,6 +1796,981 @@ static Evas_Func func = | |||
1182 | /* FUTURE software generic calls go here */ | 1796 | /* FUTURE software generic calls go here */ |
1183 | }; | 1797 | }; |
1184 | 1798 | ||
1799 | |||
1800 | //----------------------------------------------------------------// | ||
1801 | // // | ||
1802 | // Load Symbols // | ||
1803 | // // | ||
1804 | //----------------------------------------------------------------// | ||
1805 | #ifdef EVAS_GL | ||
1806 | static void | ||
1807 | sym_missing(void) | ||
1808 | { | ||
1809 | ERR("GL symbols missing!\n"); | ||
1810 | } | ||
1811 | |||
1812 | static int | ||
1813 | glue_sym_init(void) | ||
1814 | { | ||
1815 | //------------------------------------------------// | ||
1816 | // Use eglGetProcAddress | ||
1817 | #define FINDSYM(dst, sym, typ) \ | ||
1818 | if (!dst) dst = (typeof(dst))dlsym(gl_lib_handle, sym); \ | ||
1819 | if (!dst) \ | ||
1820 | { \ | ||
1821 | ERR("Symbol not found %s\n", sym); \ | ||
1822 | return 0; \ | ||
1823 | } | ||
1824 | #define FALLBAK(dst, typ) if (!dst) dst = (typeof(dst))sym_missing; | ||
1825 | |||
1826 | //------------------------------------------------------// | ||
1827 | // OSMesa APIs... | ||
1828 | FINDSYM(_sym_OSMesaCreateContextExt, "OSMesaCreateContextExt", glsym_func_osm_ctx); | ||
1829 | FALLBAK(_sym_OSMesaCreateContextExt, glsym_func_void); | ||
1830 | |||
1831 | FINDSYM(_sym_OSMesaDestroyContext, "OSMesaDestroyContext", glsym_func_void); | ||
1832 | FALLBAK(_sym_OSMesaDestroyContext, glsym_func_void); | ||
1833 | |||
1834 | FINDSYM(_sym_OSMesaMakeCurrent, "OSMesaMakeCurrent", glsym_func_bool); | ||
1835 | FALLBAK(_sym_OSMesaMakeCurrent, glsym_func_void); | ||
1836 | |||
1837 | FINDSYM(_sym_OSMesaPixelStore, "OSMesaPixelStore", glsym_func_void); | ||
1838 | FALLBAK(_sym_OSMesaPixelStore, glsym_func_void); | ||
1839 | |||
1840 | FINDSYM(_sym_OSMesaGetProcAddress, "OSMesaGetProcAddress", glsym_func_eng_fn); | ||
1841 | FALLBAK(_sym_OSMesaGetProcAddress, glsym_func_void); | ||
1842 | |||
1843 | #undef FINDSYM | ||
1844 | #undef FALLBAK | ||
1845 | |||
1846 | return 1; | ||
1847 | } | ||
1848 | |||
1849 | static int | ||
1850 | gl_sym_init(void) | ||
1851 | { | ||
1852 | //------------------------------------------------// | ||
1853 | #define FINDSYM(dst, sym, typ) \ | ||
1854 | if (!dst) dst = (typeof(dst))dlsym(gl_lib_handle, sym); \ | ||
1855 | if (!dst) DBG("Symbol not found %s\n", sym); | ||
1856 | #define FALLBAK(dst, typ) if (!dst) dst = (typeof(dst))sym_missing; | ||
1857 | |||
1858 | |||
1859 | //------------------------------------------------------// | ||
1860 | // GLES 2.0 APIs... | ||
1861 | FINDSYM(_sym_glActiveTexture, "glActiveTexture", glsym_func_void); | ||
1862 | FALLBAK(_sym_glActiveTexture, glsym_func_void); | ||
1863 | |||
1864 | FINDSYM(_sym_glAttachShader, "glAttachShader", glsym_func_void); | ||
1865 | FALLBAK(_sym_glAttachShader, glsym_func_void); | ||
1866 | |||
1867 | FINDSYM(_sym_glBindAttribLocation, "glBindAttribLocation", glsym_func_void); | ||
1868 | FALLBAK(_sym_glBindAttribLocation, glsym_func_void); | ||
1869 | |||
1870 | FINDSYM(_sym_glBindBuffer, "glBindBuffer", glsym_func_void); | ||
1871 | FALLBAK(_sym_glBindBuffer, glsym_func_void); | ||
1872 | |||
1873 | FINDSYM(_sym_glBindFramebuffer, "glBindFramebuffer", glsym_func_void); | ||
1874 | FALLBAK(_sym_glBindFramebuffer, glsym_func_void); | ||
1875 | |||
1876 | FINDSYM(_sym_glBindRenderbuffer, "glBindRenderbuffer", glsym_func_void); | ||
1877 | FALLBAK(_sym_glBindRenderbuffer, glsym_func_void); | ||
1878 | |||
1879 | FINDSYM(_sym_glBindTexture, "glBindTexture", glsym_func_void); | ||
1880 | FALLBAK(_sym_glBindTexture, glsym_func_void); | ||
1881 | |||
1882 | FINDSYM(_sym_glBlendColor, "glBlendColor", glsym_func_void); | ||
1883 | FALLBAK(_sym_glBlendColor, glsym_func_void); | ||
1884 | |||
1885 | FINDSYM(_sym_glBlendEquation, "glBlendEquation", glsym_func_void); | ||
1886 | FALLBAK(_sym_glBlendEquation, glsym_func_void); | ||
1887 | |||
1888 | FINDSYM(_sym_glBlendEquationSeparate, "glBlendEquationSeparate", glsym_func_void); | ||
1889 | FALLBAK(_sym_glBlendEquationSeparate, glsym_func_void); | ||
1890 | |||
1891 | FINDSYM(_sym_glBlendFunc, "glBlendFunc", glsym_func_void); | ||
1892 | FALLBAK(_sym_glBlendFunc, glsym_func_void); | ||
1893 | |||
1894 | FINDSYM(_sym_glBlendFuncSeparate, "glBlendFuncSeparate", glsym_func_void); | ||
1895 | FALLBAK(_sym_glBlendFuncSeparate, glsym_func_void); | ||
1896 | |||
1897 | FINDSYM(_sym_glBufferData, "glBufferData", glsym_func_void); | ||
1898 | FALLBAK(_sym_glBufferData, glsym_func_void); | ||
1899 | |||
1900 | FINDSYM(_sym_glBufferSubData, "glBufferSubData", glsym_func_void); | ||
1901 | FALLBAK(_sym_glBufferSubData, glsym_func_void); | ||
1902 | |||
1903 | FINDSYM(_sym_glCheckFramebufferStatus, "glCheckFramebufferStatus", glsym_func_uint); | ||
1904 | FALLBAK(_sym_glCheckFramebufferStatus, glsym_func_uint); | ||
1905 | |||
1906 | FINDSYM(_sym_glClear, "glClear", glsym_func_void); | ||
1907 | FALLBAK(_sym_glClear, glsym_func_void); | ||
1908 | |||
1909 | FINDSYM(_sym_glClearColor, "glClearColor", glsym_func_void); | ||
1910 | FALLBAK(_sym_glClearColor, glsym_func_void); | ||
1911 | |||
1912 | FINDSYM(_sym_glClearDepthf, "glClearDepthf", glsym_func_void); | ||
1913 | FINDSYM(_sym_glClearDepthf, "glClearDepth", glsym_func_void); | ||
1914 | FALLBAK(_sym_glClearDepthf, glsym_func_void); | ||
1915 | |||
1916 | FINDSYM(_sym_glClearStencil, "glClearStencil", glsym_func_void); | ||
1917 | FALLBAK(_sym_glClearStencil, glsym_func_void); | ||
1918 | |||
1919 | FINDSYM(_sym_glColorMask, "glColorMask", glsym_func_void); | ||
1920 | FALLBAK(_sym_glColorMask, glsym_func_void); | ||
1921 | |||
1922 | FINDSYM(_sym_glCompileShader, "glCompileShader", glsym_func_void); | ||
1923 | FALLBAK(_sym_glCompileShader, glsym_func_void); | ||
1924 | |||
1925 | FINDSYM(_sym_glCompressedTexImage2D, "glCompressedTexImage2D", glsym_func_void); | ||
1926 | FALLBAK(_sym_glCompressedTexImage2D, glsym_func_void); | ||
1927 | |||
1928 | FINDSYM(_sym_glCompressedTexSubImage2D, "glCompressedTexSubImage2D", glsym_func_void); | ||
1929 | FALLBAK(_sym_glCompressedTexSubImage2D, glsym_func_void); | ||
1930 | |||
1931 | FINDSYM(_sym_glCopyTexImage2D, "glCopyTexImage2D", glsym_func_void); | ||
1932 | FALLBAK(_sym_glCopyTexImage2D, glsym_func_void); | ||
1933 | |||
1934 | FINDSYM(_sym_glCopyTexSubImage2D, "glCopyTexSubImage2D", glsym_func_void); | ||
1935 | FALLBAK(_sym_glCopyTexSubImage2D, glsym_func_void); | ||
1936 | |||
1937 | FINDSYM(_sym_glCreateProgram, "glCreateProgram", glsym_func_uint); | ||
1938 | FALLBAK(_sym_glCreateProgram, glsym_func_uint); | ||
1939 | |||
1940 | FINDSYM(_sym_glCreateShader, "glCreateShader", glsym_func_uint); | ||
1941 | FALLBAK(_sym_glCreateShader, glsym_func_uint); | ||
1942 | |||
1943 | FINDSYM(_sym_glCullFace, "glCullFace", glsym_func_void); | ||
1944 | FALLBAK(_sym_glCullFace, glsym_func_void); | ||
1945 | |||
1946 | FINDSYM(_sym_glDeleteBuffers, "glDeleteBuffers", glsym_func_void); | ||
1947 | FALLBAK(_sym_glDeleteBuffers, glsym_func_void); | ||
1948 | |||
1949 | FINDSYM(_sym_glDeleteFramebuffers, "glDeleteFramebuffers", glsym_func_void); | ||
1950 | FALLBAK(_sym_glDeleteFramebuffers, glsym_func_void); | ||
1951 | |||
1952 | FINDSYM(_sym_glDeleteProgram, "glDeleteProgram", glsym_func_void); | ||
1953 | FALLBAK(_sym_glDeleteProgram, glsym_func_void); | ||
1954 | |||
1955 | FINDSYM(_sym_glDeleteRenderbuffers, "glDeleteRenderbuffers", glsym_func_void); | ||
1956 | FALLBAK(_sym_glDeleteRenderbuffers, glsym_func_void); | ||
1957 | |||
1958 | FINDSYM(_sym_glDeleteShader, "glDeleteShader", glsym_func_void); | ||
1959 | FALLBAK(_sym_glDeleteShader, glsym_func_void); | ||
1960 | |||
1961 | FINDSYM(_sym_glDeleteTextures, "glDeleteTextures", glsym_func_void); | ||
1962 | FALLBAK(_sym_glDeleteTextures, glsym_func_void); | ||
1963 | |||
1964 | FINDSYM(_sym_glDepthFunc, "glDepthFunc", glsym_func_void); | ||
1965 | FALLBAK(_sym_glDepthFunc, glsym_func_void); | ||
1966 | |||
1967 | FINDSYM(_sym_glDepthMask, "glDepthMask", glsym_func_void); | ||
1968 | FALLBAK(_sym_glDepthMask, glsym_func_void); | ||
1969 | |||
1970 | FINDSYM(_sym_glDepthRangef, "glDepthRangef", glsym_func_void); | ||
1971 | FINDSYM(_sym_glDepthRangef, "glDepthRange", glsym_func_void); | ||
1972 | FALLBAK(_sym_glDepthRangef, glsym_func_void); | ||
1973 | |||
1974 | FINDSYM(_sym_glDetachShader, "glDetachShader", glsym_func_void); | ||
1975 | FALLBAK(_sym_glDetachShader, glsym_func_void); | ||
1976 | |||
1977 | FINDSYM(_sym_glDisable, "glDisable", glsym_func_void); | ||
1978 | FALLBAK(_sym_glDisable, glsym_func_void); | ||
1979 | |||
1980 | FINDSYM(_sym_glDisableVertexAttribArray, "glDisableVertexAttribArray", glsym_func_void); | ||
1981 | FALLBAK(_sym_glDisableVertexAttribArray, glsym_func_void); | ||
1982 | |||
1983 | FINDSYM(_sym_glDrawArrays, "glDrawArrays", glsym_func_void); | ||
1984 | FALLBAK(_sym_glDrawArrays, glsym_func_void); | ||
1985 | |||
1986 | FINDSYM(_sym_glDrawElements, "glDrawElements", glsym_func_void); | ||
1987 | FALLBAK(_sym_glDrawElements, glsym_func_void); | ||
1988 | |||
1989 | FINDSYM(_sym_glEnable, "glEnable", glsym_func_void); | ||
1990 | FALLBAK(_sym_glEnable, glsym_func_void); | ||
1991 | |||
1992 | FINDSYM(_sym_glEnableVertexAttribArray, "glEnableVertexAttribArray", glsym_func_void); | ||
1993 | FALLBAK(_sym_glEnableVertexAttribArray, glsym_func_void); | ||
1994 | |||
1995 | FINDSYM(_sym_glFinish, "glFinish", glsym_func_void); | ||
1996 | FALLBAK(_sym_glFinish, glsym_func_void); | ||
1997 | |||
1998 | FINDSYM(_sym_glFlush, "glFlush", glsym_func_void); | ||
1999 | FALLBAK(_sym_glFlush, glsym_func_void); | ||
2000 | |||
2001 | FINDSYM(_sym_glFramebufferRenderbuffer, "glFramebufferRenderbuffer", glsym_func_void); | ||
2002 | FALLBAK(_sym_glFramebufferRenderbuffer, glsym_func_void); | ||
2003 | |||
2004 | FINDSYM(_sym_glFramebufferTexture2D, "glFramebufferTexture2D", glsym_func_void); | ||
2005 | FALLBAK(_sym_glFramebufferTexture2D, glsym_func_void); | ||
2006 | |||
2007 | FINDSYM(_sym_glFrontFace, "glFrontFace", glsym_func_void); | ||
2008 | FALLBAK(_sym_glFrontFace, glsym_func_void); | ||
2009 | |||
2010 | FINDSYM(_sym_glGenBuffers, "glGenBuffers", glsym_func_void); | ||
2011 | FALLBAK(_sym_glGenBuffers, glsym_func_void); | ||
2012 | |||
2013 | FINDSYM(_sym_glGenerateMipmap, "glGenerateMipmap", glsym_func_void); | ||
2014 | FALLBAK(_sym_glGenerateMipmap, glsym_func_void); | ||
2015 | |||
2016 | FINDSYM(_sym_glGenFramebuffers, "glGenFramebuffers", glsym_func_void); | ||
2017 | FALLBAK(_sym_glGenFramebuffers, glsym_func_void); | ||
2018 | |||
2019 | FINDSYM(_sym_glGenRenderbuffers, "glGenRenderbuffers", glsym_func_void); | ||
2020 | FALLBAK(_sym_glGenRenderbuffers, glsym_func_void); | ||
2021 | |||
2022 | FINDSYM(_sym_glGenTextures, "glGenTextures", glsym_func_void); | ||
2023 | FALLBAK(_sym_glGenTextures, glsym_func_void); | ||
2024 | |||
2025 | FINDSYM(_sym_glGetActiveAttrib, "glGetActiveAttrib", glsym_func_void); | ||
2026 | FALLBAK(_sym_glGetActiveAttrib, glsym_func_void); | ||
2027 | |||
2028 | FINDSYM(_sym_glGetActiveUniform, "glGetActiveUniform", glsym_func_void); | ||
2029 | FALLBAK(_sym_glGetActiveUniform, glsym_func_void); | ||
2030 | |||
2031 | FINDSYM(_sym_glGetAttachedShaders, "glGetAttachedShaders", glsym_func_void); | ||
2032 | FALLBAK(_sym_glGetAttachedShaders, glsym_func_void); | ||
2033 | |||
2034 | FINDSYM(_sym_glGetAttribLocation, "glGetAttribLocation", glsym_func_int); | ||
2035 | FALLBAK(_sym_glGetAttribLocation, glsym_func_int); | ||
2036 | |||
2037 | FINDSYM(_sym_glGetBooleanv, "glGetBooleanv", glsym_func_void); | ||
2038 | FALLBAK(_sym_glGetBooleanv, glsym_func_void); | ||
2039 | |||
2040 | FINDSYM(_sym_glGetBufferParameteriv, "glGetBufferParameteriv", glsym_func_void); | ||
2041 | FALLBAK(_sym_glGetBufferParameteriv, glsym_func_void); | ||
2042 | |||
2043 | FINDSYM(_sym_glGetError, "glGetError", glsym_func_uint); | ||
2044 | FALLBAK(_sym_glGetError, glsym_func_uint); | ||
2045 | |||
2046 | FINDSYM(_sym_glGetFloatv, "glGetFloatv", glsym_func_void); | ||
2047 | FALLBAK(_sym_glGetFloatv, glsym_func_void); | ||
2048 | |||
2049 | FINDSYM(_sym_glGetFramebufferAttachmentParameteriv, "glGetFramebufferAttachmentParameteriv", glsym_func_void); | ||
2050 | FALLBAK(_sym_glGetFramebufferAttachmentParameteriv, glsym_func_void); | ||
2051 | |||
2052 | FINDSYM(_sym_glGetIntegerv, "glGetIntegerv", glsym_func_void); | ||
2053 | FALLBAK(_sym_glGetIntegerv, glsym_func_void); | ||
2054 | |||
2055 | FINDSYM(_sym_glGetProgramiv, "glGetProgramiv", glsym_func_void); | ||
2056 | FALLBAK(_sym_glGetProgramiv, glsym_func_void); | ||
2057 | |||
2058 | FINDSYM(_sym_glGetProgramInfoLog, "glGetProgramInfoLog", glsym_func_void); | ||
2059 | FALLBAK(_sym_glGetProgramInfoLog, glsym_func_void); | ||
2060 | |||
2061 | FINDSYM(_sym_glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv", glsym_func_void); | ||
2062 | FALLBAK(_sym_glGetRenderbufferParameteriv, glsym_func_void); | ||
2063 | |||
2064 | FINDSYM(_sym_glGetShaderiv, "glGetShaderiv", glsym_func_void); | ||
2065 | FALLBAK(_sym_glGetShaderiv, glsym_func_void); | ||
2066 | |||
2067 | FINDSYM(_sym_glGetShaderInfoLog, "glGetShaderInfoLog", glsym_func_void); | ||
2068 | FALLBAK(_sym_glGetShaderInfoLog, glsym_func_void); | ||
2069 | |||
2070 | FINDSYM(_sym_glGetShaderPrecisionFormat, "glGetShaderPrecisionFormat", glsym_func_void); | ||
2071 | FALLBAK(_sym_glGetShaderPrecisionFormat, glsym_func_void); | ||
2072 | |||
2073 | FINDSYM(_sym_glGetShaderSource, "glGetShaderSource", glsym_func_void); | ||
2074 | FALLBAK(_sym_glGetShaderSource, glsym_func_void); | ||
2075 | |||
2076 | FINDSYM(_sym_glGetString, "glGetString", glsym_func_uchar_ptr); | ||
2077 | FALLBAK(_sym_glGetString, glsym_func_const_uchar_ptr); | ||
2078 | |||
2079 | FINDSYM(_sym_glGetTexParameterfv, "glGetTexParameterfv", glsym_func_void); | ||
2080 | FALLBAK(_sym_glGetTexParameterfv, glsym_func_void); | ||
2081 | |||
2082 | FINDSYM(_sym_glGetTexParameteriv, "glGetTexParameteriv", glsym_func_void); | ||
2083 | FALLBAK(_sym_glGetTexParameteriv, glsym_func_void); | ||
2084 | |||
2085 | FINDSYM(_sym_glGetUniformfv, "glGetUniformfv", glsym_func_void); | ||
2086 | FALLBAK(_sym_glGetUniformfv, glsym_func_void); | ||
2087 | |||
2088 | FINDSYM(_sym_glGetUniformiv, "glGetUniformiv", glsym_func_void); | ||
2089 | FALLBAK(_sym_glGetUniformiv, glsym_func_void); | ||
2090 | |||
2091 | FINDSYM(_sym_glGetUniformLocation, "glGetUniformLocation", glsym_func_int); | ||
2092 | FALLBAK(_sym_glGetUniformLocation, glsym_func_int); | ||
2093 | |||
2094 | FINDSYM(_sym_glGetVertexAttribfv, "glGetVertexAttribfv", glsym_func_void); | ||
2095 | FALLBAK(_sym_glGetVertexAttribfv, glsym_func_void); | ||
2096 | |||
2097 | FINDSYM(_sym_glGetVertexAttribiv, "glGetVertexAttribiv", glsym_func_void); | ||
2098 | FALLBAK(_sym_glGetVertexAttribiv, glsym_func_void); | ||
2099 | |||
2100 | FINDSYM(_sym_glGetVertexAttribPointerv, "glGetVertexAttribPointerv", glsym_func_void); | ||
2101 | FALLBAK(_sym_glGetVertexAttribPointerv, glsym_func_void); | ||
2102 | |||
2103 | FINDSYM(_sym_glHint, "glHint", glsym_func_void); | ||
2104 | FALLBAK(_sym_glHint, glsym_func_void); | ||
2105 | |||
2106 | FINDSYM(_sym_glIsBuffer, "glIsBuffer", glsym_func_uchar); | ||
2107 | FALLBAK(_sym_glIsBuffer, glsym_func_uchar); | ||
2108 | |||
2109 | FINDSYM(_sym_glIsEnabled, "glIsEnabled", glsym_func_uchar); | ||
2110 | FALLBAK(_sym_glIsEnabled, glsym_func_uchar); | ||
2111 | |||
2112 | FINDSYM(_sym_glIsFramebuffer, "glIsFramebuffer", glsym_func_uchar); | ||
2113 | FALLBAK(_sym_glIsFramebuffer, glsym_func_uchar); | ||
2114 | |||
2115 | FINDSYM(_sym_glIsProgram, "glIsProgram", glsym_func_uchar); | ||
2116 | FALLBAK(_sym_glIsProgram, glsym_func_uchar); | ||
2117 | |||
2118 | FINDSYM(_sym_glIsRenderbuffer, "glIsRenderbuffer", glsym_func_uchar); | ||
2119 | FALLBAK(_sym_glIsRenderbuffer, glsym_func_uchar); | ||
2120 | |||
2121 | FINDSYM(_sym_glIsShader, "glIsShader", glsym_func_uchar); | ||
2122 | FALLBAK(_sym_glIsShader, glsym_func_uchar); | ||
2123 | |||
2124 | FINDSYM(_sym_glIsTexture, "glIsTexture", glsym_func_uchar); | ||
2125 | FALLBAK(_sym_glIsTexture, glsym_func_uchar); | ||
2126 | |||
2127 | FINDSYM(_sym_glLineWidth, "glLineWidth", glsym_func_void); | ||
2128 | FALLBAK(_sym_glLineWidth, glsym_func_void); | ||
2129 | |||
2130 | FINDSYM(_sym_glLinkProgram, "glLinkProgram", glsym_func_void); | ||
2131 | FALLBAK(_sym_glLinkProgram, glsym_func_void); | ||
2132 | |||
2133 | FINDSYM(_sym_glPixelStorei, "glPixelStorei", glsym_func_void); | ||
2134 | FALLBAK(_sym_glPixelStorei, glsym_func_void); | ||
2135 | |||
2136 | FINDSYM(_sym_glPolygonOffset, "glPolygonOffset", glsym_func_void); | ||
2137 | FALLBAK(_sym_glPolygonOffset, glsym_func_void); | ||
2138 | |||
2139 | FINDSYM(_sym_glReadPixels, "glReadPixels", glsym_func_void); | ||
2140 | FALLBAK(_sym_glReadPixels, glsym_func_void); | ||
2141 | |||
2142 | FINDSYM(_sym_glReleaseShaderCompiler, "glReleaseShaderCompiler", glsym_func_void); | ||
2143 | FALLBAK(_sym_glReleaseShaderCompiler, glsym_func_void); | ||
2144 | |||
2145 | FINDSYM(_sym_glRenderbufferStorage, "glRenderbufferStorage", glsym_func_void); | ||
2146 | FALLBAK(_sym_glRenderbufferStorage, glsym_func_void); | ||
2147 | |||
2148 | FINDSYM(_sym_glSampleCoverage, "glSampleCoverage", glsym_func_void); | ||
2149 | FALLBAK(_sym_glSampleCoverage, glsym_func_void); | ||
2150 | |||
2151 | FINDSYM(_sym_glScissor, "glScissor", glsym_func_void); | ||
2152 | FALLBAK(_sym_glScissor, glsym_func_void); | ||
2153 | |||
2154 | FINDSYM(_sym_glShaderBinary, "glShaderBinary", glsym_func_void); | ||
2155 | FALLBAK(_sym_glShaderBinary, glsym_func_void); | ||
2156 | |||
2157 | FINDSYM(_sym_glShaderSource, "glShaderSource", glsym_func_void); | ||
2158 | FALLBAK(_sym_glShaderSource, glsym_func_void); | ||
2159 | |||
2160 | FINDSYM(_sym_glStencilFunc, "glStencilFunc", glsym_func_void); | ||
2161 | FALLBAK(_sym_glStencilFunc, glsym_func_void); | ||
2162 | |||
2163 | FINDSYM(_sym_glStencilFuncSeparate, "glStencilFuncSeparate", glsym_func_void); | ||
2164 | FALLBAK(_sym_glStencilFuncSeparate, glsym_func_void); | ||
2165 | |||
2166 | FINDSYM(_sym_glStencilMask, "glStencilMask", glsym_func_void); | ||
2167 | FALLBAK(_sym_glStencilMask, glsym_func_void); | ||
2168 | |||
2169 | FINDSYM(_sym_glStencilMaskSeparate, "glStencilMaskSeparate", glsym_func_void); | ||
2170 | FALLBAK(_sym_glStencilMaskSeparate, glsym_func_void); | ||
2171 | |||
2172 | FINDSYM(_sym_glStencilOp, "glStencilOp", glsym_func_void); | ||
2173 | FALLBAK(_sym_glStencilOp, glsym_func_void); | ||
2174 | |||
2175 | FINDSYM(_sym_glStencilOpSeparate, "glStencilOpSeparate", glsym_func_void); | ||
2176 | FALLBAK(_sym_glStencilOpSeparate, glsym_func_void); | ||
2177 | |||
2178 | FINDSYM(_sym_glTexImage2D, "glTexImage2D", glsym_func_void); | ||
2179 | FALLBAK(_sym_glTexImage2D, glsym_func_void); | ||
2180 | |||
2181 | FINDSYM(_sym_glTexParameterf, "glTexParameterf", glsym_func_void); | ||
2182 | FALLBAK(_sym_glTexParameterf, glsym_func_void); | ||
2183 | |||
2184 | FINDSYM(_sym_glTexParameterfv, "glTexParameterfv", glsym_func_void); | ||
2185 | FALLBAK(_sym_glTexParameterfv, glsym_func_void); | ||
2186 | |||
2187 | FINDSYM(_sym_glTexParameteri, "glTexParameteri", glsym_func_void); | ||
2188 | FALLBAK(_sym_glTexParameteri, glsym_func_void); | ||
2189 | |||
2190 | FINDSYM(_sym_glTexParameteriv, "glTexParameteriv", glsym_func_void); | ||
2191 | FALLBAK(_sym_glTexParameteriv, glsym_func_void); | ||
2192 | |||
2193 | FINDSYM(_sym_glTexSubImage2D, "glTexSubImage2D", glsym_func_void); | ||
2194 | FALLBAK(_sym_glTexSubImage2D, glsym_func_void); | ||
2195 | |||
2196 | FINDSYM(_sym_glUniform1f, "glUniform1f", glsym_func_void); | ||
2197 | FALLBAK(_sym_glUniform1f, glsym_func_void); | ||
2198 | |||
2199 | FINDSYM(_sym_glUniform1fv, "glUniform1fv", glsym_func_void); | ||
2200 | FALLBAK(_sym_glUniform1fv, glsym_func_void); | ||
2201 | |||
2202 | FINDSYM(_sym_glUniform1i, "glUniform1i", glsym_func_void); | ||
2203 | FALLBAK(_sym_glUniform1i, glsym_func_void); | ||
2204 | |||
2205 | FINDSYM(_sym_glUniform1iv, "glUniform1iv", glsym_func_void); | ||
2206 | FALLBAK(_sym_glUniform1iv, glsym_func_void); | ||
2207 | |||
2208 | FINDSYM(_sym_glUniform2f, "glUniform2f", glsym_func_void); | ||
2209 | FALLBAK(_sym_glUniform2f, glsym_func_void); | ||
2210 | |||
2211 | FINDSYM(_sym_glUniform2fv, "glUniform2fv", glsym_func_void); | ||
2212 | FALLBAK(_sym_glUniform2fv, glsym_func_void); | ||
2213 | |||
2214 | FINDSYM(_sym_glUniform2i, "glUniform2i", glsym_func_void); | ||
2215 | FALLBAK(_sym_glUniform2i, glsym_func_void); | ||
2216 | |||
2217 | FINDSYM(_sym_glUniform2iv, "glUniform2iv", glsym_func_void); | ||
2218 | FALLBAK(_sym_glUniform2iv, glsym_func_void); | ||
2219 | |||
2220 | FINDSYM(_sym_glUniform3f, "glUniform3f", glsym_func_void); | ||
2221 | FALLBAK(_sym_glUniform3f, glsym_func_void); | ||
2222 | |||
2223 | FINDSYM(_sym_glUniform3fv, "glUniform3fv", glsym_func_void); | ||
2224 | FALLBAK(_sym_glUniform3fv, glsym_func_void); | ||
2225 | |||
2226 | FINDSYM(_sym_glUniform3i, "glUniform3i", glsym_func_void); | ||
2227 | FALLBAK(_sym_glUniform3i, glsym_func_void); | ||
2228 | |||
2229 | FINDSYM(_sym_glUniform3iv, "glUniform3iv", glsym_func_void); | ||
2230 | FALLBAK(_sym_glUniform3iv, glsym_func_void); | ||
2231 | |||
2232 | FINDSYM(_sym_glUniform4f, "glUniform4f", glsym_func_void); | ||
2233 | FALLBAK(_sym_glUniform4f, glsym_func_void); | ||
2234 | |||
2235 | FINDSYM(_sym_glUniform4fv, "glUniform4fv", glsym_func_void); | ||
2236 | FALLBAK(_sym_glUniform4fv, glsym_func_void); | ||
2237 | |||
2238 | FINDSYM(_sym_glUniform4i, "glUniform4i", glsym_func_void); | ||
2239 | FALLBAK(_sym_glUniform4i, glsym_func_void); | ||
2240 | |||
2241 | FINDSYM(_sym_glUniform4iv, "glUniform4iv", glsym_func_void); | ||
2242 | FALLBAK(_sym_glUniform4iv, glsym_func_void); | ||
2243 | |||
2244 | FINDSYM(_sym_glUniformMatrix2fv, "glUniformMatrix2fv", glsym_func_void); | ||
2245 | FALLBAK(_sym_glUniformMatrix2fv, glsym_func_void); | ||
2246 | |||
2247 | FINDSYM(_sym_glUniformMatrix3fv, "glUniformMatrix3fv", glsym_func_void); | ||
2248 | FALLBAK(_sym_glUniformMatrix3fv, glsym_func_void); | ||
2249 | |||
2250 | FINDSYM(_sym_glUniformMatrix4fv, "glUniformMatrix4fv", glsym_func_void); | ||
2251 | FALLBAK(_sym_glUniformMatrix4fv, glsym_func_void); | ||
2252 | |||
2253 | FINDSYM(_sym_glUseProgram, "glUseProgram", glsym_func_void); | ||
2254 | FALLBAK(_sym_glUseProgram, glsym_func_void); | ||
2255 | |||
2256 | FINDSYM(_sym_glValidateProgram, "glValidateProgram", glsym_func_void); | ||
2257 | FALLBAK(_sym_glValidateProgram, glsym_func_void); | ||
2258 | |||
2259 | FINDSYM(_sym_glVertexAttrib1f, "glVertexAttrib1f", glsym_func_void); | ||
2260 | FALLBAK(_sym_glVertexAttrib1f, glsym_func_void); | ||
2261 | |||
2262 | FINDSYM(_sym_glVertexAttrib1fv, "glVertexAttrib1fv", glsym_func_void); | ||
2263 | FALLBAK(_sym_glVertexAttrib1fv, glsym_func_void); | ||
2264 | |||
2265 | FINDSYM(_sym_glVertexAttrib2f, "glVertexAttrib2f", glsym_func_void); | ||
2266 | FALLBAK(_sym_glVertexAttrib2f, glsym_func_void); | ||
2267 | |||
2268 | FINDSYM(_sym_glVertexAttrib2fv, "glVertexAttrib2fv", glsym_func_void); | ||
2269 | FALLBAK(_sym_glVertexAttrib2fv, glsym_func_void); | ||
2270 | |||
2271 | FINDSYM(_sym_glVertexAttrib3f, "glVertexAttrib3f", glsym_func_void); | ||
2272 | FALLBAK(_sym_glVertexAttrib3f, glsym_func_void); | ||
2273 | |||
2274 | FINDSYM(_sym_glVertexAttrib3fv, "glVertexAttrib3fv", glsym_func_void); | ||
2275 | FALLBAK(_sym_glVertexAttrib3fv, glsym_func_void); | ||
2276 | |||
2277 | FINDSYM(_sym_glVertexAttrib4f, "glVertexAttrib4f", glsym_func_void); | ||
2278 | FALLBAK(_sym_glVertexAttrib4f, glsym_func_void); | ||
2279 | |||
2280 | FINDSYM(_sym_glVertexAttrib4fv, "glVertexAttrib4fv", glsym_func_void); | ||
2281 | FALLBAK(_sym_glVertexAttrib4fv, glsym_func_void); | ||
2282 | |||
2283 | FINDSYM(_sym_glVertexAttribPointer, "glVertexAttribPointer", glsym_func_void); | ||
2284 | FALLBAK(_sym_glVertexAttribPointer, glsym_func_void); | ||
2285 | |||
2286 | FINDSYM(_sym_glViewport, "glViewport", glsym_func_void); | ||
2287 | FALLBAK(_sym_glViewport, glsym_func_void); | ||
2288 | |||
2289 | #undef FINDSYM | ||
2290 | #undef FALLBAK | ||
2291 | |||
2292 | // Checking to see if this function exists is a poor but reasonable way to | ||
2293 | // check if it's gles but it works for now | ||
2294 | if (_sym_glGetShaderPrecisionFormat != (typeof(_sym_glGetShaderPrecisionFormat))sym_missing ) | ||
2295 | { | ||
2296 | DBG("GL Library is GLES."); | ||
2297 | gl_lib_is_gles = 1; | ||
2298 | } | ||
2299 | |||
2300 | return 1; | ||
2301 | } | ||
2302 | |||
2303 | //--------------------------------------------------------------// | ||
2304 | // Wrapped GL APIs to handle desktop compatibility | ||
2305 | |||
2306 | // Stripping precision code from GLES shader for desktop compatibility | ||
2307 | // Code adopted from Meego GL code. Temporary Fix. | ||
2308 | static const char * | ||
2309 | opengl_strtok(const char *s, int *n, char **saveptr, char *prevbuf) | ||
2310 | { | ||
2311 | char *start; | ||
2312 | char *ret; | ||
2313 | char *p; | ||
2314 | int retlen; | ||
2315 | static const char *delim = " \t\n\r/"; | ||
2316 | |||
2317 | if (prevbuf) free(prevbuf); | ||
2318 | |||
2319 | if (s) | ||
2320 | *saveptr = (char *)s; | ||
2321 | else | ||
2322 | { | ||
2323 | if (!(*saveptr) || !(*n)) | ||
2324 | return NULL; | ||
2325 | s = *saveptr; | ||
2326 | } | ||
2327 | |||
2328 | for (; *n && strchr(delim, *s); s++, (*n)--) | ||
2329 | { | ||
2330 | if (*s == '/' && *n > 1) | ||
2331 | { | ||
2332 | if (s[1] == '/') | ||
2333 | { | ||
2334 | do | ||
2335 | { | ||
2336 | s++, (*n)--; | ||
2337 | } | ||
2338 | while (*n > 1 && s[1] != '\n' && s[1] != '\r'); | ||
2339 | } | ||
2340 | else if (s[1] == '*') | ||
2341 | { | ||
2342 | do | ||
2343 | { | ||
2344 | s++, (*n)--; | ||
2345 | } | ||
2346 | while (*n > 2 && (s[1] != '*' || s[2] != '/')); | ||
2347 | s++, (*n)--; | ||
2348 | } | ||
2349 | } | ||
2350 | } | ||
2351 | |||
2352 | start = (char *)s; | ||
2353 | for (; *n && *s && !strchr(delim, *s); s++, (*n)--); | ||
2354 | if (*n > 0) s++, (*n)--; | ||
2355 | |||
2356 | *saveptr = (char *)s; | ||
2357 | |||
2358 | retlen = s - start; | ||
2359 | ret = malloc(retlen + 1); | ||
2360 | p = ret; | ||
2361 | |||
2362 | while (retlen > 0) | ||
2363 | { | ||
2364 | if (*start == '/' && retlen > 1) | ||
2365 | { | ||
2366 | if (start[1] == '/') | ||
2367 | { | ||
2368 | do | ||
2369 | { | ||
2370 | start++, retlen--; | ||
2371 | } | ||
2372 | while (retlen > 1 && start[1] != '\n' && start[1] != '\r'); | ||
2373 | start++, retlen--; | ||
2374 | continue; | ||
2375 | } | ||
2376 | else if (start[1] == '*') | ||
2377 | { | ||
2378 | do | ||
2379 | { | ||
2380 | start++, retlen--; | ||
2381 | } | ||
2382 | while (retlen > 2 && (start[1] != '*' || start[2] != '/')); | ||
2383 | start += 3, retlen -= 3; | ||
2384 | continue; | ||
2385 | } | ||
2386 | } | ||
2387 | *(p++) = *(start++), retlen--; | ||
2388 | } | ||
2389 | |||
2390 | *p = 0; | ||
2391 | return ret; | ||
2392 | } | ||
2393 | |||
2394 | static char * | ||
2395 | patch_gles_shader(const char *source, int length, int *patched_len) | ||
2396 | { | ||
2397 | char *saveptr = NULL; | ||
2398 | char *sp; | ||
2399 | char *p = NULL; | ||
2400 | |||
2401 | if (!length) length = strlen(source); | ||
2402 | |||
2403 | *patched_len = 0; | ||
2404 | int patched_size = length; | ||
2405 | char *patched = malloc(patched_size + 1); | ||
2406 | |||
2407 | if (!patched) return NULL; | ||
2408 | |||
2409 | p = (char *)opengl_strtok(source, &length, &saveptr, NULL); | ||
2410 | for (; p; p = (char *)opengl_strtok(0, &length, &saveptr, p)) | ||
2411 | { | ||
2412 | if (!strncmp(p, "lowp", 4) || !strncmp(p, "mediump", 7) || !strncmp(p, "highp", 5)) | ||
2413 | { | ||
2414 | continue; | ||
2415 | } | ||
2416 | else if (!strncmp(p, "precision", 9)) | ||
2417 | { | ||
2418 | while ((p = (char *)opengl_strtok(0, &length, &saveptr, p)) && !strchr(p, ';')); | ||
2419 | } | ||
2420 | else | ||
2421 | { | ||
2422 | if (!strncmp(p, "gl_MaxVertexUniformVectors", 26)) | ||
2423 | { | ||
2424 | p = "(gl_MaxVertexUniformComponents / 4)"; | ||
2425 | } | ||
2426 | else if (!strncmp(p, "gl_MaxFragmentUniformVectors", 28)) | ||
2427 | { | ||
2428 | p = "(gl_MaxFragmentUniformComponents / 4)"; | ||
2429 | } | ||
2430 | else if (!strncmp(p, "gl_MaxVaryingVectors", 20)) | ||
2431 | { | ||
2432 | p = "(gl_MaxVaryingFloats / 4)"; | ||
2433 | } | ||
2434 | |||
2435 | int new_len = strlen(p); | ||
2436 | if (*patched_len + new_len > patched_size) | ||
2437 | { | ||
2438 | patched_size *= 2; | ||
2439 | patched = realloc(patched, patched_size + 1); | ||
2440 | |||
2441 | if (!patched) | ||
2442 | return NULL; | ||
2443 | } | ||
2444 | |||
2445 | memcpy(patched + *patched_len, p, new_len); | ||
2446 | *patched_len += new_len; | ||
2447 | } | ||
2448 | } | ||
2449 | |||
2450 | patched[*patched_len] = 0; | ||
2451 | /* check that we don't leave dummy preprocessor lines */ | ||
2452 | for (sp = patched; *sp;) | ||
2453 | { | ||
2454 | for (; *sp == ' ' || *sp == '\t'; sp++); | ||
2455 | if (!strncmp(sp, "#define", 7)) | ||
2456 | { | ||
2457 | for (p = sp + 7; *p == ' ' || *p == '\t'; p++); | ||
2458 | if (*p == '\n' || *p == '\r' || *p == '/') | ||
2459 | { | ||
2460 | memset(sp, 0x20, 7); | ||
2461 | } | ||
2462 | } | ||
2463 | for (; *sp && *sp != '\n' && *sp != '\r'; sp++); | ||
2464 | for (; *sp == '\n' || *sp == '\r'; sp++); | ||
2465 | } | ||
2466 | return patched; | ||
2467 | } | ||
2468 | |||
2469 | static void | ||
2470 | evgl_glShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length) | ||
2471 | { | ||
2472 | int i = 0, len = 0; | ||
2473 | |||
2474 | char **s = malloc(count * sizeof(char*)); | ||
2475 | GLint *l = malloc(count * sizeof(GLint)); | ||
2476 | |||
2477 | memset(s, 0, count * sizeof(char*)); | ||
2478 | memset(l, 0, count * sizeof(GLint)); | ||
2479 | |||
2480 | for (i = 0; i < count; ++i) | ||
2481 | { | ||
2482 | if (length) | ||
2483 | { | ||
2484 | len = length[i]; | ||
2485 | if (len < 0) | ||
2486 | len = string[i] ? strlen(string[i]) : 0; | ||
2487 | } | ||
2488 | else | ||
2489 | len = string[i] ? strlen(string[i]) : 0; | ||
2490 | |||
2491 | if (string[i]) | ||
2492 | { | ||
2493 | s[i] = patch_gles_shader(string[i], len, &l[i]); | ||
2494 | if (!s[i]) | ||
2495 | { | ||
2496 | while(i) | ||
2497 | free(s[--i]); | ||
2498 | free(l); | ||
2499 | free(s); | ||
2500 | |||
2501 | DBG("Patching Shader Failed."); | ||
2502 | return; | ||
2503 | } | ||
2504 | } | ||
2505 | else | ||
2506 | { | ||
2507 | s[i] = NULL; | ||
2508 | l[i] = 0; | ||
2509 | } | ||
2510 | } | ||
2511 | |||
2512 | _sym_glShaderSource(shader, count, (const char **)s, l); | ||
2513 | |||
2514 | while(i) | ||
2515 | free(s[--i]); | ||
2516 | free(l); | ||
2517 | free(s); | ||
2518 | } | ||
2519 | |||
2520 | |||
2521 | static void | ||
2522 | evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) | ||
2523 | { | ||
2524 | if (range) | ||
2525 | { | ||
2526 | range[0] = -126; // floor(log2(FLT_MIN)) | ||
2527 | range[1] = 127; // floor(log2(FLT_MAX)) | ||
2528 | } | ||
2529 | if (precision) | ||
2530 | { | ||
2531 | precision[0] = 24; // floor(-log2((1.0/16777218.0))); | ||
2532 | } | ||
2533 | return; | ||
2534 | shadertype = precisiontype = 0; | ||
2535 | } | ||
2536 | |||
2537 | static void | ||
2538 | evgl_glReleaseShaderCompiler(void) | ||
2539 | { | ||
2540 | DBG("Not supported in Desktop GL"); | ||
2541 | return; | ||
2542 | } | ||
2543 | |||
2544 | static void | ||
2545 | evgl_glShaderBinary(GLsizei n __UNUSED__, const GLuint* shaders __UNUSED__, GLenum binaryformat __UNUSED__, const void* binary __UNUSED__, GLsizei length __UNUSED__) | ||
2546 | { | ||
2547 | // FIXME: need to dlsym/getprocaddress for this | ||
2548 | DBG("Not supported in Desktop GL"); | ||
2549 | return; | ||
2550 | //n = binaryformat = length = 0; | ||
2551 | //shaders = binary = 0; | ||
2552 | } | ||
2553 | #endif | ||
2554 | //--------------------------------------------------------------// | ||
2555 | |||
2556 | |||
2557 | #ifdef EVAS_GL | ||
2558 | static void | ||
2559 | override_gl_apis(Evas_GL_API *api) | ||
2560 | { | ||
2561 | |||
2562 | api->version = EVAS_GL_API_VERSION; | ||
2563 | |||
2564 | #define ORD(f) EVAS_API_OVERRIDE(f, api, _sym_) | ||
2565 | // GLES 2.0 | ||
2566 | ORD(glActiveTexture); | ||
2567 | ORD(glAttachShader); | ||
2568 | ORD(glBindAttribLocation); | ||
2569 | ORD(glBindBuffer); | ||
2570 | ORD(glBindTexture); | ||
2571 | ORD(glBlendColor); | ||
2572 | ORD(glBlendEquation); | ||
2573 | ORD(glBlendEquationSeparate); | ||
2574 | ORD(glBlendFunc); | ||
2575 | ORD(glBlendFuncSeparate); | ||
2576 | ORD(glBufferData); | ||
2577 | ORD(glBufferSubData); | ||
2578 | ORD(glCheckFramebufferStatus); | ||
2579 | ORD(glClear); | ||
2580 | ORD(glClearColor); | ||
2581 | ORD(glClearDepthf); | ||
2582 | ORD(glClearStencil); | ||
2583 | ORD(glColorMask); | ||
2584 | ORD(glCompileShader); | ||
2585 | ORD(glCompressedTexImage2D); | ||
2586 | ORD(glCompressedTexSubImage2D); | ||
2587 | ORD(glCopyTexImage2D); | ||
2588 | ORD(glCopyTexSubImage2D); | ||
2589 | ORD(glCreateProgram); | ||
2590 | ORD(glCreateShader); | ||
2591 | ORD(glCullFace); | ||
2592 | ORD(glDeleteBuffers); | ||
2593 | ORD(glDeleteFramebuffers); | ||
2594 | ORD(glDeleteProgram); | ||
2595 | ORD(glDeleteRenderbuffers); | ||
2596 | ORD(glDeleteShader); | ||
2597 | ORD(glDeleteTextures); | ||
2598 | ORD(glDepthFunc); | ||
2599 | ORD(glDepthMask); | ||
2600 | ORD(glDepthRangef); | ||
2601 | ORD(glDetachShader); | ||
2602 | ORD(glDisable); | ||
2603 | ORD(glDisableVertexAttribArray); | ||
2604 | ORD(glDrawArrays); | ||
2605 | ORD(glDrawElements); | ||
2606 | ORD(glEnable); | ||
2607 | ORD(glEnableVertexAttribArray); | ||
2608 | ORD(glFinish); | ||
2609 | ORD(glFlush); | ||
2610 | ORD(glFramebufferRenderbuffer); | ||
2611 | ORD(glFramebufferTexture2D); | ||
2612 | ORD(glFrontFace); | ||
2613 | ORD(glGenBuffers); | ||
2614 | ORD(glGenerateMipmap); | ||
2615 | ORD(glGenFramebuffers); | ||
2616 | ORD(glGenRenderbuffers); | ||
2617 | ORD(glGenTextures); | ||
2618 | ORD(glGetActiveAttrib); | ||
2619 | ORD(glGetActiveUniform); | ||
2620 | ORD(glGetAttachedShaders); | ||
2621 | ORD(glGetAttribLocation); | ||
2622 | ORD(glGetBooleanv); | ||
2623 | ORD(glGetBufferParameteriv); | ||
2624 | ORD(glGetError); | ||
2625 | ORD(glGetFloatv); | ||
2626 | ORD(glGetFramebufferAttachmentParameteriv); | ||
2627 | ORD(glGetIntegerv); | ||
2628 | ORD(glGetProgramiv); | ||
2629 | ORD(glGetProgramInfoLog); | ||
2630 | ORD(glGetRenderbufferParameteriv); | ||
2631 | ORD(glGetShaderiv); | ||
2632 | ORD(glGetShaderInfoLog); | ||
2633 | ORD(glGetShaderPrecisionFormat); | ||
2634 | ORD(glGetShaderSource); | ||
2635 | ORD(glGetString); // FIXME | ||
2636 | ORD(glGetTexParameterfv); | ||
2637 | ORD(glGetTexParameteriv); | ||
2638 | ORD(glGetUniformfv); | ||
2639 | ORD(glGetUniformiv); | ||
2640 | ORD(glGetUniformLocation); | ||
2641 | ORD(glGetVertexAttribfv); | ||
2642 | ORD(glGetVertexAttribiv); | ||
2643 | ORD(glGetVertexAttribPointerv); | ||
2644 | ORD(glHint); | ||
2645 | ORD(glIsBuffer); | ||
2646 | ORD(glIsEnabled); | ||
2647 | ORD(glIsFramebuffer); | ||
2648 | ORD(glIsProgram); | ||
2649 | ORD(glIsRenderbuffer); | ||
2650 | ORD(glIsShader); | ||
2651 | ORD(glIsTexture); | ||
2652 | ORD(glLineWidth); | ||
2653 | ORD(glLinkProgram); | ||
2654 | ORD(glPixelStorei); | ||
2655 | ORD(glPolygonOffset); | ||
2656 | ORD(glReadPixels); | ||
2657 | ORD(glReleaseShaderCompiler); | ||
2658 | ORD(glRenderbufferStorage); | ||
2659 | ORD(glSampleCoverage); | ||
2660 | ORD(glScissor); | ||
2661 | ORD(glShaderBinary); | ||
2662 | ORD(glShaderSource); | ||
2663 | ORD(glStencilFunc); | ||
2664 | ORD(glStencilFuncSeparate); | ||
2665 | ORD(glStencilMask); | ||
2666 | ORD(glStencilMaskSeparate); | ||
2667 | ORD(glStencilOp); | ||
2668 | ORD(glStencilOpSeparate); | ||
2669 | ORD(glTexImage2D); | ||
2670 | ORD(glTexParameterf); | ||
2671 | ORD(glTexParameterfv); | ||
2672 | ORD(glTexParameteri); | ||
2673 | ORD(glTexParameteriv); | ||
2674 | ORD(glTexSubImage2D); | ||
2675 | ORD(glUniform1f); | ||
2676 | ORD(glUniform1fv); | ||
2677 | ORD(glUniform1i); | ||
2678 | ORD(glUniform1iv); | ||
2679 | ORD(glUniform2f); | ||
2680 | ORD(glUniform2fv); | ||
2681 | ORD(glUniform2i); | ||
2682 | ORD(glUniform2iv); | ||
2683 | ORD(glUniform3f); | ||
2684 | ORD(glUniform3fv); | ||
2685 | ORD(glUniform3i); | ||
2686 | ORD(glUniform3iv); | ||
2687 | ORD(glUniform4f); | ||
2688 | ORD(glUniform4fv); | ||
2689 | ORD(glUniform4i); | ||
2690 | ORD(glUniform4iv); | ||
2691 | ORD(glUniformMatrix2fv); | ||
2692 | ORD(glUniformMatrix3fv); | ||
2693 | ORD(glUniformMatrix4fv); | ||
2694 | ORD(glUseProgram); | ||
2695 | ORD(glValidateProgram); | ||
2696 | ORD(glVertexAttrib1f); | ||
2697 | ORD(glVertexAttrib1fv); | ||
2698 | ORD(glVertexAttrib2f); | ||
2699 | ORD(glVertexAttrib2fv); | ||
2700 | ORD(glVertexAttrib3f); | ||
2701 | ORD(glVertexAttrib3fv); | ||
2702 | ORD(glVertexAttrib4f); | ||
2703 | ORD(glVertexAttrib4fv); | ||
2704 | ORD(glVertexAttribPointer); | ||
2705 | ORD(glViewport); | ||
2706 | #undef ORD | ||
2707 | |||
2708 | #define ORD(f) EVAS_API_OVERRIDE(f, &gl_funcs, evgl_) | ||
2709 | if (!gl_lib_is_gles) | ||
2710 | { | ||
2711 | // Override functions wrapped by Evas_GL | ||
2712 | // GLES2.0 API compat on top of desktop gl | ||
2713 | ORD(glGetShaderPrecisionFormat); | ||
2714 | ORD(glReleaseShaderCompiler); | ||
2715 | ORD(glShaderBinary); | ||
2716 | } | ||
2717 | |||
2718 | ORD(glShaderSource); // Do precision stripping in both cases | ||
2719 | #undef ORD | ||
2720 | } | ||
2721 | #endif | ||
2722 | |||
2723 | //-------------------------------------------// | ||
2724 | static int | ||
2725 | gl_lib_init(void) | ||
2726 | { | ||
2727 | #ifdef EVAS_GL | ||
2728 | // dlopen OSMesa | ||
2729 | gl_lib_handle = dlopen("libOSMesa.so.1", RTLD_NOW); | ||
2730 | if (!gl_lib_handle) gl_lib_handle = dlopen("libOSMesa.so", RTLD_NOW); | ||
2731 | if (!gl_lib_handle) | ||
2732 | { | ||
2733 | DBG("Unable to open libOSMesa: %s", dlerror()); | ||
2734 | return 0; | ||
2735 | } | ||
2736 | |||
2737 | //------------------------------------------------// | ||
2738 | if (!glue_sym_init()) return 0; | ||
2739 | if (!gl_sym_init()) return 0; | ||
2740 | |||
2741 | override_gl_apis(&gl_funcs); | ||
2742 | |||
2743 | return 1; | ||
2744 | #else | ||
2745 | return 0; | ||
2746 | #endif | ||
2747 | } | ||
2748 | |||
2749 | |||
2750 | static void | ||
2751 | init_gl(void) | ||
2752 | { | ||
2753 | DBG("Initializing Software OpenGL APIs...\n"); | ||
2754 | |||
2755 | if (!gl_lib_init()) | ||
2756 | DBG("Unable to support EvasGL in this engine module. Install OSMesa to get it running"); | ||
2757 | else | ||
2758 | { | ||
2759 | #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) | ||
2760 | ORD(gl_surface_create); | ||
2761 | ORD(gl_surface_destroy); | ||
2762 | ORD(gl_context_create); | ||
2763 | ORD(gl_context_destroy); | ||
2764 | ORD(gl_make_current); | ||
2765 | ORD(gl_string_query); // FIXME: Need to implement | ||
2766 | ORD(gl_proc_address_get); // FIXME: Need to implement | ||
2767 | ORD(gl_native_surface_get); | ||
2768 | ORD(gl_api_get); | ||
2769 | #undef ORD | ||
2770 | } | ||
2771 | } | ||
2772 | |||
2773 | |||
1185 | /* | 2774 | /* |
1186 | ***** | 2775 | ***** |
1187 | ** | 2776 | ** |
@@ -1201,6 +2790,9 @@ module_open(Evas_Module *em) | |||
1201 | EINA_LOG_ERR("Can not create a module log domain."); | 2790 | EINA_LOG_ERR("Can not create a module log domain."); |
1202 | return 0; | 2791 | return 0; |
1203 | } | 2792 | } |
2793 | |||
2794 | init_gl(); | ||
2795 | |||
1204 | em->functions = (void *)(&func); | 2796 | em->functions = (void *)(&func); |
1205 | cpunum = eina_cpu_count(); | 2797 | cpunum = eina_cpu_count(); |
1206 | return 1; | 2798 | return 1; |
diff --git a/libraries/evas/src/modules/engines/software_sdl/Makefile.in b/libraries/evas/src/modules/engines/software_sdl/Makefile.in index d1052c1..f63f3eb 100644 --- a/libraries/evas/src/modules/engines/software_sdl/Makefile.in +++ b/libraries/evas/src/modules/engines/software_sdl/Makefile.in | |||
@@ -241,8 +241,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
241 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 241 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
242 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 242 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
243 | PKG_CONFIG = @PKG_CONFIG@ | 243 | PKG_CONFIG = @PKG_CONFIG@ |
244 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
245 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
246 | PNG_CFLAGS = @PNG_CFLAGS@ | 244 | PNG_CFLAGS = @PNG_CFLAGS@ |
247 | PNG_LIBS = @PNG_LIBS@ | 245 | PNG_LIBS = @PNG_LIBS@ |
248 | RANLIB = @RANLIB@ | 246 | RANLIB = @RANLIB@ |
@@ -259,6 +257,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
259 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 257 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
260 | VERSION = @VERSION@ | 258 | VERSION = @VERSION@ |
261 | VMAJ = @VMAJ@ | 259 | VMAJ = @VMAJ@ |
260 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
261 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
262 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 262 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
263 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 263 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
264 | XCB_CFLAGS = @XCB_CFLAGS@ | 264 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -340,6 +340,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
340 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 340 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
341 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 341 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
342 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 342 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
343 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
344 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
345 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
346 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
343 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 347 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
344 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 348 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
345 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 349 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_x11/Makefile.in b/libraries/evas/src/modules/engines/software_x11/Makefile.in index f5c73af..5fd2971 100644 --- a/libraries/evas/src/modules/engines/software_x11/Makefile.in +++ b/libraries/evas/src/modules/engines/software_x11/Makefile.in | |||
@@ -282,8 +282,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
282 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 282 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
283 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 283 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
284 | PKG_CONFIG = @PKG_CONFIG@ | 284 | PKG_CONFIG = @PKG_CONFIG@ |
285 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
286 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
287 | PNG_CFLAGS = @PNG_CFLAGS@ | 285 | PNG_CFLAGS = @PNG_CFLAGS@ |
288 | PNG_LIBS = @PNG_LIBS@ | 286 | PNG_LIBS = @PNG_LIBS@ |
289 | RANLIB = @RANLIB@ | 287 | RANLIB = @RANLIB@ |
@@ -300,6 +298,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
300 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 298 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
301 | VERSION = @VERSION@ | 299 | VERSION = @VERSION@ |
302 | VMAJ = @VMAJ@ | 300 | VMAJ = @VMAJ@ |
301 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
302 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
303 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 303 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
304 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 304 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
305 | XCB_CFLAGS = @XCB_CFLAGS@ | 305 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -381,6 +381,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
381 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 381 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
382 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 382 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
383 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 383 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
384 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
385 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
386 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
387 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
384 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 388 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
385 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 389 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
386 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 390 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c b/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c index 1b1d3d9..24c45df 100644 --- a/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c +++ b/libraries/evas/src/modules/engines/software_x11/evas_xlib_outbuf.c | |||
@@ -579,6 +579,8 @@ evas_software_xlib_outbuf_new_region_for_update(Outbuf *buf, int x, int y, int w | |||
579 | free(obr); | 579 | free(obr); |
580 | return NULL; | 580 | return NULL; |
581 | } | 581 | } |
582 | im->cache_entry.w = w; | ||
583 | im->cache_entry.h = h; | ||
582 | im->cache_entry.flags.alpha |= alpha ? 1 : 0; | 584 | im->cache_entry.flags.alpha |= alpha ? 1 : 0; |
583 | evas_cache_image_surface_alloc(&im->cache_entry, w, h); | 585 | evas_cache_image_surface_alloc(&im->cache_entry, w, h); |
584 | im->extended_info = obr; | 586 | im->extended_info = obr; |
diff --git a/libraries/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h b/libraries/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h new file mode 100644 index 0000000..92ffe25 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_egl/Evas_Engine_Wayland_Egl.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef _EVAS_ENGINE_WAYLAND_EGL_H | ||
2 | #define _EVAS_ENGINE_WAYLAND_EGL_H | ||
3 | |||
4 | #include <wayland-client.h> | ||
5 | |||
6 | typedef struct _Evas_Engine_Info_Wayland_Egl Evas_Engine_Info_Wayland_Egl; | ||
7 | |||
8 | struct _Evas_Engine_Info_Wayland_Egl | ||
9 | { | ||
10 | /* PRIVATE - don't mess with this baby or evas will poke its tongue out */ | ||
11 | /* at you and make nasty noises */ | ||
12 | Evas_Engine_Info magic; | ||
13 | |||
14 | /* engine specific data & parameters it needs to set up */ | ||
15 | struct { | ||
16 | struct wl_display *display; | ||
17 | struct wl_surface *surface; | ||
18 | int depth; | ||
19 | int screen; | ||
20 | int rotation; | ||
21 | unsigned int destination_alpha : 1; | ||
22 | } info; | ||
23 | /* engine specific function calls to query stuff about the destination */ | ||
24 | /* engine (what visual & colormap & depth to use, performance info etc. */ | ||
25 | struct { | ||
26 | int (*best_depth_get) (Evas_Engine_Info_Wayland_Egl *einfo); | ||
27 | } func; | ||
28 | |||
29 | struct { | ||
30 | void (*pre_swap) (void *data, Evas *e); | ||
31 | void (*post_swap) (void *data, Evas *e); | ||
32 | |||
33 | void *data; // data for callback calls | ||
34 | } callback; | ||
35 | |||
36 | /* non-blocking or blocking mode */ | ||
37 | Evas_Engine_Render_Mode render_mode; | ||
38 | |||
39 | unsigned char vsync : 1; // does nothing right now | ||
40 | unsigned char indirect : 1; // use indirect rendering | ||
41 | }; | ||
42 | #endif | ||
diff --git a/libraries/evas/src/modules/engines/wayland_egl/Makefile.am b/libraries/evas/src/modules/engines/wayland_egl/Makefile.am new file mode 100644 index 0000000..100614f --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_egl/Makefile.am | |||
@@ -0,0 +1,47 @@ | |||
1 | |||
2 | MAINTAINERCLEANFILES = Makefile.in | ||
3 | |||
4 | AM_CPPFLAGS = \ | ||
5 | -I. \ | ||
6 | -I$(top_srcdir)/src/lib \ | ||
7 | -I$(top_srcdir)/src/lib/include \ | ||
8 | -I$(top_srcdir)/src/modules/engines/gl_common \ | ||
9 | @FREETYPE_CFLAGS@ \ | ||
10 | @PIXMAN_CFLAGS@ \ | ||
11 | @EINA_CFLAGS@ \ | ||
12 | @GL_EET_CFLAGS@ \ | ||
13 | @evas_engine_wayland_egl_cflags@ | ||
14 | |||
15 | if BUILD_ENGINE_WAYLAND_EGL | ||
16 | |||
17 | WAYLAND_EGL_SOURCES = \ | ||
18 | evas_engine.c \ | ||
19 | evas_wl_main.c | ||
20 | |||
21 | WAYLAND_EGL_LIBADD = @FREETYPE_LIBS@ @GL_EET_LIBS@ @EINA_LIBS@ @evas_engine_wayland_egl_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la | ||
22 | |||
23 | includes_HEADERS = Evas_Engine_Wayland_Egl.h | ||
24 | includesdir = $(includedir)/evas-@VMAJ@ | ||
25 | |||
26 | if !EVAS_STATIC_BUILD_WAYLAND_EGL | ||
27 | |||
28 | pkgdir = $(libdir)/evas/modules/engines/wayland_egl/$(MODULE_ARCH) | ||
29 | pkg_LTLIBRARIES = module.la | ||
30 | |||
31 | module_la_SOURCES = $(WAYLAND_EGL_SOURCES) | ||
32 | module_la_LIBADD = $(WAYLAND_EGL_LIBADD) $(top_builddir)/src/lib/libevas.la | ||
33 | module_la_LDFLAGS = -no-undefined -module -avoid-version | ||
34 | module_la_LIBTOOLFLAGS = --tag=disable-static | ||
35 | |||
36 | |||
37 | else | ||
38 | |||
39 | noinst_LTLIBRARIES = libevas_engine_wayland_egl.la | ||
40 | |||
41 | libevas_engine_wayland_egl_la_SOURCES = $(WAYLAND_EGL_SOURCES) | ||
42 | libevas_engine_wayland_egl_la_LIBADD = $(WAYLAND_EGL_LIBADD) | ||
43 | |||
44 | endif | ||
45 | endif | ||
46 | |||
47 | EXTRA_DIST = evas_engine.h | ||
diff --git a/libraries/evas/src/modules/engines/wayland_egl/Makefile.in b/libraries/evas/src/modules/engines/wayland_egl/Makefile.in new file mode 100644 index 0000000..0df0c63 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_egl/Makefile.in | |||
@@ -0,0 +1,816 @@ | |||
1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | ||
6 | # Inc. | ||
7 | # This Makefile.in is free software; the Free Software Foundation | ||
8 | # gives unlimited permission to copy and/or distribute it, | ||
9 | # with or without modifications, as long as this notice is preserved. | ||
10 | |||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
14 | # PARTICULAR PURPOSE. | ||
15 | |||
16 | @SET_MAKE@ | ||
17 | |||
18 | |||
19 | VPATH = @srcdir@ | ||
20 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
21 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
22 | pkglibdir = $(libdir)/@PACKAGE@ | ||
23 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
24 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
25 | install_sh_DATA = $(install_sh) -c -m 644 | ||
26 | install_sh_PROGRAM = $(install_sh) -c | ||
27 | install_sh_SCRIPT = $(install_sh) -c | ||
28 | INSTALL_HEADER = $(INSTALL_DATA) | ||
29 | transform = $(program_transform_name) | ||
30 | NORMAL_INSTALL = : | ||
31 | PRE_INSTALL = : | ||
32 | POST_INSTALL = : | ||
33 | NORMAL_UNINSTALL = : | ||
34 | PRE_UNINSTALL = : | ||
35 | POST_UNINSTALL = : | ||
36 | build_triplet = @build@ | ||
37 | host_triplet = @host@ | ||
38 | subdir = src/modules/engines/wayland_egl | ||
39 | DIST_COMMON = $(am__includes_HEADERS_DIST) $(srcdir)/Makefile.am \ | ||
40 | $(srcdir)/Makefile.in | ||
41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
42 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
43 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
44 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
45 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
46 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
47 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
48 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
49 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
50 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
51 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
52 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
53 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
54 | $(top_srcdir)/configure.ac | ||
55 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
56 | $(ACLOCAL_M4) | ||
57 | mkinstalldirs = $(install_sh) -d | ||
58 | CONFIG_HEADER = $(top_builddir)/config.h | ||
59 | CONFIG_CLEAN_FILES = | ||
60 | CONFIG_CLEAN_VPATH_FILES = | ||
61 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
62 | am__vpath_adj = case $$p in \ | ||
63 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
64 | *) f=$$p;; \ | ||
65 | esac; | ||
66 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
67 | am__install_max = 40 | ||
68 | am__nobase_strip_setup = \ | ||
69 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
70 | am__nobase_strip = \ | ||
71 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
72 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
73 | for p in $$list; do echo "$$p $$p"; done | \ | ||
74 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
75 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
76 | if (++n[$$2] == $(am__install_max)) \ | ||
77 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
78 | END { for (dir in files) print dir, files[dir] }' | ||
79 | am__base_list = \ | ||
80 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
81 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
82 | am__installdirs = "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)" | ||
83 | LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkg_LTLIBRARIES) | ||
84 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@am__DEPENDENCIES_1 = $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la | ||
85 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_TRUE@libevas_engine_wayland_egl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
86 | am__libevas_engine_wayland_egl_la_SOURCES_DIST = evas_engine.c \ | ||
87 | evas_wl_main.c | ||
88 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@am__objects_1 = evas_engine.lo \ | ||
89 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@ evas_wl_main.lo | ||
90 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_TRUE@am_libevas_engine_wayland_egl_la_OBJECTS = $(am__objects_1) | ||
91 | libevas_engine_wayland_egl_la_OBJECTS = \ | ||
92 | $(am_libevas_engine_wayland_egl_la_OBJECTS) | ||
93 | AM_V_lt = $(am__v_lt_$(V)) | ||
94 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
95 | am__v_lt_0 = --silent | ||
96 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_TRUE@am_libevas_engine_wayland_egl_la_rpath = | ||
97 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@module_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ | ||
98 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@ $(top_builddir)/src/lib/libevas.la | ||
99 | am__module_la_SOURCES_DIST = evas_engine.c evas_wl_main.c | ||
100 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@am__objects_2 = \ | ||
101 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@ module_la-evas_engine.lo \ | ||
102 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@ module_la-evas_wl_main.lo | ||
103 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@am_module_la_OBJECTS = $(am__objects_2) | ||
104 | module_la_OBJECTS = $(am_module_la_OBJECTS) | ||
105 | module_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | ||
106 | $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | ||
107 | $(AM_CFLAGS) $(CFLAGS) $(module_la_LDFLAGS) $(LDFLAGS) -o $@ | ||
108 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@am_module_la_rpath = -rpath \ | ||
109 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@ $(pkgdir) | ||
110 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
111 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
112 | am__depfiles_maybe = depfiles | ||
113 | am__mv = mv -f | ||
114 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
115 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
116 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
117 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
118 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
119 | $(AM_CFLAGS) $(CFLAGS) | ||
120 | AM_V_CC = $(am__v_CC_$(V)) | ||
121 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
122 | am__v_CC_0 = @echo " CC " $@; | ||
123 | AM_V_at = $(am__v_at_$(V)) | ||
124 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
125 | am__v_at_0 = @ | ||
126 | CCLD = $(CC) | ||
127 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
128 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
129 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
130 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
131 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
132 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
133 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
134 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
135 | am__v_GEN_0 = @echo " GEN " $@; | ||
136 | SOURCES = $(libevas_engine_wayland_egl_la_SOURCES) \ | ||
137 | $(module_la_SOURCES) | ||
138 | DIST_SOURCES = $(am__libevas_engine_wayland_egl_la_SOURCES_DIST) \ | ||
139 | $(am__module_la_SOURCES_DIST) | ||
140 | am__includes_HEADERS_DIST = Evas_Engine_Wayland_Egl.h | ||
141 | HEADERS = $(includes_HEADERS) | ||
142 | ETAGS = etags | ||
143 | CTAGS = ctags | ||
144 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
145 | ACLOCAL = @ACLOCAL@ | ||
146 | ALLOCA = @ALLOCA@ | ||
147 | AMTAR = @AMTAR@ | ||
148 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
149 | AR = @AR@ | ||
150 | AS = @AS@ | ||
151 | AUTOCONF = @AUTOCONF@ | ||
152 | AUTOHEADER = @AUTOHEADER@ | ||
153 | AUTOMAKE = @AUTOMAKE@ | ||
154 | AWK = @AWK@ | ||
155 | CC = @CC@ | ||
156 | CCDEPMODE = @CCDEPMODE@ | ||
157 | CFLAGS = @CFLAGS@ | ||
158 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
159 | CHECK_LIBS = @CHECK_LIBS@ | ||
160 | CPP = @CPP@ | ||
161 | CPPFLAGS = @CPPFLAGS@ | ||
162 | CXX = @CXX@ | ||
163 | CXXCPP = @CXXCPP@ | ||
164 | CXXDEPMODE = @CXXDEPMODE@ | ||
165 | CXXFLAGS = @CXXFLAGS@ | ||
166 | CYGPATH_W = @CYGPATH_W@ | ||
167 | DEFS = @DEFS@ | ||
168 | DEPDIR = @DEPDIR@ | ||
169 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
170 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
171 | DLLTOOL = @DLLTOOL@ | ||
172 | DSYMUTIL = @DSYMUTIL@ | ||
173 | DUMPBIN = @DUMPBIN@ | ||
174 | ECHO_C = @ECHO_C@ | ||
175 | ECHO_N = @ECHO_N@ | ||
176 | ECHO_T = @ECHO_T@ | ||
177 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
178 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
179 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
180 | EDB_LIBS = @EDB_LIBS@ | ||
181 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
182 | EDJE_LIBS = @EDJE_LIBS@ | ||
183 | EET_CFLAGS = @EET_CFLAGS@ | ||
184 | EET_LIBS = @EET_LIBS@ | ||
185 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
186 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
187 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
188 | EGREP = @EGREP@ | ||
189 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
190 | EINA_LIBS = @EINA_LIBS@ | ||
191 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
192 | EVAS_LIBS = @EVAS_LIBS@ | ||
193 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
194 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
195 | EVIL_LIBS = @EVIL_LIBS@ | ||
196 | EXEEXT = @EXEEXT@ | ||
197 | FGREP = @FGREP@ | ||
198 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
199 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
200 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
201 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
202 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
203 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
204 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
205 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
206 | GREP = @GREP@ | ||
207 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
208 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
209 | INSTALL = @INSTALL@ | ||
210 | INSTALL_DATA = @INSTALL_DATA@ | ||
211 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
212 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
213 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
214 | LD = @LD@ | ||
215 | LDFLAGS = @LDFLAGS@ | ||
216 | LIBOBJS = @LIBOBJS@ | ||
217 | LIBS = @LIBS@ | ||
218 | LIBTOOL = @LIBTOOL@ | ||
219 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
220 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
221 | LIPO = @LIPO@ | ||
222 | LN_S = @LN_S@ | ||
223 | LTLIBOBJS = @LTLIBOBJS@ | ||
224 | MAKEINFO = @MAKEINFO@ | ||
225 | MKDIR_P = @MKDIR_P@ | ||
226 | MODULE_ARCH = @MODULE_ARCH@ | ||
227 | NM = @NM@ | ||
228 | NMEDIT = @NMEDIT@ | ||
229 | OBJC = @OBJC@ | ||
230 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
231 | OBJCFLAGS = @OBJCFLAGS@ | ||
232 | OBJDUMP = @OBJDUMP@ | ||
233 | OBJEXT = @OBJEXT@ | ||
234 | OTOOL = @OTOOL@ | ||
235 | OTOOL64 = @OTOOL64@ | ||
236 | PACKAGE = @PACKAGE@ | ||
237 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
238 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
239 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
240 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
241 | PACKAGE_URL = @PACKAGE_URL@ | ||
242 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
243 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
245 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
246 | PKG_CONFIG = @PKG_CONFIG@ | ||
247 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
248 | PNG_LIBS = @PNG_LIBS@ | ||
249 | RANLIB = @RANLIB@ | ||
250 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
251 | SDL_LIBS = @SDL_LIBS@ | ||
252 | SED = @SED@ | ||
253 | SET_MAKE = @SET_MAKE@ | ||
254 | SHELL = @SHELL@ | ||
255 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
256 | STRIP = @STRIP@ | ||
257 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
258 | SVG_LIBS = @SVG_LIBS@ | ||
259 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
260 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
261 | VERSION = @VERSION@ | ||
262 | VMAJ = @VMAJ@ | ||
263 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
264 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
265 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
267 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
268 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
269 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
270 | XCB_LIBS = @XCB_LIBS@ | ||
271 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
272 | XEXT_LIBS = @XEXT_LIBS@ | ||
273 | XMKMF = @XMKMF@ | ||
274 | X_CFLAGS = @X_CFLAGS@ | ||
275 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
276 | X_LIBS = @X_LIBS@ | ||
277 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
278 | abs_builddir = @abs_builddir@ | ||
279 | abs_srcdir = @abs_srcdir@ | ||
280 | abs_top_builddir = @abs_top_builddir@ | ||
281 | abs_top_srcdir = @abs_top_srcdir@ | ||
282 | ac_ct_CC = @ac_ct_CC@ | ||
283 | ac_ct_CXX = @ac_ct_CXX@ | ||
284 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
285 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
286 | altivec_cflags = @altivec_cflags@ | ||
287 | am__include = @am__include@ | ||
288 | am__leading_dot = @am__leading_dot@ | ||
289 | am__quote = @am__quote@ | ||
290 | am__tar = @am__tar@ | ||
291 | am__untar = @am__untar@ | ||
292 | bindir = @bindir@ | ||
293 | build = @build@ | ||
294 | build_alias = @build_alias@ | ||
295 | build_cpu = @build_cpu@ | ||
296 | build_os = @build_os@ | ||
297 | build_vendor = @build_vendor@ | ||
298 | builddir = @builddir@ | ||
299 | datadir = @datadir@ | ||
300 | datarootdir = @datarootdir@ | ||
301 | dlopen_libs = @dlopen_libs@ | ||
302 | docdir = @docdir@ | ||
303 | dvidir = @dvidir@ | ||
304 | edje_cc = @edje_cc@ | ||
305 | efl_doxygen = @efl_doxygen@ | ||
306 | efl_have_doxygen = @efl_have_doxygen@ | ||
307 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
308 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
309 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
310 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
311 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
312 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
313 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
314 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
315 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
316 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
317 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
318 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
319 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
320 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
321 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
322 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
323 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
324 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
325 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
326 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
327 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
328 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
329 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
330 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
331 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
332 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
333 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
334 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
335 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
336 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
337 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
338 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
339 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
340 | evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ | ||
341 | evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ | ||
342 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
346 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
347 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
348 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
349 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
350 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
351 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
352 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
353 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
354 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
355 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
356 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
357 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
358 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
359 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
360 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
361 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
362 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
363 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
364 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
365 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
366 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
367 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
368 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
369 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
370 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
371 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
372 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
373 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
374 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
375 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
376 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
377 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
378 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
379 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
380 | exec_prefix = @exec_prefix@ | ||
381 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
382 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
383 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
384 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
385 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
386 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
387 | have_lcov = @have_lcov@ | ||
388 | host = @host@ | ||
389 | host_alias = @host_alias@ | ||
390 | host_cpu = @host_cpu@ | ||
391 | host_os = @host_os@ | ||
392 | host_vendor = @host_vendor@ | ||
393 | htmldir = @htmldir@ | ||
394 | includedir = @includedir@ | ||
395 | infodir = @infodir@ | ||
396 | install_sh = @install_sh@ | ||
397 | libdir = @libdir@ | ||
398 | libexecdir = @libexecdir@ | ||
399 | localedir = @localedir@ | ||
400 | localstatedir = @localstatedir@ | ||
401 | lt_ECHO = @lt_ECHO@ | ||
402 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
403 | mandir = @mandir@ | ||
404 | mkdir_p = @mkdir_p@ | ||
405 | oldincludedir = @oldincludedir@ | ||
406 | pdfdir = @pdfdir@ | ||
407 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
408 | prefix = @prefix@ | ||
409 | program_transform_name = @program_transform_name@ | ||
410 | psdir = @psdir@ | ||
411 | pthread_cflags = @pthread_cflags@ | ||
412 | pthread_libs = @pthread_libs@ | ||
413 | release_info = @release_info@ | ||
414 | requirement_evas = @requirement_evas@ | ||
415 | sbindir = @sbindir@ | ||
416 | sharedstatedir = @sharedstatedir@ | ||
417 | srcdir = @srcdir@ | ||
418 | sysconfdir = @sysconfdir@ | ||
419 | target_alias = @target_alias@ | ||
420 | top_build_prefix = @top_build_prefix@ | ||
421 | top_builddir = @top_builddir@ | ||
422 | top_srcdir = @top_srcdir@ | ||
423 | version_info = @version_info@ | ||
424 | MAINTAINERCLEANFILES = Makefile.in | ||
425 | AM_CPPFLAGS = \ | ||
426 | -I. \ | ||
427 | -I$(top_srcdir)/src/lib \ | ||
428 | -I$(top_srcdir)/src/lib/include \ | ||
429 | -I$(top_srcdir)/src/modules/engines/gl_common \ | ||
430 | @FREETYPE_CFLAGS@ \ | ||
431 | @PIXMAN_CFLAGS@ \ | ||
432 | @EINA_CFLAGS@ \ | ||
433 | @GL_EET_CFLAGS@ \ | ||
434 | @evas_engine_wayland_egl_cflags@ | ||
435 | |||
436 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@WAYLAND_EGL_SOURCES = \ | ||
437 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@evas_engine.c \ | ||
438 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@evas_wl_main.c | ||
439 | |||
440 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@WAYLAND_EGL_LIBADD = @FREETYPE_LIBS@ @GL_EET_LIBS@ @EINA_LIBS@ @evas_engine_wayland_egl_libs@ $(top_builddir)/src/modules/engines/gl_common/libevas_engine_gl_common.la | ||
441 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@includes_HEADERS = Evas_Engine_Wayland_Egl.h | ||
442 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@includesdir = $(includedir)/evas-@VMAJ@ | ||
443 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@pkgdir = $(libdir)/evas/modules/engines/wayland_egl/$(MODULE_ARCH) | ||
444 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@pkg_LTLIBRARIES = module.la | ||
445 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@module_la_SOURCES = $(WAYLAND_EGL_SOURCES) | ||
446 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@module_la_LIBADD = $(WAYLAND_EGL_LIBADD) $(top_builddir)/src/lib/libevas.la | ||
447 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@module_la_LDFLAGS = -no-undefined -module -avoid-version | ||
448 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_FALSE@module_la_LIBTOOLFLAGS = --tag=disable-static | ||
449 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_TRUE@noinst_LTLIBRARIES = libevas_engine_wayland_egl.la | ||
450 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_TRUE@libevas_engine_wayland_egl_la_SOURCES = $(WAYLAND_EGL_SOURCES) | ||
451 | @BUILD_ENGINE_WAYLAND_EGL_TRUE@@EVAS_STATIC_BUILD_WAYLAND_EGL_TRUE@libevas_engine_wayland_egl_la_LIBADD = $(WAYLAND_EGL_LIBADD) | ||
452 | EXTRA_DIST = evas_engine.h | ||
453 | all: all-am | ||
454 | |||
455 | .SUFFIXES: | ||
456 | .SUFFIXES: .c .lo .o .obj | ||
457 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
458 | @for dep in $?; do \ | ||
459 | case '$(am__configure_deps)' in \ | ||
460 | *$$dep*) \ | ||
461 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
462 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
463 | exit 1;; \ | ||
464 | esac; \ | ||
465 | done; \ | ||
466 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/engines/wayland_egl/Makefile'; \ | ||
467 | $(am__cd) $(top_srcdir) && \ | ||
468 | $(AUTOMAKE) --gnu src/modules/engines/wayland_egl/Makefile | ||
469 | .PRECIOUS: Makefile | ||
470 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
471 | @case '$?' in \ | ||
472 | *config.status*) \ | ||
473 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
474 | *) \ | ||
475 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
476 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
477 | esac; | ||
478 | |||
479 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
480 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
481 | |||
482 | $(top_srcdir)/configure: $(am__configure_deps) | ||
483 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
484 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
485 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
486 | $(am__aclocal_m4_deps): | ||
487 | |||
488 | clean-noinstLTLIBRARIES: | ||
489 | -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) | ||
490 | @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ | ||
491 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
492 | test "$$dir" != "$$p" || dir=.; \ | ||
493 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
494 | rm -f "$${dir}/so_locations"; \ | ||
495 | done | ||
496 | install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES) | ||
497 | @$(NORMAL_INSTALL) | ||
498 | test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)" | ||
499 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
500 | list2=; for p in $$list; do \ | ||
501 | if test -f $$p; then \ | ||
502 | list2="$$list2 $$p"; \ | ||
503 | else :; fi; \ | ||
504 | done; \ | ||
505 | test -z "$$list2" || { \ | ||
506 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \ | ||
507 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \ | ||
508 | } | ||
509 | |||
510 | uninstall-pkgLTLIBRARIES: | ||
511 | @$(NORMAL_UNINSTALL) | ||
512 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
513 | for p in $$list; do \ | ||
514 | $(am__strip_dir) \ | ||
515 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \ | ||
516 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \ | ||
517 | done | ||
518 | |||
519 | clean-pkgLTLIBRARIES: | ||
520 | -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES) | ||
521 | @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \ | ||
522 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
523 | test "$$dir" != "$$p" || dir=.; \ | ||
524 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
525 | rm -f "$${dir}/so_locations"; \ | ||
526 | done | ||
527 | libevas_engine_wayland_egl.la: $(libevas_engine_wayland_egl_la_OBJECTS) $(libevas_engine_wayland_egl_la_DEPENDENCIES) | ||
528 | $(AM_V_CCLD)$(LINK) $(am_libevas_engine_wayland_egl_la_rpath) $(libevas_engine_wayland_egl_la_OBJECTS) $(libevas_engine_wayland_egl_la_LIBADD) $(LIBS) | ||
529 | module.la: $(module_la_OBJECTS) $(module_la_DEPENDENCIES) | ||
530 | $(AM_V_CCLD)$(module_la_LINK) $(am_module_la_rpath) $(module_la_OBJECTS) $(module_la_LIBADD) $(LIBS) | ||
531 | |||
532 | mostlyclean-compile: | ||
533 | -rm -f *.$(OBJEXT) | ||
534 | |||
535 | distclean-compile: | ||
536 | -rm -f *.tab.c | ||
537 | |||
538 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_engine.Plo@am__quote@ | ||
539 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_wl_main.Plo@am__quote@ | ||
540 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_engine.Plo@am__quote@ | ||
541 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_wl_main.Plo@am__quote@ | ||
542 | |||
543 | .c.o: | ||
544 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
545 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
546 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
547 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
548 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
549 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
550 | |||
551 | .c.obj: | ||
552 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
553 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
554 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
555 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
556 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
557 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
558 | |||
559 | .c.lo: | ||
560 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
561 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
562 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
563 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
564 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
565 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
566 | |||
567 | module_la-evas_engine.lo: evas_engine.c | ||
568 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_engine.lo -MD -MP -MF $(DEPDIR)/module_la-evas_engine.Tpo -c -o module_la-evas_engine.lo `test -f 'evas_engine.c' || echo '$(srcdir)/'`evas_engine.c | ||
569 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_engine.Tpo $(DEPDIR)/module_la-evas_engine.Plo | ||
570 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
571 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_engine.c' object='module_la-evas_engine.lo' libtool=yes @AMDEPBACKSLASH@ | ||
572 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
573 | @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_engine.lo `test -f 'evas_engine.c' || echo '$(srcdir)/'`evas_engine.c | ||
574 | |||
575 | module_la-evas_wl_main.lo: evas_wl_main.c | ||
576 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_wl_main.lo -MD -MP -MF $(DEPDIR)/module_la-evas_wl_main.Tpo -c -o module_la-evas_wl_main.lo `test -f 'evas_wl_main.c' || echo '$(srcdir)/'`evas_wl_main.c | ||
577 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_wl_main.Tpo $(DEPDIR)/module_la-evas_wl_main.Plo | ||
578 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
579 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_wl_main.c' object='module_la-evas_wl_main.lo' libtool=yes @AMDEPBACKSLASH@ | ||
580 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
581 | @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_wl_main.lo `test -f 'evas_wl_main.c' || echo '$(srcdir)/'`evas_wl_main.c | ||
582 | |||
583 | mostlyclean-libtool: | ||
584 | -rm -f *.lo | ||
585 | |||
586 | clean-libtool: | ||
587 | -rm -rf .libs _libs | ||
588 | install-includesHEADERS: $(includes_HEADERS) | ||
589 | @$(NORMAL_INSTALL) | ||
590 | test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)" | ||
591 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
592 | for p in $$list; do \ | ||
593 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
594 | echo "$$d$$p"; \ | ||
595 | done | $(am__base_list) | \ | ||
596 | while read files; do \ | ||
597 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \ | ||
598 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \ | ||
599 | done | ||
600 | |||
601 | uninstall-includesHEADERS: | ||
602 | @$(NORMAL_UNINSTALL) | ||
603 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
604 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
605 | test -n "$$files" || exit 0; \ | ||
606 | echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \ | ||
607 | cd "$(DESTDIR)$(includesdir)" && rm -f $$files | ||
608 | |||
609 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
610 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
611 | unique=`for i in $$list; do \ | ||
612 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
613 | done | \ | ||
614 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
615 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
616 | mkid -fID $$unique | ||
617 | tags: TAGS | ||
618 | |||
619 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
620 | $(TAGS_FILES) $(LISP) | ||
621 | set x; \ | ||
622 | here=`pwd`; \ | ||
623 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
624 | unique=`for i in $$list; do \ | ||
625 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
626 | done | \ | ||
627 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
628 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
629 | shift; \ | ||
630 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
631 | test -n "$$unique" || unique=$$empty_fix; \ | ||
632 | if test $$# -gt 0; then \ | ||
633 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
634 | "$$@" $$unique; \ | ||
635 | else \ | ||
636 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
637 | $$unique; \ | ||
638 | fi; \ | ||
639 | fi | ||
640 | ctags: CTAGS | ||
641 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
642 | $(TAGS_FILES) $(LISP) | ||
643 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
644 | unique=`for i in $$list; do \ | ||
645 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
646 | done | \ | ||
647 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
648 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
649 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
650 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
651 | $$unique | ||
652 | |||
653 | GTAGS: | ||
654 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
655 | && $(am__cd) $(top_srcdir) \ | ||
656 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
657 | |||
658 | distclean-tags: | ||
659 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
660 | |||
661 | distdir: $(DISTFILES) | ||
662 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
663 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
664 | list='$(DISTFILES)'; \ | ||
665 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
666 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
667 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
668 | case $$dist_files in \ | ||
669 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
670 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
671 | sort -u` ;; \ | ||
672 | esac; \ | ||
673 | for file in $$dist_files; do \ | ||
674 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
675 | if test -d $$d/$$file; then \ | ||
676 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
677 | if test -d "$(distdir)/$$file"; then \ | ||
678 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
679 | fi; \ | ||
680 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
681 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
682 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
683 | fi; \ | ||
684 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
685 | else \ | ||
686 | test -f "$(distdir)/$$file" \ | ||
687 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
688 | || exit 1; \ | ||
689 | fi; \ | ||
690 | done | ||
691 | check-am: all-am | ||
692 | check: check-am | ||
693 | all-am: Makefile $(LTLIBRARIES) $(HEADERS) | ||
694 | installdirs: | ||
695 | for dir in "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)"; do \ | ||
696 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
697 | done | ||
698 | install: install-am | ||
699 | install-exec: install-exec-am | ||
700 | install-data: install-data-am | ||
701 | uninstall: uninstall-am | ||
702 | |||
703 | install-am: all-am | ||
704 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
705 | |||
706 | installcheck: installcheck-am | ||
707 | install-strip: | ||
708 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
709 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
710 | `test -z '$(STRIP)' || \ | ||
711 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
712 | mostlyclean-generic: | ||
713 | |||
714 | clean-generic: | ||
715 | |||
716 | distclean-generic: | ||
717 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
718 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
719 | |||
720 | maintainer-clean-generic: | ||
721 | @echo "This command is intended for maintainers to use" | ||
722 | @echo "it deletes files that may require special tools to rebuild." | ||
723 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
724 | clean: clean-am | ||
725 | |||
726 | clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ | ||
727 | clean-pkgLTLIBRARIES mostlyclean-am | ||
728 | |||
729 | distclean: distclean-am | ||
730 | -rm -rf ./$(DEPDIR) | ||
731 | -rm -f Makefile | ||
732 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
733 | distclean-tags | ||
734 | |||
735 | dvi: dvi-am | ||
736 | |||
737 | dvi-am: | ||
738 | |||
739 | html: html-am | ||
740 | |||
741 | html-am: | ||
742 | |||
743 | info: info-am | ||
744 | |||
745 | info-am: | ||
746 | |||
747 | install-data-am: install-includesHEADERS install-pkgLTLIBRARIES | ||
748 | |||
749 | install-dvi: install-dvi-am | ||
750 | |||
751 | install-dvi-am: | ||
752 | |||
753 | install-exec-am: | ||
754 | |||
755 | install-html: install-html-am | ||
756 | |||
757 | install-html-am: | ||
758 | |||
759 | install-info: install-info-am | ||
760 | |||
761 | install-info-am: | ||
762 | |||
763 | install-man: | ||
764 | |||
765 | install-pdf: install-pdf-am | ||
766 | |||
767 | install-pdf-am: | ||
768 | |||
769 | install-ps: install-ps-am | ||
770 | |||
771 | install-ps-am: | ||
772 | |||
773 | installcheck-am: | ||
774 | |||
775 | maintainer-clean: maintainer-clean-am | ||
776 | -rm -rf ./$(DEPDIR) | ||
777 | -rm -f Makefile | ||
778 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
779 | |||
780 | mostlyclean: mostlyclean-am | ||
781 | |||
782 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
783 | mostlyclean-libtool | ||
784 | |||
785 | pdf: pdf-am | ||
786 | |||
787 | pdf-am: | ||
788 | |||
789 | ps: ps-am | ||
790 | |||
791 | ps-am: | ||
792 | |||
793 | uninstall-am: uninstall-includesHEADERS uninstall-pkgLTLIBRARIES | ||
794 | |||
795 | .MAKE: install-am install-strip | ||
796 | |||
797 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
798 | clean-libtool clean-noinstLTLIBRARIES clean-pkgLTLIBRARIES \ | ||
799 | ctags distclean distclean-compile distclean-generic \ | ||
800 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
801 | html-am info info-am install install-am install-data \ | ||
802 | install-data-am install-dvi install-dvi-am install-exec \ | ||
803 | install-exec-am install-html install-html-am \ | ||
804 | install-includesHEADERS install-info install-info-am \ | ||
805 | install-man install-pdf install-pdf-am install-pkgLTLIBRARIES \ | ||
806 | install-ps install-ps-am install-strip installcheck \ | ||
807 | installcheck-am installdirs maintainer-clean \ | ||
808 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
809 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
810 | tags uninstall uninstall-am uninstall-includesHEADERS \ | ||
811 | uninstall-pkgLTLIBRARIES | ||
812 | |||
813 | |||
814 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
815 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
816 | .NOEXPORT: | ||
diff --git a/libraries/evas/src/modules/engines/wayland_egl/evas_engine.c b/libraries/evas/src/modules/engines/wayland_egl/evas_engine.c new file mode 100644 index 0000000..d2a6a0d --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_egl/evas_engine.c | |||
@@ -0,0 +1,3174 @@ | |||
1 | #include "evas_common.h" /* Also includes international specific stuff */ | ||
2 | #include "evas_engine.h" | ||
3 | |||
4 | #ifdef HAVE_DLSYM | ||
5 | # include <dlfcn.h> /* dlopen,dlclose,etc */ | ||
6 | #else | ||
7 | # error gl_x11 should not get compiled if dlsym is not found on the system! | ||
8 | #endif | ||
9 | |||
10 | #define EVAS_GL_NO_GL_H_CHECK 1 | ||
11 | #include "Evas_GL.h" | ||
12 | |||
13 | typedef struct _Render_Engine Render_Engine; | ||
14 | typedef struct _Render_Engine_GL_Surface Render_Engine_GL_Surface; | ||
15 | typedef struct _Render_Engine_GL_Context Render_Engine_GL_Context; | ||
16 | typedef struct _Render_Engine_GL_Resource Render_Engine_GL_Resource; | ||
17 | typedef struct _Extension_Entry Extension_Entry; | ||
18 | |||
19 | struct _Render_Engine | ||
20 | { | ||
21 | Evas_GL_Wl_Window *win; | ||
22 | Evas_Engine_Info_Wayland_Egl *info; | ||
23 | Evas *evas; | ||
24 | Tilebuf *tb; | ||
25 | int end; | ||
26 | int w, h; | ||
27 | int vsync; | ||
28 | |||
29 | }; | ||
30 | |||
31 | struct _Render_Engine_GL_Surface | ||
32 | { | ||
33 | int initialized; | ||
34 | int fbo_attached; | ||
35 | int w, h; | ||
36 | int depth_bits; | ||
37 | int stencil_bits; | ||
38 | |||
39 | // Render target texture/buffers | ||
40 | GLuint rt_tex; | ||
41 | GLint rt_internal_fmt; | ||
42 | GLenum rt_fmt; | ||
43 | GLuint rb_depth; | ||
44 | GLenum rb_depth_fmt; | ||
45 | GLuint rb_stencil; | ||
46 | GLenum rb_stencil_fmt; | ||
47 | |||
48 | Render_Engine_GL_Context *current_ctx; | ||
49 | }; | ||
50 | |||
51 | struct _Render_Engine_GL_Context | ||
52 | { | ||
53 | int initialized; | ||
54 | EGLContext context; | ||
55 | GLuint context_fbo; | ||
56 | GLuint current_fbo; | ||
57 | |||
58 | Render_Engine_GL_Surface *current_sfc; | ||
59 | }; | ||
60 | |||
61 | // Resources used per thread | ||
62 | struct _Render_Engine_GL_Resource | ||
63 | { | ||
64 | // Resource context/surface per Thread in TLS for evasgl use | ||
65 | EGLContext context; | ||
66 | EGLSurface surface; | ||
67 | }; | ||
68 | |||
69 | // Extension Handling | ||
70 | struct _Extension_Entry | ||
71 | { | ||
72 | const char *name; | ||
73 | const char *real_name; | ||
74 | int supported; | ||
75 | }; | ||
76 | |||
77 | static int initted = 0; | ||
78 | static int gl_wins = 0; | ||
79 | static Render_Engine_GL_Context *current_evgl_ctx; | ||
80 | static Render_Engine *current_engine; | ||
81 | |||
82 | static char _gl_ext_string[1024]; | ||
83 | static char _evasgl_ext_string[1024]; | ||
84 | |||
85 | // Resource context/surface per Thread in TLS for evasgl use | ||
86 | static Eina_TLS resource_key; | ||
87 | static Eina_List *resource_list; | ||
88 | LK(resource_lock); | ||
89 | |||
90 | typedef void (*_eng_fn) (void); | ||
91 | typedef _eng_fn (*glsym_func_eng_fn) (); | ||
92 | typedef void (*glsym_func_void) (); | ||
93 | typedef void *(*glsym_func_void_ptr) (); | ||
94 | typedef int (*glsym_func_int) (); | ||
95 | typedef unsigned int (*glsym_func_uint) (); | ||
96 | typedef unsigned char (*glsym_func_uchar) (); | ||
97 | typedef unsigned char *(*glsym_func_uchar_ptr) (); | ||
98 | typedef const char *(*glsym_func_const_char_ptr) (); | ||
99 | |||
100 | #ifndef EGL_NATIVE_PIXMAP_KHR | ||
101 | # define EGL_NATIVE_PIXMAP_KHR 0x30b0 | ||
102 | #endif | ||
103 | _eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL; | ||
104 | void (*glsym_eglBindTexImage) (EGLDisplay a, EGLSurface b, int c) = NULL; | ||
105 | void (*glsym_eglReleaseTexImage) (EGLDisplay a, EGLSurface b, int c) = NULL; | ||
106 | void *(*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e) = NULL; | ||
107 | void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL; | ||
108 | void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL; | ||
109 | void (*glsym_glEGLImageTargetRenderbufferStorageOES) (int a, void *b) = NULL; | ||
110 | void *(*glsym_eglMapImageSEC) (void *a, void *b) = NULL; | ||
111 | unsigned int (*glsym_eglUnmapImageSEC) (void *a, void *b) = NULL; | ||
112 | const char *(*glsym_eglQueryString) (EGLDisplay a, int name) = NULL; | ||
113 | |||
114 | unsigned int (*glsym_eglLockSurface) (EGLDisplay a, EGLSurface b, const int *attrib_list) = NULL; | ||
115 | unsigned int (*glsym_eglUnlockSurface) (EGLDisplay a, EGLSurface b) = NULL; | ||
116 | |||
117 | // GLES2 Extensions | ||
118 | void (*glsym_glGetProgramBinaryOES) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) = NULL; | ||
119 | void (*glsym_glProgramBinaryOES) (GLuint program, GLenum binaryFormat, const void *binary, GLint length) = NULL; | ||
120 | void* (*glsym_glMapBufferOES) (GLenum target, GLenum access) = NULL; | ||
121 | unsigned char (*glsym_glUnmapBufferOES) (GLenum target) = NULL; | ||
122 | void (*glsym_glGetBufferPointervOES) (GLenum target, GLenum pname, void** params) = NULL; | ||
123 | void (*glsym_glTexImage3DOES) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) = NULL; | ||
124 | void (*glsym_glTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) = NULL; | ||
125 | void (*glsym_glCopyTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) = NULL; | ||
126 | void (*glsym_glCompressedTexImage3DOES) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) = NULL; | ||
127 | void (*glsym_glCompressedTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) = NULL; | ||
128 | void (*glsym_glFramebufferTexture3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) = NULL; | ||
129 | void (*glsym_glGetPerfMonitorGroupsAMD) (GLint* numGroups, GLsizei groupsSize, GLuint* groups) = NULL; | ||
130 | void (*glsym_glGetPerfMonitorCountersAMD) (GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters) = NULL; | ||
131 | void (*glsym_glGetPerfMonitorGroupStringAMD) (GLuint group, GLsizei bufSize, GLsizei* length, char* groupString) = NULL; | ||
132 | void (*glsym_glGetPerfMonitorCounterStringAMD) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString) = NULL; | ||
133 | void (*glsym_glGetPerfMonitorCounterInfoAMD) (GLuint group, GLuint counter, GLenum pname, void* data) = NULL; | ||
134 | void (*glsym_glGenPerfMonitorsAMD) (GLsizei n, GLuint* monitors) = NULL; | ||
135 | void (*glsym_glDeletePerfMonitorsAMD) (GLsizei n, GLuint* monitors) = NULL; | ||
136 | void (*glsym_glSelectPerfMonitorCountersAMD) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList) = NULL; | ||
137 | void (*glsym_glBeginPerfMonitorAMD) (GLuint monitor) = NULL; | ||
138 | void (*glsym_glEndPerfMonitorAMD) (GLuint monitor) = NULL; | ||
139 | void (*glsym_glGetPerfMonitorCounterDataAMD) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten) = NULL; | ||
140 | void (*glsym_glDiscardFramebufferEXT) (GLenum target, GLsizei numAttachments, const GLenum* attachments) = NULL; | ||
141 | void (*glsym_glMultiDrawArraysEXT) (GLenum mode, GLint* first, GLsizei* count, GLsizei primcount) = NULL; | ||
142 | void (*glsym_glMultiDrawElementsEXT) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount) = NULL; | ||
143 | void (*glsym_glDeleteFencesNV) (GLsizei n, const GLuint* fences) = NULL; | ||
144 | void (*glsym_glGenFencesNV) (GLsizei n, GLuint* fences) = NULL; | ||
145 | unsigned char (*glsym_glIsFenceNV) (GLuint fence) = NULL; | ||
146 | unsigned char (*glsym_glTestFenceNV) (GLuint fence) = NULL; | ||
147 | void (*glsym_glGetFenceivNV) (GLuint fence, GLenum pname, GLint* params) = NULL; | ||
148 | void (*glsym_glFinishFenceNV) (GLuint fence) = NULL; | ||
149 | void (*glsym_glSetFenceNV) (GLuint, GLenum) = NULL; | ||
150 | void (*glsym_glGetDriverControlsQCOM) (GLint* num, GLsizei size, GLuint* driverControls) = NULL; | ||
151 | void (*glsym_glGetDriverControlStringQCOM) (GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString) = NULL; | ||
152 | void (*glsym_glEnableDriverControlQCOM) (GLuint driverControl) = NULL; | ||
153 | void (*glsym_glDisableDriverControlQCOM) (GLuint driverControl) = NULL; | ||
154 | void (*glsym_glExtGetTexturesQCOM) (GLuint* textures, GLint maxTextures, GLint* numTextures) = NULL; | ||
155 | void (*glsym_glExtGetBuffersQCOM) (GLuint* buffers, GLint maxBuffers, GLint* numBuffers) = NULL; | ||
156 | void (*glsym_glExtGetRenderbuffersQCOM) (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers) = NULL; | ||
157 | void (*glsym_glExtGetFramebuffersQCOM) (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers) = NULL; | ||
158 | void (*glsym_glExtGetTexLevelParameterivQCOM) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params) = NULL; | ||
159 | void (*glsym_glExtTexObjectStateOverrideiQCOM) (GLenum target, GLenum pname, GLint param) = NULL; | ||
160 | void (*glsym_glExtGetTexSubImageQCOM) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels) = NULL; | ||
161 | void (*glsym_glExtGetBufferPointervQCOM) (GLenum target, void** params) = NULL; | ||
162 | void (*glsym_glExtGetShadersQCOM) (GLuint* shaders, GLint maxShaders, GLint* numShaders) = NULL; | ||
163 | void (*glsym_glExtGetProgramsQCOM) (GLuint* programs, GLint maxPrograms, GLint* numPrograms) = NULL; | ||
164 | unsigned char (*glsym_glExtIsProgramBinaryQCOM) (GLuint program) = NULL; | ||
165 | void (*glsym_glExtGetProgramBinarySourceQCOM) (GLuint program, GLenum shadertype, char* source, GLint* length) = NULL; | ||
166 | |||
167 | |||
168 | //------ GLES 2.0 Extensions supported in EvasGL -----// | ||
169 | static Extension_Entry _gl_ext_entries[] = { | ||
170 | //--- Function Extensions ---// | ||
171 | { "GL_OES_get_program_binary", "get_program_binary", 0 }, | ||
172 | { "GL_OES_mapbuffer", "mapbuffer", 0 }, | ||
173 | { "GL_OES_texture_3D", "texture_3D", 0 }, | ||
174 | { "AMD_performance_monitor", "AMD_performance_monitor", 0 }, | ||
175 | { "GL_EXT_discard_framebuffer", "discard_framebuffer", 0 }, | ||
176 | { "GL_EXT_multi_draw_arrays", "multi_draw_arrays", 0 }, | ||
177 | { "GL_NV_fence", "NV_fence", 0 }, | ||
178 | { "GL_QCOM_driver_control", "QCOM_driver_control", 0 }, | ||
179 | { "GL_QCOM_extended_get", "QCOM_extended_get", 0 }, | ||
180 | { "GL_QCOM_extended_get2", "QCOM_extended_get2", 0 }, | ||
181 | |||
182 | //--- Define Extensions ---// | ||
183 | { "GL_OES_compressed_ETC1_RGB8_texture", "compressed_ETC1_RGB8_texture", 0 }, | ||
184 | { "GL_OES_compressed_paletted_texture", "compressed_paletted_texture", 0 }, | ||
185 | { "GL_OES_depth24", "depth24", 0 }, | ||
186 | { "GL_OES_depth32", "depth32", 0 }, | ||
187 | { "GL_OES_EvasGL_image", "EGL_image", 0 }, | ||
188 | { "GL_OES_packed_depth_stencil", "packed_depth_stencil", 0 }, | ||
189 | { "GL_OES_rgb8_rgba8", "rgb8_rgba8", 0 }, | ||
190 | { "GL_OES_standard_derivatives", "standard_derivatives", 0 }, | ||
191 | { "GL_OES_stencil1", "stencil1", 0 }, | ||
192 | { "GL_OES_stencil4", "stencil4", 0 }, | ||
193 | { "GL_OES_texture_float", "texture_float", 0 }, | ||
194 | { "GL_OES_texture_half_float", "texture_half_float", 0 }, | ||
195 | { "GL_OES_texture_half_float_linear", "texture_half_float_linear", 0 }, | ||
196 | { "GL_OES_texture_npot", "texture_npot", 0 }, | ||
197 | { "GL_OES_vertex_half_float", "vertex_half_float", 0 }, | ||
198 | { "GL_OES_vertex_type_10_10_10_2", "vertex_type_10_10_10_2", 0 }, | ||
199 | { "GL_AMD_compressed_3DC_texture", "compressed_3DC_texture", 0 }, | ||
200 | { "GL_AMD_compressed_ATC_texture", "compressed_ATC_texture", 0 }, | ||
201 | { "GL_AMD_program_binary_Z400", "program_binary_Z400", 0 }, | ||
202 | { "GL_EXT_blend_minmax", "blend_minmax", 0 }, | ||
203 | { "GL_EXT_read_format_bgra", "read_format_bgra", 0 }, | ||
204 | { "GL_EXT_texture_filter_anisotropic", "texture_filter_anisotrophic", 0 }, | ||
205 | { "GL_EXT_texture_format_BGRA8888", "texture_format_BGRA8888", 0 }, | ||
206 | { "GL_EXT_texture_type_2_10_10_10_REV", "texture_type_2_10_10_10_rev", 0 }, | ||
207 | { "GL_IMG_program_binary", "IMG_program_binary", 0 }, | ||
208 | { "GL_IMG_read_format", "IMG_read_format", 0 }, | ||
209 | { "GL_IMG_shader_binary", "IMG_shader_binary", 0 }, | ||
210 | { "GL_IMG_texture_compression_pvrtc", "IMG_texture_compression_pvrtc", 0 }, | ||
211 | { "GL_QCOM_perfmon_global_mode", "QCOM_perfmon_global_mode", 0 }, | ||
212 | { "GL_QCOM_writeonly_rendering", "QCOM_writeonly_rendering", 0 }, | ||
213 | { NULL, NULL, 0} | ||
214 | }; | ||
215 | |||
216 | //------ Extensions supported in EvasGL -----// | ||
217 | static Extension_Entry _evasgl_ext_entries[] = { | ||
218 | { "EvasGL_KHR_image", "EGL_KHR_image", 0 }, | ||
219 | { "EvasGL_KHR_vg_parent_image", "EGL_KHR_vg_parent_image", 0 }, | ||
220 | { "EvasGL_KHR_gl_texture_2D_image", "EGL_KHR_gl_texture_2D_image", 0 }, | ||
221 | { "EvasGL_KHR_gl_texture_cubemap_image", "EGL_KHR_gl_texture_cubemap_image", 0 }, | ||
222 | { "EvasGL_KHR_gl_texture_3D_image", "EGL_KHR_gl_texture_3D_image", 0 }, | ||
223 | { "EvasGL_KHR_gl_renderbuffer_image", "EGL_KHR_gl_renderbuffer_image", 0 }, | ||
224 | { NULL, NULL, 0 } | ||
225 | }; | ||
226 | |||
227 | static void | ||
228 | _sym_init(void) | ||
229 | { | ||
230 | static int done = 0; | ||
231 | |||
232 | if (done) return; | ||
233 | |||
234 | #define FINDSYM(dst, sym, typ) \ | ||
235 | if ((!dst) && (glsym_eglGetProcAddress)) dst = (typ)glsym_eglGetProcAddress(sym); \ | ||
236 | if (!dst) dst = (typ)dlsym(RTLD_DEFAULT, sym) | ||
237 | |||
238 | FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddress", glsym_func_eng_fn); | ||
239 | FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressEXT", glsym_func_eng_fn); | ||
240 | FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressARB", glsym_func_eng_fn); | ||
241 | FINDSYM(glsym_eglGetProcAddress, "eglGetProcAddressKHR", glsym_func_eng_fn); | ||
242 | |||
243 | FINDSYM(glsym_eglBindTexImage, "eglBindTexImage", glsym_func_void); | ||
244 | FINDSYM(glsym_eglBindTexImage, "eglBindTexImageEXT", glsym_func_void); | ||
245 | FINDSYM(glsym_eglBindTexImage, "eglBindTexImageARB", glsym_func_void); | ||
246 | FINDSYM(glsym_eglBindTexImage, "eglBindTexImageKHR", glsym_func_void); | ||
247 | |||
248 | FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImage", glsym_func_void); | ||
249 | FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImageEXT", glsym_func_void); | ||
250 | FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImageARB", glsym_func_void); | ||
251 | FINDSYM(glsym_eglReleaseTexImage, "eglReleaseTexImageKHR", glsym_func_void); | ||
252 | |||
253 | FINDSYM(glsym_eglCreateImage, "eglCreateImage", glsym_func_void_ptr); | ||
254 | FINDSYM(glsym_eglCreateImage, "eglCreateImageEXT", glsym_func_void_ptr); | ||
255 | FINDSYM(glsym_eglCreateImage, "eglCreateImageARB", glsym_func_void_ptr); | ||
256 | FINDSYM(glsym_eglCreateImage, "eglCreateImageKHR", glsym_func_void_ptr); | ||
257 | |||
258 | FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", glsym_func_void); | ||
259 | FINDSYM(glsym_eglDestroyImage, "eglDestroyImageEXT", glsym_func_void); | ||
260 | FINDSYM(glsym_eglDestroyImage, "eglDestroyImageARB", glsym_func_void); | ||
261 | FINDSYM(glsym_eglDestroyImage, "eglDestroyImageKHR", glsym_func_void); | ||
262 | |||
263 | FINDSYM(glsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES", glsym_func_void); | ||
264 | |||
265 | FINDSYM(glsym_glEGLImageTargetRenderbufferStorageOES, "glEGLImageTargetRenderbufferStorageOES", glsym_func_void); | ||
266 | |||
267 | FINDSYM(glsym_eglMapImageSEC, "eglMapImageSEC", glsym_func_void_ptr); | ||
268 | FINDSYM(glsym_eglUnmapImageSEC, "eglUnmapImageSEC", glsym_func_uint); | ||
269 | |||
270 | FINDSYM(glsym_eglQueryString, "eglQueryString", glsym_func_const_char_ptr); | ||
271 | |||
272 | FINDSYM(glsym_eglLockSurface, "eglLockSurface", glsym_func_uint); | ||
273 | FINDSYM(glsym_eglLockSurface, "eglLockSurfaceEXT", glsym_func_uint); | ||
274 | FINDSYM(glsym_eglLockSurface, "eglLockSurfaceARB", glsym_func_uint); | ||
275 | FINDSYM(glsym_eglLockSurface, "eglLockSurfaceKHR", glsym_func_uint); | ||
276 | |||
277 | FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurface", glsym_func_uint); | ||
278 | FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurfaceEXT", glsym_func_uint); | ||
279 | FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurfaceARB", glsym_func_uint); | ||
280 | FINDSYM(glsym_eglUnlockSurface, "eglUnlockSurfaceKHR", glsym_func_uint); | ||
281 | |||
282 | //----------- GLES 2.0 Extensions ------------// | ||
283 | // If the symbol's not found, they get set to NULL | ||
284 | // If one of the functions in the extension exists, the extension in supported | ||
285 | /* GL_OES_get_program_binary */ | ||
286 | FINDSYM(glsym_glGetProgramBinaryOES, "glGetProgramBinary", glsym_func_void); | ||
287 | FINDSYM(glsym_glGetProgramBinaryOES, "glGetProgramBinaryEXT", glsym_func_void); | ||
288 | FINDSYM(glsym_glGetProgramBinaryOES, "glGetProgramBinaryARB", glsym_func_void); | ||
289 | FINDSYM(glsym_glGetProgramBinaryOES, "glGetProgramBinaryOES", glsym_func_void); | ||
290 | |||
291 | FINDSYM(glsym_glProgramBinaryOES, "glProgramBinary", glsym_func_void); | ||
292 | FINDSYM(glsym_glProgramBinaryOES, "glProgramBinaryEXT", glsym_func_void); | ||
293 | FINDSYM(glsym_glProgramBinaryOES, "glProgramBinaryARB", glsym_func_void); | ||
294 | FINDSYM(glsym_glProgramBinaryOES, "glProgramBinaryOES", glsym_func_void); | ||
295 | |||
296 | // Check the first function to see if the extension is supported... | ||
297 | if (glsym_glGetProgramBinaryOES) _gl_ext_entries[0].supported = 1; | ||
298 | |||
299 | /* GL_OES_mapbuffer */ | ||
300 | FINDSYM(glsym_glMapBufferOES, "glMapBuffer", glsym_func_void_ptr); | ||
301 | FINDSYM(glsym_glMapBufferOES, "glMapBufferEXT", glsym_func_void_ptr); | ||
302 | FINDSYM(glsym_glMapBufferOES, "glMapBufferARB", glsym_func_void_ptr); | ||
303 | FINDSYM(glsym_glMapBufferOES, "glMapBufferOES", glsym_func_void_ptr); | ||
304 | |||
305 | FINDSYM(glsym_glUnmapBufferOES, "glUnmapBuffer", glsym_func_uchar); | ||
306 | FINDSYM(glsym_glUnmapBufferOES, "glUnmapBufferEXT", glsym_func_uchar); | ||
307 | FINDSYM(glsym_glUnmapBufferOES, "glUnmapBufferARB", glsym_func_uchar); | ||
308 | FINDSYM(glsym_glUnmapBufferOES, "glUnmapBufferOES", glsym_func_uchar); | ||
309 | |||
310 | FINDSYM(glsym_glGetBufferPointervOES, "glGetBufferPointerv", glsym_func_void); | ||
311 | FINDSYM(glsym_glGetBufferPointervOES, "glGetBufferPointervEXT", glsym_func_void); | ||
312 | FINDSYM(glsym_glGetBufferPointervOES, "glGetBufferPointervARB", glsym_func_void); | ||
313 | FINDSYM(glsym_glGetBufferPointervOES, "glGetBufferPointervOES", glsym_func_void); | ||
314 | |||
315 | if (glsym_glMapBufferOES) _gl_ext_entries[1].supported = 1; | ||
316 | |||
317 | /* GL_OES_texture_3D */ | ||
318 | FINDSYM(glsym_glTexImage3DOES, "glTexImage3D", glsym_func_void); | ||
319 | FINDSYM(glsym_glTexImage3DOES, "glTexImage3DEXT", glsym_func_void); | ||
320 | FINDSYM(glsym_glTexImage3DOES, "glTexImage3DARB", glsym_func_void); | ||
321 | FINDSYM(glsym_glTexImage3DOES, "glTexImage3DOES", glsym_func_void); | ||
322 | |||
323 | FINDSYM(glsym_glTexSubImage3DOES, "glTexSubImage3D", glsym_func_void); | ||
324 | FINDSYM(glsym_glTexSubImage3DOES, "glTexSubImage3DEXT", glsym_func_void); | ||
325 | FINDSYM(glsym_glTexSubImage3DOES, "glTexSubImage3DARB", glsym_func_void); | ||
326 | FINDSYM(glsym_glTexSubImage3DOES, "glTexSubImage3DOES", glsym_func_void); | ||
327 | |||
328 | FINDSYM(glsym_glCopyTexSubImage3DOES, "glCopyTexSubImage3D", glsym_func_void); | ||
329 | FINDSYM(glsym_glCopyTexSubImage3DOES, "glCopyTexSubImage3DARB", glsym_func_void); | ||
330 | FINDSYM(glsym_glCopyTexSubImage3DOES, "glCopyTexSubImage3DEXT", glsym_func_void); | ||
331 | FINDSYM(glsym_glCopyTexSubImage3DOES, "glCopyTexSubImage3DOES", glsym_func_void); | ||
332 | |||
333 | FINDSYM(glsym_glCompressedTexImage3DOES, "glCompressedTexImage3D", glsym_func_void); | ||
334 | FINDSYM(glsym_glCompressedTexImage3DOES, "glCompressedTexImage3DARB", glsym_func_void); | ||
335 | FINDSYM(glsym_glCompressedTexImage3DOES, "glCompressedTexImage3DEXT", glsym_func_void); | ||
336 | FINDSYM(glsym_glCompressedTexImage3DOES, "glCompressedTexImage3DOES", glsym_func_void); | ||
337 | |||
338 | FINDSYM(glsym_glCompressedTexSubImage3DOES, "glCompressedTexSubImage3D", glsym_func_void); | ||
339 | FINDSYM(glsym_glCompressedTexSubImage3DOES, "glCompressedTexSubImage3DARB", glsym_func_void); | ||
340 | FINDSYM(glsym_glCompressedTexSubImage3DOES, "glCompressedTexSubImage3DEXT", glsym_func_void); | ||
341 | FINDSYM(glsym_glCompressedTexSubImage3DOES, "glCompressedTexSubImage3DOES", glsym_func_void); | ||
342 | |||
343 | FINDSYM(glsym_glFramebufferTexture3DOES, "glFramebufferTexture3D", glsym_func_void); | ||
344 | FINDSYM(glsym_glFramebufferTexture3DOES, "glFramebufferTexture3DARB", glsym_func_void); | ||
345 | FINDSYM(glsym_glFramebufferTexture3DOES, "glFramebufferTexture3DEXT", glsym_func_void); | ||
346 | FINDSYM(glsym_glFramebufferTexture3DOES, "glFramebufferTexture3DOES", glsym_func_void); | ||
347 | |||
348 | if (glsym_glTexSubImage3DOES) _gl_ext_entries[2].supported = 1; | ||
349 | |||
350 | /* AMD_performance_monitor */ | ||
351 | FINDSYM(glsym_glGetPerfMonitorGroupsAMD, "glGetPerfMonitorGroupsAMD", glsym_func_void); | ||
352 | FINDSYM(glsym_glGetPerfMonitorCountersAMD, "glGetPerfMonitorCountersAMD", glsym_func_void); | ||
353 | FINDSYM(glsym_glGetPerfMonitorGroupStringAMD, "glGetPerfMonitorGroupStringAMD", glsym_func_void); | ||
354 | FINDSYM(glsym_glGetPerfMonitorCounterStringAMD, "glGetPerfMonitorCounterStringAMD", glsym_func_void); | ||
355 | FINDSYM(glsym_glGetPerfMonitorCounterInfoAMD, "glGetPerfMonitorCounterInfoAMD", glsym_func_void); | ||
356 | FINDSYM(glsym_glGenPerfMonitorsAMD, "glGenPerfMonitorsAMD", glsym_func_void); | ||
357 | FINDSYM(glsym_glDeletePerfMonitorsAMD, "glDeletePerfMonitorsAMD", glsym_func_void); | ||
358 | FINDSYM(glsym_glSelectPerfMonitorCountersAMD, "glSelectPerfMonitorCountersAMD", glsym_func_void); | ||
359 | FINDSYM(glsym_glBeginPerfMonitorAMD, "glBeginPerfMonitorAMD", glsym_func_void); | ||
360 | FINDSYM(glsym_glEndPerfMonitorAMD, "glEndPerfMonitorAMD", glsym_func_void); | ||
361 | FINDSYM(glsym_glGetPerfMonitorCounterDataAMD, "glGetPerfMonitorCounterDataAMD", glsym_func_void); | ||
362 | |||
363 | if (glsym_glGetPerfMonitorGroupsAMD) _gl_ext_entries[3].supported = 1; | ||
364 | |||
365 | /* GL_EXT_discard_framebuffer */ | ||
366 | FINDSYM(glsym_glDiscardFramebufferEXT, "glDiscardFramebuffer", glsym_func_void); | ||
367 | FINDSYM(glsym_glDiscardFramebufferEXT, "glDiscardFramebufferARB", glsym_func_void); | ||
368 | FINDSYM(glsym_glDiscardFramebufferEXT, "glDiscardFramebufferEXT", glsym_func_void); | ||
369 | |||
370 | if (glsym_glDiscardFramebufferEXT) _gl_ext_entries[4].supported = 1; | ||
371 | |||
372 | /* GL_EXT_multi_draw_arrays */ | ||
373 | FINDSYM(glsym_glMultiDrawArraysEXT, "glMultiDrawArrays", glsym_func_void); | ||
374 | FINDSYM(glsym_glMultiDrawArraysEXT, "glMultiDrawArraysARB", glsym_func_void); | ||
375 | FINDSYM(glsym_glMultiDrawArraysEXT, "glMultiDrawArraysEXT", glsym_func_void); | ||
376 | |||
377 | FINDSYM(glsym_glMultiDrawElementsEXT, "glMultiDrawElements", glsym_func_void); | ||
378 | FINDSYM(glsym_glMultiDrawElementsEXT, "glMultiDrawElementsARB", glsym_func_void); | ||
379 | FINDSYM(glsym_glMultiDrawElementsEXT, "glMultiDrawElementsEXT", glsym_func_void); | ||
380 | |||
381 | if (glsym_glMultiDrawArraysEXT) _gl_ext_entries[5].supported = 1; | ||
382 | |||
383 | /* GL_NV_fence */ | ||
384 | FINDSYM(glsym_glDeleteFencesNV, "glDeleteFencesNV", glsym_func_void); | ||
385 | FINDSYM(glsym_glGenFencesNV, "glGenFencesNV", glsym_func_void); | ||
386 | FINDSYM(glsym_glIsFenceNV, "glIsFenceNV", glsym_func_uchar); | ||
387 | FINDSYM(glsym_glTestFenceNV, "glTestFenceNV", glsym_func_uchar); | ||
388 | FINDSYM(glsym_glGetFenceivNV, "glGetFenceivNV", glsym_func_void); | ||
389 | FINDSYM(glsym_glFinishFenceNV, "glFinishFenceNV", glsym_func_void); | ||
390 | FINDSYM(glsym_glSetFenceNV, "glSetFenceNV", glsym_func_void); | ||
391 | |||
392 | if (glsym_glDeleteFencesNV) _gl_ext_entries[6].supported = 1; | ||
393 | |||
394 | /* GL_QCOM_driver_control */ | ||
395 | FINDSYM(glsym_glGetDriverControlsQCOM, "glGetDriverControlsQCOM", glsym_func_void); | ||
396 | FINDSYM(glsym_glGetDriverControlStringQCOM, "glGetDriverControlStringQCOM", glsym_func_void); | ||
397 | FINDSYM(glsym_glEnableDriverControlQCOM, "glEnableDriverControlQCOM", glsym_func_void); | ||
398 | FINDSYM(glsym_glDisableDriverControlQCOM, "glDisableDriverControlQCOM", glsym_func_void); | ||
399 | |||
400 | if (glsym_glGetDriverControlsQCOM) _gl_ext_entries[7].supported = 1; | ||
401 | |||
402 | /* GL_QCOM_extended_get */ | ||
403 | FINDSYM(glsym_glExtGetTexturesQCOM, "glExtGetTexturesQCOM", glsym_func_void); | ||
404 | FINDSYM(glsym_glExtGetBuffersQCOM, "glExtGetBuffersQCOM", glsym_func_void); | ||
405 | FINDSYM(glsym_glExtGetRenderbuffersQCOM, "glExtGetRenderbuffersQCOM", glsym_func_void); | ||
406 | FINDSYM(glsym_glExtGetFramebuffersQCOM, "glExtGetFramebuffersQCOM", glsym_func_void); | ||
407 | FINDSYM(glsym_glExtGetTexLevelParameterivQCOM, "glExtGetTexLevelParameterivQCOM", glsym_func_void); | ||
408 | FINDSYM(glsym_glExtTexObjectStateOverrideiQCOM, "glExtTexObjectStateOverrideiQCOM", glsym_func_void); | ||
409 | FINDSYM(glsym_glExtGetTexSubImageQCOM, "glExtGetTexSubImageQCOM", glsym_func_void); | ||
410 | FINDSYM(glsym_glExtGetBufferPointervQCOM, "glExtGetBufferPointervQCOM", glsym_func_void); | ||
411 | |||
412 | if (glsym_glExtGetTexturesQCOM) _gl_ext_entries[8].supported = 1; | ||
413 | |||
414 | /* GL_QCOM_extended_get2 */ | ||
415 | FINDSYM(glsym_glExtGetShadersQCOM, "glExtGetShadersQCOM", glsym_func_void); | ||
416 | FINDSYM(glsym_glExtGetProgramsQCOM, "glExtGetProgramsQCOM", glsym_func_void); | ||
417 | FINDSYM(glsym_glExtIsProgramBinaryQCOM, "glExtIsProgramBinaryQCOM", glsym_func_uchar); | ||
418 | FINDSYM(glsym_glExtGetProgramBinarySourceQCOM, "glExtGetProgramBinarySourceQCOM", glsym_func_void); | ||
419 | |||
420 | if (glsym_glExtGetShadersQCOM) _gl_ext_entries[9].supported = 1; | ||
421 | } | ||
422 | |||
423 | static void | ||
424 | _extensions_init(Render_Engine *re) | ||
425 | { | ||
426 | int i; | ||
427 | const char *glexts, *evasglexts; | ||
428 | |||
429 | memset(_gl_ext_string, 0, 1024); | ||
430 | memset(_evasgl_ext_string, 0, 1024); | ||
431 | |||
432 | // GLES 2.0 Extensions | ||
433 | glexts = (const char*)glGetString(GL_EXTENSIONS); | ||
434 | |||
435 | DBG("--------GLES 2.0 Extensions--------"); | ||
436 | for (i = 0; _gl_ext_entries[i].name != NULL; i++) | ||
437 | { | ||
438 | if ( (strstr(glexts, _gl_ext_entries[i].name) != NULL) || | ||
439 | (strstr(glexts, _gl_ext_entries[i].real_name) != NULL) ) | ||
440 | { | ||
441 | _gl_ext_entries[i].supported = 1; | ||
442 | strcat(_gl_ext_string, _gl_ext_entries[i].name); | ||
443 | strcat(_gl_ext_string, " "); | ||
444 | DBG("\t%s", _gl_ext_entries[i].name); | ||
445 | } | ||
446 | |||
447 | } | ||
448 | DBG(" "); | ||
449 | |||
450 | // EGL Extensions | ||
451 | evasglexts = glsym_eglQueryString(re->win->egl_disp, EGL_EXTENSIONS); | ||
452 | |||
453 | DBG("--------EvasGL Extensions----------"); | ||
454 | for (i = 0; _evasgl_ext_entries[i].name != NULL; i++) | ||
455 | { | ||
456 | if ( (strstr(evasglexts, _evasgl_ext_entries[i].name) != NULL) || | ||
457 | (strstr(evasglexts, _evasgl_ext_entries[i].real_name) != NULL) ) | ||
458 | { | ||
459 | _evasgl_ext_entries[i].supported = 1; | ||
460 | strcat(_evasgl_ext_string, _evasgl_ext_entries[i].name); | ||
461 | strcat(_evasgl_ext_string, " "); | ||
462 | DBG("\t%s", _evasgl_ext_entries[i].name); | ||
463 | } | ||
464 | } | ||
465 | DBG(" "); | ||
466 | } | ||
467 | |||
468 | int _evas_engine_wl_egl_log_dom = -1; | ||
469 | |||
470 | /* function tables - filled in later (func and parent func) */ | ||
471 | static Evas_Func func, pfunc; | ||
472 | |||
473 | /* Function table for GL APIs */ | ||
474 | static Evas_GL_API gl_funcs; | ||
475 | |||
476 | static void * | ||
477 | eng_info(Evas *e) | ||
478 | { | ||
479 | Evas_Engine_Info_Wayland_Egl *info; | ||
480 | |||
481 | info = calloc(1, sizeof(Evas_Engine_Info_Wayland_Egl)); | ||
482 | info->magic.magic = rand(); | ||
483 | info->func.best_depth_get = eng_best_depth_get; | ||
484 | info->render_mode = EVAS_RENDER_MODE_BLOCKING; | ||
485 | return info; | ||
486 | e = NULL; | ||
487 | } | ||
488 | |||
489 | static void | ||
490 | eng_info_free(Evas *e __UNUSED__, void *info) | ||
491 | { | ||
492 | Evas_Engine_Info_Wayland_Egl *in; | ||
493 | // dont free! why bother? its not worth it | ||
494 | // eina_log_domain_unregister(_evas_engine_GL_X11_log_dom); | ||
495 | in = (Evas_Engine_Info_Wayland_Egl *)info; | ||
496 | free(in); | ||
497 | } | ||
498 | |||
499 | static int | ||
500 | _re_wincheck(Render_Engine *re) | ||
501 | { | ||
502 | if (!re) return 0; | ||
503 | if (re->win->surf) return 1; | ||
504 | eng_window_resurf(re->win); | ||
505 | if (!re->win->surf) | ||
506 | { | ||
507 | ERR("GL engine can't re-create window surface!"); | ||
508 | } | ||
509 | return 0; | ||
510 | } | ||
511 | |||
512 | static void | ||
513 | _re_winfree(Render_Engine *re) | ||
514 | { | ||
515 | if (!re->win->surf) return; | ||
516 | eng_window_unsurf(re->win); | ||
517 | } | ||
518 | |||
519 | static Render_Engine_GL_Resource * | ||
520 | _create_internal_glue_resources(void *data) | ||
521 | { | ||
522 | Render_Engine *re; | ||
523 | Render_Engine_GL_Resource *rsc; | ||
524 | |||
525 | if (!(re = (Render_Engine *)data)) return NULL; | ||
526 | |||
527 | rsc = calloc(1, sizeof(Render_Engine_GL_Resource)); | ||
528 | if (!rsc) return NULL; | ||
529 | |||
530 | // EGL | ||
531 | int context_attrs[3]; | ||
532 | context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION; | ||
533 | context_attrs[1] = 2; | ||
534 | context_attrs[2] = EGL_NONE; | ||
535 | |||
536 | // Create resource surface for EGL | ||
537 | rsc->surface = | ||
538 | eglCreateWindowSurface(re->win->egl_disp, re->win->egl_config, | ||
539 | (EGLNativeWindowType)re->win->win, NULL); | ||
540 | if (!rsc->surface) | ||
541 | { | ||
542 | ERR("Creating internal resource surface failed."); | ||
543 | free(rsc); | ||
544 | return NULL; | ||
545 | } | ||
546 | |||
547 | // Create a resource context for EGL | ||
548 | rsc->context = | ||
549 | eglCreateContext(re->win->egl_disp, re->win->egl_config, | ||
550 | re->win->egl_context[0], context_attrs); | ||
551 | if (!rsc->context) | ||
552 | { | ||
553 | ERR("Internal Resource Context Creations Failed."); | ||
554 | free(rsc); | ||
555 | return NULL; | ||
556 | } | ||
557 | |||
558 | // Add to the resource resource list for cleanup | ||
559 | LKL(resource_lock); | ||
560 | resource_list = eina_list_prepend(resource_list, rsc); | ||
561 | LKU(resource_lock); | ||
562 | |||
563 | // Set the resource in TLS | ||
564 | if (eina_tls_set(resource_key, (void*)rsc) == EINA_FALSE) | ||
565 | { | ||
566 | ERR("Failed setting TLS Resource"); | ||
567 | free(rsc); | ||
568 | return NULL; | ||
569 | } | ||
570 | |||
571 | return rsc; | ||
572 | } | ||
573 | |||
574 | static int | ||
575 | _destroy_internal_glue_resources(void *data) | ||
576 | { | ||
577 | Render_Engine *re = (Render_Engine *)data; | ||
578 | Eina_List *l; | ||
579 | Render_Engine_GL_Resource *rsc; | ||
580 | |||
581 | // EGL | ||
582 | // Delete the Resources | ||
583 | LKL(resource_lock); | ||
584 | EINA_LIST_FOREACH(resource_list, l, rsc) | ||
585 | { | ||
586 | if (rsc->surface) eglDestroySurface(re->win->egl_disp, rsc->surface); | ||
587 | if (rsc->context) eglDestroyContext(re->win->egl_disp, rsc->context); | ||
588 | free(rsc); | ||
589 | } | ||
590 | eina_list_free(resource_list); | ||
591 | LKU(resource_lock); | ||
592 | |||
593 | // Destroy TLS | ||
594 | eina_tls_free(resource_key); | ||
595 | |||
596 | return 1; | ||
597 | } | ||
598 | |||
599 | static int | ||
600 | eng_setup(Evas *e, void *in) | ||
601 | { | ||
602 | Render_Engine *re; | ||
603 | Evas_Engine_Info_Wayland_Egl *info; | ||
604 | |||
605 | info = (Evas_Engine_Info_Wayland_Egl *)in; | ||
606 | if (!e->engine.data.output) | ||
607 | { | ||
608 | re = calloc(1, sizeof(Render_Engine)); | ||
609 | if (!re) return 0; | ||
610 | re->info = info; | ||
611 | re->evas = e; | ||
612 | e->engine.data.output = re; | ||
613 | re->w = e->output.w; | ||
614 | re->h = e->output.h; | ||
615 | |||
616 | re->win = eng_window_new(re->info->info.display, | ||
617 | re->info->info.surface, | ||
618 | re->info->info.screen, | ||
619 | re->info->info.depth, re->w, re->h, | ||
620 | re->info->indirect, | ||
621 | re->info->info.destination_alpha, | ||
622 | re->info->info.rotation); | ||
623 | if (!re->win) | ||
624 | { | ||
625 | free(re); | ||
626 | e->engine.data.output = NULL; | ||
627 | return 0; | ||
628 | } | ||
629 | |||
630 | gl_wins++; | ||
631 | if (!initted) | ||
632 | { | ||
633 | evas_common_cpu_init(); | ||
634 | evas_common_blend_init(); | ||
635 | evas_common_image_init(); | ||
636 | evas_common_convert_init(); | ||
637 | evas_common_scale_init(); | ||
638 | evas_common_rectangle_init(); | ||
639 | evas_common_polygon_init(); | ||
640 | evas_common_line_init(); | ||
641 | evas_common_font_init(); | ||
642 | evas_common_draw_init(); | ||
643 | evas_common_tilebuf_init(); | ||
644 | |||
645 | // Initialize TLS | ||
646 | if (eina_tls_new(&resource_key) == EINA_FALSE) | ||
647 | ERR("Error creating tls key"); | ||
648 | |||
649 | DBG("TLS KEY create... %d", resource_key); | ||
650 | |||
651 | initted = 1; | ||
652 | } | ||
653 | } | ||
654 | else | ||
655 | { | ||
656 | if (!(re = e->engine.data.output)) return 0; | ||
657 | if (_re_wincheck(re)) | ||
658 | { | ||
659 | if ((re->info->info.display != re->win->disp) || | ||
660 | (re->info->info.surface != re->win->surface) || | ||
661 | (re->info->info.screen != re->win->screen) || | ||
662 | (re->info->info.depth != re->win->depth) || | ||
663 | (re->info->info.destination_alpha != re->win->alpha) || | ||
664 | (re->info->info.rotation != re->win->rot)) | ||
665 | { | ||
666 | int inc = 0; | ||
667 | |||
668 | /* if we already have a window surface, check for NULL input surface. | ||
669 | * this will mean we are hiding the window and should destroy | ||
670 | * things properly */ | ||
671 | if ((re->win->surface) && (re->info->info.surface = NULL)) | ||
672 | { | ||
673 | if (re->win) | ||
674 | { | ||
675 | eng_window_free(re->win); | ||
676 | gl_wins--; | ||
677 | } | ||
678 | free(re); | ||
679 | e->engine.data.output = NULL; | ||
680 | return 0; | ||
681 | } | ||
682 | |||
683 | if (re->win) | ||
684 | { | ||
685 | re->win->gl_context->references++; | ||
686 | eng_window_free(re->win); | ||
687 | inc = 1; | ||
688 | gl_wins--; | ||
689 | } | ||
690 | re->w = e->output.w; | ||
691 | re->h = e->output.h; | ||
692 | re->win = eng_window_new(re->info->info.display, | ||
693 | re->info->info.surface, | ||
694 | re->info->info.screen, | ||
695 | re->info->info.depth, | ||
696 | re->w, re->h, | ||
697 | re->info->indirect, | ||
698 | re->info->info.destination_alpha, | ||
699 | re->info->info.rotation); | ||
700 | eng_window_use(re->win); | ||
701 | if (re->win) gl_wins++; | ||
702 | if ((re->win) && (inc)) | ||
703 | re->win->gl_context->references--; | ||
704 | } | ||
705 | else if ((re->win->w != e->output.w) || | ||
706 | (re->win->h != e->output.h)) | ||
707 | { | ||
708 | re->w = e->output.w; | ||
709 | re->h = e->output.h; | ||
710 | re->win->w = e->output.w; | ||
711 | re->win->h = e->output.h; | ||
712 | eng_window_use(re->win); | ||
713 | evas_gl_common_context_resize(re->win->gl_context, | ||
714 | re->win->w, re->win->h, | ||
715 | re->win->rot); | ||
716 | } | ||
717 | } | ||
718 | } | ||
719 | |||
720 | if (!re->win) | ||
721 | { | ||
722 | free(re); | ||
723 | e->engine.data.output = NULL; | ||
724 | return 0; | ||
725 | } | ||
726 | |||
727 | if (!e->engine.data.output) | ||
728 | { | ||
729 | if (re->win) | ||
730 | { | ||
731 | eng_window_free(re->win); | ||
732 | gl_wins--; | ||
733 | } | ||
734 | free(re); | ||
735 | e->engine.data.output = NULL; | ||
736 | return 0; | ||
737 | } | ||
738 | re->tb = evas_common_tilebuf_new(re->win->w, re->win->h); | ||
739 | if (!re->tb) | ||
740 | { | ||
741 | if (re->win) | ||
742 | { | ||
743 | eng_window_free(re->win); | ||
744 | gl_wins--; | ||
745 | } | ||
746 | free(re); | ||
747 | e->engine.data.output = NULL; | ||
748 | return 0; | ||
749 | } | ||
750 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
751 | |||
752 | if (!e->engine.data.context) | ||
753 | { | ||
754 | e->engine.data.context = | ||
755 | e->engine.func->context_new(e->engine.data.output); | ||
756 | } | ||
757 | |||
758 | eng_window_use(re->win); | ||
759 | |||
760 | re->vsync = 0; | ||
761 | _sym_init(); | ||
762 | _extensions_init(re); | ||
763 | |||
764 | // This is used in extensions. Not pretty but can't get display otherwise. | ||
765 | current_engine = re; | ||
766 | |||
767 | return 1; | ||
768 | } | ||
769 | |||
770 | static void | ||
771 | eng_output_free(void *data) | ||
772 | { | ||
773 | Render_Engine *re; | ||
774 | |||
775 | re = (Render_Engine *)data; | ||
776 | |||
777 | if (re) | ||
778 | { | ||
779 | #if 0 | ||
780 | // Destroy the resource surface | ||
781 | // Only required for EGL case | ||
782 | if (re->surface) | ||
783 | eglDestroySurface(re->win->egl_disp, re->surface); | ||
784 | |||
785 | // Destroy the resource context | ||
786 | _destroy_internal_context(re, context); | ||
787 | #endif | ||
788 | if (re->win) | ||
789 | { | ||
790 | if ((initted == 1) && (gl_wins == 1)) | ||
791 | _destroy_internal_glue_resources(re); | ||
792 | eng_window_free(re->win); | ||
793 | gl_wins--; | ||
794 | } | ||
795 | evas_common_tilebuf_free(re->tb); | ||
796 | free(re); | ||
797 | } | ||
798 | if ((initted == 1) && (gl_wins == 0)) | ||
799 | { | ||
800 | evas_common_image_shutdown(); | ||
801 | evas_common_font_shutdown(); | ||
802 | initted = 0; | ||
803 | } | ||
804 | } | ||
805 | |||
806 | static void | ||
807 | eng_output_resize(void *data, int w, int h) | ||
808 | { | ||
809 | Render_Engine *re; | ||
810 | |||
811 | re = (Render_Engine *)data; | ||
812 | re->win->w = w; | ||
813 | re->win->h = h; | ||
814 | eng_window_use(re->win); | ||
815 | |||
816 | if (re->win->win) | ||
817 | wl_egl_window_resize(re->win->win, w, h, 0, 0); | ||
818 | |||
819 | evas_gl_common_context_resize(re->win->gl_context, w, h, re->win->rot); | ||
820 | evas_common_tilebuf_free(re->tb); | ||
821 | re->tb = evas_common_tilebuf_new(w, h); | ||
822 | if (re->tb) | ||
823 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
824 | } | ||
825 | |||
826 | static void | ||
827 | eng_output_tile_size_set(void *data, int w, int h) | ||
828 | { | ||
829 | Render_Engine *re; | ||
830 | |||
831 | re = (Render_Engine *)data; | ||
832 | evas_common_tilebuf_set_tile_size(re->tb, w, h); | ||
833 | } | ||
834 | |||
835 | static void | ||
836 | eng_output_redraws_rect_add(void *data, int x, int y, int w, int h) | ||
837 | { | ||
838 | Render_Engine *re; | ||
839 | |||
840 | re = (Render_Engine *)data; | ||
841 | eng_window_use(re->win); | ||
842 | evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot); | ||
843 | evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); | ||
844 | |||
845 | RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->w, re->win->h); | ||
846 | if ((w <= 0) || (h <= 0)) return; | ||
847 | if (!re->win->draw.redraw) | ||
848 | { | ||
849 | #if 1 | ||
850 | re->win->draw.x1 = x; | ||
851 | re->win->draw.y1 = y; | ||
852 | re->win->draw.x2 = x + w - 1; | ||
853 | re->win->draw.y2 = y + h - 1; | ||
854 | #else | ||
855 | re->win->draw.x1 = 0; | ||
856 | re->win->draw.y1 = 0; | ||
857 | re->win->draw.x2 = re->win->w - 1; | ||
858 | re->win->draw.y2 = re->win->h - 1; | ||
859 | #endif | ||
860 | } | ||
861 | else | ||
862 | { | ||
863 | if (x < re->win->draw.x1) re->win->draw.x1 = x; | ||
864 | if (y < re->win->draw.y1) re->win->draw.y1 = y; | ||
865 | if ((x + w - 1) > re->win->draw.x2) re->win->draw.x2 = x + w - 1; | ||
866 | if ((y + h - 1) > re->win->draw.y2) re->win->draw.y2 = y + h - 1; | ||
867 | } | ||
868 | re->win->draw.redraw = 1; | ||
869 | } | ||
870 | |||
871 | static void | ||
872 | eng_output_redraws_rect_del(void *data, int x, int y, int w, int h) | ||
873 | { | ||
874 | Render_Engine *re; | ||
875 | |||
876 | re = (Render_Engine *)data; | ||
877 | evas_common_tilebuf_del_redraw(re->tb, x, y, w, h); | ||
878 | } | ||
879 | |||
880 | static void | ||
881 | eng_output_redraws_clear(void *data) | ||
882 | { | ||
883 | Render_Engine *re; | ||
884 | |||
885 | re = (Render_Engine *)data; | ||
886 | evas_common_tilebuf_clear(re->tb); | ||
887 | /* re->win->draw.redraw = 0;*/ | ||
888 | // INF("GL: finish update cycle!"); | ||
889 | } | ||
890 | |||
891 | /* vsync games - not for now though */ | ||
892 | #define VSYNC_TO_SCREEN 1 | ||
893 | |||
894 | static void * | ||
895 | eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch) | ||
896 | { | ||
897 | Render_Engine *re; | ||
898 | Tilebuf_Rect *rects; | ||
899 | |||
900 | re = (Render_Engine *)data; | ||
901 | /* get the upate rect surface - return engine data as dummy */ | ||
902 | rects = evas_common_tilebuf_get_render_rects(re->tb); | ||
903 | if (rects) | ||
904 | { | ||
905 | evas_common_tilebuf_free_render_rects(rects); | ||
906 | evas_common_tilebuf_clear(re->tb); | ||
907 | eng_window_use(re->win); | ||
908 | if (!_re_wincheck(re)) return NULL; | ||
909 | evas_gl_common_context_flush(re->win->gl_context); | ||
910 | evas_gl_common_context_newframe(re->win->gl_context); | ||
911 | if (x) *x = 0; | ||
912 | if (y) *y = 0; | ||
913 | if (w) *w = re->win->w; | ||
914 | if (h) *h = re->win->h; | ||
915 | if (cx) *cx = 0; | ||
916 | if (cy) *cy = 0; | ||
917 | if (cw) *cw = re->win->w; | ||
918 | if (ch) *ch = re->win->h; | ||
919 | return re->win->gl_context->def_surface; | ||
920 | } | ||
921 | return NULL; | ||
922 | } | ||
923 | |||
924 | //#define FRAMECOUNT 1 | ||
925 | |||
926 | #ifdef FRAMECOUNT | ||
927 | static double | ||
928 | get_time(void) | ||
929 | { | ||
930 | struct timeval timev; | ||
931 | |||
932 | gettimeofday(&timev, NULL); | ||
933 | return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); | ||
934 | } | ||
935 | #endif | ||
936 | |||
937 | static int safe_native = -1; | ||
938 | |||
939 | static void | ||
940 | eng_output_redraws_next_update_push(void *data, void *surface __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__) | ||
941 | { | ||
942 | Render_Engine *re; | ||
943 | #ifdef FRAMECOUNT | ||
944 | static double pt = 0.0; | ||
945 | double ta, tb; | ||
946 | #endif | ||
947 | |||
948 | re = (Render_Engine *)data; | ||
949 | /* put back update surface.. in this case just unflag redraw */ | ||
950 | if (!_re_wincheck(re)) return; | ||
951 | re->win->draw.redraw = 0; | ||
952 | re->win->draw.drew = 1; | ||
953 | evas_gl_common_context_flush(re->win->gl_context); | ||
954 | if (safe_native == -1) | ||
955 | { | ||
956 | const char *s; | ||
957 | |||
958 | s = getenv("EVAS_GL_SAFE_NATIVE"); | ||
959 | safe_native = 0; | ||
960 | if (s) | ||
961 | safe_native = atoi(s); | ||
962 | else | ||
963 | { | ||
964 | s = (const char *)glGetString(GL_RENDERER); | ||
965 | if (s) | ||
966 | { | ||
967 | if (strstr(s, "PowerVR SGX 540") || strstr(s, "Mali-400 MP")) | ||
968 | safe_native = 1; | ||
969 | } | ||
970 | } | ||
971 | } | ||
972 | // this is needed to make sure all previous rendering is flushed to | ||
973 | // buffers/surfaces | ||
974 | # ifdef FRAMECOUNT | ||
975 | double t0 = get_time(); | ||
976 | ta = t0 - pt; | ||
977 | pt = t0; | ||
978 | # endif | ||
979 | // previous rendering should be done and swapped | ||
980 | if (!safe_native) eglWaitNative(EGL_CORE_NATIVE_ENGINE); | ||
981 | # ifdef FRAMECOUNT | ||
982 | double t1 = get_time(); | ||
983 | tb = t1 - t0; | ||
984 | printf("... %1.5f -> %1.5f | ", ta, tb); | ||
985 | # endif | ||
986 | if (eglGetError() != EGL_SUCCESS) | ||
987 | { | ||
988 | printf("Error: eglWaitNative(EGL_CORE_NATIVE_ENGINE) fail.\n"); | ||
989 | } | ||
990 | } | ||
991 | |||
992 | static void | ||
993 | eng_output_flush(void *data) | ||
994 | { | ||
995 | Render_Engine *re; | ||
996 | |||
997 | re = (Render_Engine *)data; | ||
998 | if (!_re_wincheck(re)) return; | ||
999 | if (!re->win->draw.drew) return; | ||
1000 | //x// printf("frame -> flush\n"); | ||
1001 | re->win->draw.drew = 0; | ||
1002 | eng_window_use(re->win); | ||
1003 | |||
1004 | # ifdef FRAMECOUNT | ||
1005 | double t0 = get_time(); | ||
1006 | # endif | ||
1007 | |||
1008 | if (!re->vsync) | ||
1009 | { | ||
1010 | if (re->info->vsync) eglSwapInterval(re->win->egl_disp, 1); | ||
1011 | else eglSwapInterval(re->win->egl_disp, 0); | ||
1012 | re->vsync = 1; | ||
1013 | } | ||
1014 | |||
1015 | if (re->info->callback.pre_swap) | ||
1016 | re->info->callback.pre_swap(re->info->callback.data, re->evas); | ||
1017 | |||
1018 | eglSwapBuffers(re->win->egl_disp, re->win->egl_surface[0]); | ||
1019 | if (!safe_native) eglWaitGL(); | ||
1020 | |||
1021 | if (re->info->callback.post_swap) | ||
1022 | re->info->callback.post_swap(re->info->callback.data, re->evas); | ||
1023 | |||
1024 | if (eglGetError() != EGL_SUCCESS) | ||
1025 | printf("Error: eglSwapBuffers() fail.\n"); | ||
1026 | |||
1027 | # ifdef FRAMECOUNT | ||
1028 | double t1 = get_time(); | ||
1029 | printf("%1.5f\n", t1 - t0); | ||
1030 | # endif | ||
1031 | } | ||
1032 | |||
1033 | static void | ||
1034 | eng_output_idle_flush(void *data) | ||
1035 | { | ||
1036 | Render_Engine *re; | ||
1037 | |||
1038 | re = (Render_Engine *)data; | ||
1039 | } | ||
1040 | |||
1041 | static void | ||
1042 | eng_output_dump(void *data) | ||
1043 | { | ||
1044 | Render_Engine *re; | ||
1045 | |||
1046 | re = (Render_Engine *)data; | ||
1047 | evas_common_image_image_all_unload(); | ||
1048 | evas_common_font_font_all_unload(); | ||
1049 | evas_gl_common_image_all_unload(re->win->gl_context); | ||
1050 | _re_winfree(re); | ||
1051 | } | ||
1052 | |||
1053 | static void | ||
1054 | eng_context_cutout_add(void *data __UNUSED__, void *context, int x, int y, int w, int h) | ||
1055 | { | ||
1056 | // Render_Engine *re; | ||
1057 | // | ||
1058 | // re = (Render_Engine *)data; | ||
1059 | // re->win->gl_context->dc = context; | ||
1060 | evas_common_draw_context_add_cutout(context, x, y, w, h); | ||
1061 | } | ||
1062 | |||
1063 | static void | ||
1064 | eng_context_cutout_clear(void *data __UNUSED__, void *context) | ||
1065 | { | ||
1066 | // Render_Engine *re; | ||
1067 | // | ||
1068 | // re = (Render_Engine *)data; | ||
1069 | // re->win->gl_context->dc = context; | ||
1070 | evas_common_draw_context_clear_cutouts(context); | ||
1071 | } | ||
1072 | |||
1073 | static void | ||
1074 | eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h) | ||
1075 | { | ||
1076 | Render_Engine *re; | ||
1077 | |||
1078 | re = (Render_Engine *)data; | ||
1079 | eng_window_use(re->win); | ||
1080 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | ||
1081 | re->win->gl_context->dc = context; | ||
1082 | evas_gl_common_rect_draw(re->win->gl_context, x, y, w, h); | ||
1083 | } | ||
1084 | |||
1085 | static void | ||
1086 | eng_line_draw(void *data, void *context, void *surface, int x1, int y1, int x2, int y2) | ||
1087 | { | ||
1088 | Render_Engine *re; | ||
1089 | |||
1090 | re = (Render_Engine *)data; | ||
1091 | eng_window_use(re->win); | ||
1092 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | ||
1093 | re->win->gl_context->dc = context; | ||
1094 | evas_gl_common_line_draw(re->win->gl_context, x1, y1, x2, y2); | ||
1095 | } | ||
1096 | |||
1097 | static void * | ||
1098 | eng_polygon_point_add(void *data, void *context __UNUSED__, void *polygon, int x, int y) | ||
1099 | { | ||
1100 | Render_Engine *re; | ||
1101 | |||
1102 | re = (Render_Engine *)data; | ||
1103 | return evas_gl_common_poly_point_add(polygon, x, y); | ||
1104 | } | ||
1105 | |||
1106 | static void * | ||
1107 | eng_polygon_points_clear(void *data, void *context __UNUSED__, void *polygon) | ||
1108 | { | ||
1109 | Render_Engine *re; | ||
1110 | |||
1111 | re = (Render_Engine *)data; | ||
1112 | return evas_gl_common_poly_points_clear(polygon); | ||
1113 | } | ||
1114 | |||
1115 | static void | ||
1116 | eng_polygon_draw(void *data, void *context, void *surface __UNUSED__, void *polygon, int x, int y) | ||
1117 | { | ||
1118 | Render_Engine *re; | ||
1119 | |||
1120 | re = (Render_Engine *)data; | ||
1121 | eng_window_use(re->win); | ||
1122 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | ||
1123 | re->win->gl_context->dc = context; | ||
1124 | evas_gl_common_poly_draw(re->win->gl_context, polygon, x, y); | ||
1125 | } | ||
1126 | |||
1127 | static int | ||
1128 | eng_image_alpha_get(void *data __UNUSED__, void *image) | ||
1129 | { | ||
1130 | // Render_Engine *re; | ||
1131 | Evas_GL_Image *im; | ||
1132 | |||
1133 | // re = (Render_Engine *)data; | ||
1134 | if (!image) return 1; | ||
1135 | im = image; | ||
1136 | return im->alpha; | ||
1137 | } | ||
1138 | |||
1139 | static int | ||
1140 | eng_image_colorspace_get(void *data __UNUSED__, void *image) | ||
1141 | { | ||
1142 | // Render_Engine *re; | ||
1143 | Evas_GL_Image *im; | ||
1144 | |||
1145 | // re = (Render_Engine *)data; | ||
1146 | if (!image) return EVAS_COLORSPACE_ARGB8888; | ||
1147 | im = image; | ||
1148 | return im->cs.space; | ||
1149 | } | ||
1150 | |||
1151 | static void | ||
1152 | eng_image_mask_create(void *data __UNUSED__, void *image) | ||
1153 | { | ||
1154 | Evas_GL_Image *im; | ||
1155 | |||
1156 | if (!image) return; | ||
1157 | im = image; | ||
1158 | if (!im->im->image.data) | ||
1159 | evas_cache_image_load_data(&im->im->cache_entry); | ||
1160 | if (!im->tex) | ||
1161 | im->tex = evas_gl_common_texture_new(im->gc, im->im); | ||
1162 | } | ||
1163 | |||
1164 | |||
1165 | static void * | ||
1166 | eng_image_alpha_set(void *data, void *image, int has_alpha) | ||
1167 | { | ||
1168 | Render_Engine *re; | ||
1169 | Evas_GL_Image *im; | ||
1170 | |||
1171 | re = (Render_Engine *)data; | ||
1172 | if (!image) return NULL; | ||
1173 | im = image; | ||
1174 | if (im->alpha == has_alpha) return image; | ||
1175 | if (im->native.data) | ||
1176 | { | ||
1177 | im->alpha = has_alpha; | ||
1178 | return image; | ||
1179 | } | ||
1180 | eng_window_use(re->win); | ||
1181 | if ((im->tex) && (im->tex->pt->dyn.img)) | ||
1182 | { | ||
1183 | im->alpha = has_alpha; | ||
1184 | im->tex->alpha = im->alpha; | ||
1185 | return image; | ||
1186 | } | ||
1187 | /* FIXME: can move to gl_common */ | ||
1188 | if (im->cs.space != EVAS_COLORSPACE_ARGB8888) return im; | ||
1189 | if ((has_alpha) && (im->im->cache_entry.flags.alpha)) return image; | ||
1190 | else if ((!has_alpha) && (!im->im->cache_entry.flags.alpha)) return image; | ||
1191 | if (im->references > 1) | ||
1192 | { | ||
1193 | Evas_GL_Image *im_new; | ||
1194 | |||
1195 | im_new = evas_gl_common_image_new_from_copied_data | ||
1196 | (im->gc, im->im->cache_entry.w, im->im->cache_entry.h, | ||
1197 | im->im->image.data, | ||
1198 | eng_image_alpha_get(data, image), | ||
1199 | eng_image_colorspace_get(data, image)); | ||
1200 | if (!im_new) return im; | ||
1201 | evas_gl_common_image_free(im); | ||
1202 | im = im_new; | ||
1203 | } | ||
1204 | else | ||
1205 | evas_gl_common_image_dirty(im, 0, 0, 0, 0); | ||
1206 | return evas_gl_common_image_alpha_set(im, has_alpha ? 1 : 0); | ||
1207 | // im->im->cache_entry.flags.alpha = has_alpha ? 1 : 0; | ||
1208 | // return image; | ||
1209 | } | ||
1210 | |||
1211 | static void * | ||
1212 | eng_image_border_set(void *data __UNUSED__, void *image, int l __UNUSED__, int r __UNUSED__, int t __UNUSED__, int b __UNUSED__) | ||
1213 | { | ||
1214 | // Render_Engine *re; | ||
1215 | // | ||
1216 | // re = (Render_Engine *)data; | ||
1217 | return image; | ||
1218 | } | ||
1219 | |||
1220 | static void | ||
1221 | eng_image_border_get(void *data __UNUSED__, void *image __UNUSED__, int *l __UNUSED__, int *r __UNUSED__, int *t __UNUSED__, int *b __UNUSED__) | ||
1222 | { | ||
1223 | // Render_Engine *re; | ||
1224 | // | ||
1225 | // re = (Render_Engine *)data; | ||
1226 | } | ||
1227 | |||
1228 | static char * | ||
1229 | eng_image_comment_get(void *data __UNUSED__, void *image, char *key __UNUSED__) | ||
1230 | { | ||
1231 | // Render_Engine *re; | ||
1232 | Evas_GL_Image *im; | ||
1233 | |||
1234 | // re = (Render_Engine *)data; | ||
1235 | if (!image) return NULL; | ||
1236 | im = image; | ||
1237 | if (!im->im) return NULL; | ||
1238 | return im->im->info.comment; | ||
1239 | } | ||
1240 | |||
1241 | static char * | ||
1242 | eng_image_format_get(void *data __UNUSED__, void *image) | ||
1243 | { | ||
1244 | // Render_Engine *re; | ||
1245 | Evas_GL_Image *im; | ||
1246 | |||
1247 | // re = (Render_Engine *)data; | ||
1248 | im = image; | ||
1249 | return NULL; | ||
1250 | } | ||
1251 | |||
1252 | static void | ||
1253 | eng_image_colorspace_set(void *data, void *image, int cspace) | ||
1254 | { | ||
1255 | Render_Engine *re; | ||
1256 | Evas_GL_Image *im; | ||
1257 | |||
1258 | re = (Render_Engine *)data; | ||
1259 | if (!image) return; | ||
1260 | im = image; | ||
1261 | if (im->native.data) return; | ||
1262 | /* FIXME: can move to gl_common */ | ||
1263 | if (im->cs.space == cspace) return; | ||
1264 | eng_window_use(re->win); | ||
1265 | evas_cache_image_colorspace(&im->im->cache_entry, cspace); | ||
1266 | switch (cspace) | ||
1267 | { | ||
1268 | case EVAS_COLORSPACE_ARGB8888: | ||
1269 | if (im->cs.data) | ||
1270 | { | ||
1271 | if (!im->cs.no_free) free(im->cs.data); | ||
1272 | im->cs.data = NULL; | ||
1273 | im->cs.no_free = 0; | ||
1274 | } | ||
1275 | break; | ||
1276 | case EVAS_COLORSPACE_YCBCR422P601_PL: | ||
1277 | case EVAS_COLORSPACE_YCBCR422P709_PL: | ||
1278 | case EVAS_COLORSPACE_YCBCR422601_PL: | ||
1279 | case EVAS_COLORSPACE_YCBCR420NV12601_PL: | ||
1280 | case EVAS_COLORSPACE_YCBCR420TM12601_PL: | ||
1281 | if (im->tex) evas_gl_common_texture_free(im->tex); | ||
1282 | im->tex = NULL; | ||
1283 | if (im->cs.data) | ||
1284 | { | ||
1285 | if (!im->cs.no_free) free(im->cs.data); | ||
1286 | } | ||
1287 | if (im->im->cache_entry.h > 0) | ||
1288 | im->cs.data = | ||
1289 | calloc(1, im->im->cache_entry.h * sizeof(unsigned char *) * 2); | ||
1290 | else | ||
1291 | im->cs.data = NULL; | ||
1292 | im->cs.no_free = 0; | ||
1293 | break; | ||
1294 | default: | ||
1295 | abort(); | ||
1296 | break; | ||
1297 | } | ||
1298 | im->cs.space = cspace; | ||
1299 | } | ||
1300 | |||
1301 | ///////////////////////////////////////////////////////////////////////// | ||
1302 | // | ||
1303 | // | ||
1304 | typedef struct _Native Native; | ||
1305 | |||
1306 | struct _Native | ||
1307 | { | ||
1308 | Evas_Native_Surface ns; | ||
1309 | struct wl_egl_pixmap *pixmap; | ||
1310 | |||
1311 | void *egl_surface; | ||
1312 | }; | ||
1313 | |||
1314 | // FIXME: this is enabled so updates happen - but its SLOOOOOOOOOOOOOOOW | ||
1315 | // (i am sure this is the reason) not to mention seemingly superfluous. but | ||
1316 | // i need to enable it for it to work on fglrx at least. havent tried nvidia. | ||
1317 | // | ||
1318 | // why is this the case? does anyone know? has anyone tried it on other gfx | ||
1319 | // drivers? | ||
1320 | // | ||
1321 | //#define GLX_TEX_PIXMAP_RECREATE 1 | ||
1322 | |||
1323 | static void | ||
1324 | _native_bind_cb(void *data, void *image) | ||
1325 | { | ||
1326 | Evas_GL_Image *im = image; | ||
1327 | Native *n = im->native.data; | ||
1328 | |||
1329 | if (n->egl_surface) | ||
1330 | { | ||
1331 | if (glsym_glEGLImageTargetTexture2DOES) | ||
1332 | { | ||
1333 | glsym_glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, n->egl_surface); | ||
1334 | if (eglGetError() != EGL_SUCCESS) | ||
1335 | ERR("glEGLImageTargetTexture2DOES() failed."); | ||
1336 | } | ||
1337 | else | ||
1338 | ERR("Try glEGLImageTargetTexture2DOES on EGL with no support"); | ||
1339 | } | ||
1340 | return; | ||
1341 | data = NULL; | ||
1342 | } | ||
1343 | |||
1344 | static void | ||
1345 | _native_unbind_cb(void *data, void *image) | ||
1346 | { | ||
1347 | Evas_GL_Image *im = image; | ||
1348 | /* Native *n = im->native.data; */ | ||
1349 | |||
1350 | /* if (n->ns.type == EVAS_NATIVE_SURFACE_X11) */ | ||
1351 | /* { */ | ||
1352 | /* // nothing */ | ||
1353 | /* } */ | ||
1354 | /* else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL) */ | ||
1355 | /* { */ | ||
1356 | /* glBindTexture(GL_TEXTURE_2D, 0); */ | ||
1357 | /* GLERR(__FUNCTION__, __FILE__, __LINE__, ""); */ | ||
1358 | /* } */ | ||
1359 | return; | ||
1360 | data = NULL; | ||
1361 | } | ||
1362 | |||
1363 | static void | ||
1364 | _native_free_cb(void *data, void *image) | ||
1365 | { | ||
1366 | Render_Engine *re = data; | ||
1367 | Evas_GL_Image *im = image; | ||
1368 | Native *n = im->native.data; | ||
1369 | uint32_t texid; | ||
1370 | // uint32_t pmid, texid; | ||
1371 | |||
1372 | /* eina_hash_del(re->win->gl_context->shared->native_pm_hash, &pmid, im); */ | ||
1373 | if (n->egl_surface) | ||
1374 | { | ||
1375 | if (glsym_eglDestroyImage) | ||
1376 | { | ||
1377 | glsym_eglDestroyImage(re->win->egl_disp, n->egl_surface); | ||
1378 | if (eglGetError() != EGL_SUCCESS) | ||
1379 | ERR("eglDestroyImage() failed."); | ||
1380 | } | ||
1381 | else | ||
1382 | ERR("Try eglDestroyImage on EGL with no support"); | ||
1383 | } | ||
1384 | |||
1385 | im->native.data = NULL; | ||
1386 | im->native.func.data = NULL; | ||
1387 | im->native.func.bind = NULL; | ||
1388 | im->native.func.unbind = NULL; | ||
1389 | im->native.func.free = NULL; | ||
1390 | free(n); | ||
1391 | } | ||
1392 | |||
1393 | static void * | ||
1394 | eng_image_native_set(void *data, void *image, void *native) | ||
1395 | { | ||
1396 | Render_Engine *re = (Render_Engine *)data; | ||
1397 | Evas_Native_Surface *ns = native; | ||
1398 | Evas_GL_Image *im = image, *im2 = NULL; | ||
1399 | Native *n = NULL; | ||
1400 | // uint32_t pmid; | ||
1401 | // uint32_t texid; | ||
1402 | unsigned int tex = 0; | ||
1403 | unsigned int fbo = 0; | ||
1404 | |||
1405 | if (!im) | ||
1406 | { | ||
1407 | if ((!ns) && (ns->type == EVAS_NATIVE_SURFACE_OPENGL)) | ||
1408 | { | ||
1409 | im = evas_gl_common_image_new_from_data(re->win->gl_context, | ||
1410 | ns->data.opengl.w, | ||
1411 | ns->data.opengl.h, | ||
1412 | NULL, 1, | ||
1413 | EVAS_COLORSPACE_ARGB8888); | ||
1414 | } | ||
1415 | else | ||
1416 | return NULL; | ||
1417 | } | ||
1418 | |||
1419 | if (ns) | ||
1420 | { | ||
1421 | /* vis = ns->data.x11.visual; */ | ||
1422 | /* pm = ns->data.x11.pixmap; */ | ||
1423 | if (im->native.data) | ||
1424 | { | ||
1425 | Evas_Native_Surface *ens = im->native.data; | ||
1426 | /* if ((ens->data.x11.visual == vis) && */ | ||
1427 | /* (ens->data.x11.pixmap == pm)) */ | ||
1428 | return im; | ||
1429 | } | ||
1430 | } | ||
1431 | if ((!ns) && (!im->native.data)) return im; | ||
1432 | |||
1433 | eng_window_use(re->win); | ||
1434 | |||
1435 | if (im->native.data) | ||
1436 | { | ||
1437 | if (im->native.func.free) | ||
1438 | im->native.func.free(im->native.func.data, im); | ||
1439 | evas_gl_common_image_native_disable(im); | ||
1440 | } | ||
1441 | |||
1442 | if (!ns) return im; | ||
1443 | |||
1444 | /* if (ns->type == EVAS_NATIVE_SURFACE_X11) */ | ||
1445 | /* { */ | ||
1446 | /* pmid = pm; */ | ||
1447 | /* im2 = eina_hash_find(re->win->gl_context->shared->native_pm_hash, &pmid); */ | ||
1448 | if (im2 == im) return im; | ||
1449 | if (im2) | ||
1450 | { | ||
1451 | n = im2->native.data; | ||
1452 | if (n) | ||
1453 | { | ||
1454 | evas_gl_common_image_ref(im2); | ||
1455 | evas_gl_common_image_free(im); | ||
1456 | return im2; | ||
1457 | } | ||
1458 | } | ||
1459 | |||
1460 | im2 = evas_gl_common_image_new_from_data(re->win->gl_context, | ||
1461 | im->w, im->h, NULL, im->alpha, | ||
1462 | EVAS_COLORSPACE_ARGB8888); | ||
1463 | evas_gl_common_image_free(im); | ||
1464 | im = im2; | ||
1465 | /* if (native) */ | ||
1466 | /* { */ | ||
1467 | /* n = calloc(1, sizeof(Native)); */ | ||
1468 | /* if (n) */ | ||
1469 | /* { */ | ||
1470 | /* EGLConfig egl_config; */ | ||
1471 | /* int config_attrs[20]; */ | ||
1472 | /* int num_config, i = 0; */ | ||
1473 | |||
1474 | /* eina_hash_add(re->win->gl_context->shared->native_pm_hash, &pmid, im); */ | ||
1475 | |||
1476 | /* config_attrs[i++] = EGL_RED_SIZE; */ | ||
1477 | /* config_attrs[i++] = 8; */ | ||
1478 | /* config_attrs[i++] = EGL_GREEN_SIZE; */ | ||
1479 | /* config_attrs[i++] = 8; */ | ||
1480 | /* config_attrs[i++] = EGL_BLUE_SIZE; */ | ||
1481 | /* config_attrs[i++] = 8; */ | ||
1482 | /* config_attrs[i++] = EGL_ALPHA_SIZE; */ | ||
1483 | /* config_attrs[i++] = 8; */ | ||
1484 | /* config_attrs[i++] = EGL_DEPTH_SIZE; */ | ||
1485 | /* config_attrs[i++] = 0; */ | ||
1486 | /* config_attrs[i++] = EGL_STENCIL_SIZE; */ | ||
1487 | /* config_attrs[i++] = 0; */ | ||
1488 | /* config_attrs[i++] = EGL_RENDERABLE_TYPE; */ | ||
1489 | /* config_attrs[i++] = EGL_OPENGL_ES2_BIT; */ | ||
1490 | /* config_attrs[i++] = EGL_SURFACE_TYPE; */ | ||
1491 | /* config_attrs[i++] = EGL_PIXMAP_BIT; */ | ||
1492 | /* config_attrs[i++] = EGL_NONE; */ | ||
1493 | |||
1494 | /* if (!eglChooseConfig(re->win->egl_disp, config_attrs, */ | ||
1495 | /* &egl_config, 1, &num_config)) */ | ||
1496 | /* ERR("eglChooseConfig() failed for, num_config = %i", num_config); */ | ||
1497 | /* memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); */ | ||
1498 | /* n->pixmap = pm; */ | ||
1499 | /* if (glsym_eglCreateImage) */ | ||
1500 | /* n->egl_surface = glsym_eglCreateImage(re->win->egl_disp, */ | ||
1501 | /* EGL_NO_CONTEXT, */ | ||
1502 | /* EGL_NATIVE_PIXMAP_KHR, */ | ||
1503 | /* (void *)pm, */ | ||
1504 | /* NULL); */ | ||
1505 | /* else */ | ||
1506 | /* ERR("Try eglCreateImage on EGL with no support"); */ | ||
1507 | /* if (!n->egl_surface) */ | ||
1508 | /* ERR("eglCreatePixmapSurface() for 0x%x failed", (unsigned int)pm); */ | ||
1509 | /* im->native.yinvert = 1; */ | ||
1510 | /* im->native.loose = 0; */ | ||
1511 | /* im->native.data = n; */ | ||
1512 | /* im->native.func.data = re; */ | ||
1513 | /* im->native.func.bind = _native_bind_cb; */ | ||
1514 | /* im->native.func.unbind = _native_unbind_cb; */ | ||
1515 | /* im->native.func.free = _native_free_cb; */ | ||
1516 | /* im->native.target = GL_TEXTURE_2D; */ | ||
1517 | /* im->native.mipmap = 0; */ | ||
1518 | /* evas_gl_common_image_native_enable(im); */ | ||
1519 | /* } */ | ||
1520 | /* } */ | ||
1521 | return im; | ||
1522 | } | ||
1523 | |||
1524 | static void * | ||
1525 | eng_image_native_get(void *data __UNUSED__, void *image) | ||
1526 | { | ||
1527 | Evas_GL_Image *im = image; | ||
1528 | Native *n; | ||
1529 | if (!im) return NULL; | ||
1530 | n = im->native.data; | ||
1531 | if (!n) return NULL; | ||
1532 | return &(n->ns); | ||
1533 | } | ||
1534 | |||
1535 | #if 0 // filtering disabled | ||
1536 | static void | ||
1537 | eng_image_draw_filtered(void *data, void *context, void *surface, | ||
1538 | void *image, Evas_Filter_Info *filter) | ||
1539 | { | ||
1540 | Render_Engine *re = data; | ||
1541 | |||
1542 | if (!image) return; | ||
1543 | eng_window_use(re->win); | ||
1544 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | ||
1545 | re->win->gl_context->dc = context; | ||
1546 | |||
1547 | evas_gl_common_filter_draw(re->win->gl_context, image, filter); | ||
1548 | } | ||
1549 | |||
1550 | static Filtered_Image * | ||
1551 | eng_image_filtered_get(void *im, uint8_t *key, size_t keylen) | ||
1552 | { | ||
1553 | return evas_gl_common_image_filtered_get(im, key, keylen); | ||
1554 | } | ||
1555 | |||
1556 | static Filtered_Image * | ||
1557 | eng_image_filtered_save(void *im, void *fim, uint8_t *key, size_t keylen) | ||
1558 | { | ||
1559 | return evas_gl_common_image_filtered_save(im, fim, key, keylen); | ||
1560 | } | ||
1561 | |||
1562 | static void | ||
1563 | eng_image_filtered_free(void *im, Filtered_Image *fim) | ||
1564 | { | ||
1565 | evas_gl_common_image_filtered_free(im, fim); | ||
1566 | } | ||
1567 | #endif | ||
1568 | |||
1569 | static void * | ||
1570 | eng_image_load(void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo) | ||
1571 | { | ||
1572 | Render_Engine *re; | ||
1573 | |||
1574 | re = (Render_Engine *)data; | ||
1575 | *error = EVAS_LOAD_ERROR_NONE; | ||
1576 | eng_window_use(re->win); | ||
1577 | return evas_gl_common_image_load(re->win->gl_context, file, key, lo, error); | ||
1578 | } | ||
1579 | |||
1580 | static void * | ||
1581 | eng_image_new_from_data(void *data, int w, int h, DATA32 *image_data, int alpha, int cspace) | ||
1582 | { | ||
1583 | Render_Engine *re; | ||
1584 | |||
1585 | re = (Render_Engine *)data; | ||
1586 | eng_window_use(re->win); | ||
1587 | return evas_gl_common_image_new_from_data(re->win->gl_context, w, h, image_data, alpha, cspace); | ||
1588 | } | ||
1589 | |||
1590 | static void * | ||
1591 | eng_image_new_from_copied_data(void *data, int w, int h, DATA32 *image_data, int alpha, int cspace) | ||
1592 | { | ||
1593 | Render_Engine *re; | ||
1594 | |||
1595 | re = (Render_Engine *)data; | ||
1596 | eng_window_use(re->win); | ||
1597 | return evas_gl_common_image_new_from_copied_data(re->win->gl_context, w, h, image_data, alpha, cspace); | ||
1598 | } | ||
1599 | |||
1600 | static void | ||
1601 | eng_image_free(void *data, void *image) | ||
1602 | { | ||
1603 | Render_Engine *re; | ||
1604 | |||
1605 | re = (Render_Engine *)data; | ||
1606 | if (!image) return; | ||
1607 | eng_window_use(re->win); | ||
1608 | evas_gl_common_image_free(image); | ||
1609 | } | ||
1610 | |||
1611 | static void | ||
1612 | eng_image_size_get(void *data __UNUSED__, void *image, int *w, int *h) | ||
1613 | { | ||
1614 | if (!image) | ||
1615 | { | ||
1616 | *w = 0; | ||
1617 | *h = 0; | ||
1618 | return; | ||
1619 | } | ||
1620 | if (w) *w = ((Evas_GL_Image *)image)->w; | ||
1621 | if (h) *h = ((Evas_GL_Image *)image)->h; | ||
1622 | } | ||
1623 | |||
1624 | static void * | ||
1625 | eng_image_size_set(void *data, void *image, int w, int h) | ||
1626 | { | ||
1627 | Render_Engine *re; | ||
1628 | Evas_GL_Image *im = image; | ||
1629 | Evas_GL_Image *im_old; | ||
1630 | |||
1631 | re = (Render_Engine *)data; | ||
1632 | if (!im) return NULL; | ||
1633 | if (im->native.data) | ||
1634 | { | ||
1635 | im->w = w; | ||
1636 | im->h = h; | ||
1637 | return image; | ||
1638 | } | ||
1639 | eng_window_use(re->win); | ||
1640 | if ((im->tex) && (im->tex->pt->dyn.img)) | ||
1641 | { | ||
1642 | evas_gl_common_texture_free(im->tex); | ||
1643 | im->tex = NULL; | ||
1644 | im->w = w; | ||
1645 | im->h = h; | ||
1646 | im->tex = evas_gl_common_texture_dynamic_new(im->gc, im); | ||
1647 | return image; | ||
1648 | } | ||
1649 | im_old = image; | ||
1650 | |||
1651 | switch (eng_image_colorspace_get(data, image)) | ||
1652 | { | ||
1653 | case EVAS_COLORSPACE_YCBCR422P601_PL: | ||
1654 | case EVAS_COLORSPACE_YCBCR422P709_PL: | ||
1655 | case EVAS_COLORSPACE_YCBCR422601_PL: | ||
1656 | case EVAS_COLORSPACE_YCBCR420NV12601_PL: | ||
1657 | case EVAS_COLORSPACE_YCBCR420TM12601_PL: | ||
1658 | w &= ~0x1; | ||
1659 | break; | ||
1660 | } | ||
1661 | |||
1662 | if ((im_old) && | ||
1663 | ((int)im_old->im->cache_entry.w == w) && | ||
1664 | ((int)im_old->im->cache_entry.h == h)) | ||
1665 | return image; | ||
1666 | if (im_old) | ||
1667 | { | ||
1668 | im = evas_gl_common_image_new(re->win->gl_context, w, h, | ||
1669 | eng_image_alpha_get(data, image), | ||
1670 | eng_image_colorspace_get(data, image)); | ||
1671 | /* | ||
1672 | evas_common_load_image_data_from_file(im_old->im); | ||
1673 | if (im_old->im->image->data) | ||
1674 | { | ||
1675 | evas_common_blit_rectangle(im_old->im, im->im, 0, 0, w, h, 0, 0); | ||
1676 | evas_common_cpu_end_opt(); | ||
1677 | } | ||
1678 | */ | ||
1679 | evas_gl_common_image_free(im_old); | ||
1680 | } | ||
1681 | else | ||
1682 | im = evas_gl_common_image_new(re->win->gl_context, w, h, 1, EVAS_COLORSPACE_ARGB8888); | ||
1683 | return im; | ||
1684 | } | ||
1685 | |||
1686 | static void * | ||
1687 | eng_image_dirty_region(void *data, void *image, int x, int y, int w, int h) | ||
1688 | { | ||
1689 | Render_Engine *re; | ||
1690 | Evas_GL_Image *im = image; | ||
1691 | |||
1692 | re = (Render_Engine *)data; | ||
1693 | if (!image) return NULL; | ||
1694 | if (im->native.data) return image; | ||
1695 | eng_window_use(re->win); | ||
1696 | evas_gl_common_image_dirty(image, x, y, w, h); | ||
1697 | return image; | ||
1698 | } | ||
1699 | |||
1700 | static void * | ||
1701 | eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, int *err) | ||
1702 | { | ||
1703 | Render_Engine *re; | ||
1704 | Evas_GL_Image *im; | ||
1705 | int error; | ||
1706 | |||
1707 | re = (Render_Engine *)data; | ||
1708 | if (!image) | ||
1709 | { | ||
1710 | *image_data = NULL; | ||
1711 | if (err) *err = EVAS_LOAD_ERROR_GENERIC; | ||
1712 | return NULL; | ||
1713 | } | ||
1714 | im = image; | ||
1715 | if (im->native.data) | ||
1716 | { | ||
1717 | *image_data = NULL; | ||
1718 | if (err) *err = EVAS_LOAD_ERROR_NONE; | ||
1719 | return im; | ||
1720 | } | ||
1721 | |||
1722 | eng_window_use(re->win); | ||
1723 | |||
1724 | if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) && (im->cs.space == EVAS_COLORSPACE_ARGB8888)) | ||
1725 | { | ||
1726 | if (im->tex->pt->dyn.checked_out > 0) | ||
1727 | { | ||
1728 | im->tex->pt->dyn.checked_out++; | ||
1729 | *image_data = im->tex->pt->dyn.data; | ||
1730 | if (err) *err = EVAS_LOAD_ERROR_NONE; | ||
1731 | return im; | ||
1732 | } | ||
1733 | *image_data = im->tex->pt->dyn.data = glsym_eglMapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img); | ||
1734 | |||
1735 | if (!im->tex->pt->dyn.data) | ||
1736 | { | ||
1737 | if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
1738 | GLERR(__FUNCTION__, __FILE__, __LINE__, ""); | ||
1739 | return im; | ||
1740 | } | ||
1741 | im->tex->pt->dyn.checked_out++; | ||
1742 | |||
1743 | if (err) *err = EVAS_LOAD_ERROR_NONE; | ||
1744 | return im; | ||
1745 | } | ||
1746 | |||
1747 | /* Engine can fail to create texture after cache drop like eng_image_content_hint_set function, | ||
1748 | so it is need to add code which check im->im's NULL value*/ | ||
1749 | |||
1750 | if (!im->im) | ||
1751 | { | ||
1752 | *image_data = NULL; | ||
1753 | if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
1754 | return NULL; | ||
1755 | } | ||
1756 | |||
1757 | error = evas_cache_image_load_data(&im->im->cache_entry); | ||
1758 | switch (im->cs.space) | ||
1759 | { | ||
1760 | case EVAS_COLORSPACE_ARGB8888: | ||
1761 | if (to_write) | ||
1762 | { | ||
1763 | if (im->references > 1) | ||
1764 | { | ||
1765 | Evas_GL_Image *im_new; | ||
1766 | |||
1767 | im_new = evas_gl_common_image_new_from_copied_data | ||
1768 | (im->gc, im->im->cache_entry.w, im->im->cache_entry.h, | ||
1769 | im->im->image.data, | ||
1770 | eng_image_alpha_get(data, image), | ||
1771 | eng_image_colorspace_get(data, image)); | ||
1772 | if (!im_new) | ||
1773 | { | ||
1774 | *image_data = NULL; | ||
1775 | if (err) *err = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
1776 | return NULL; | ||
1777 | } | ||
1778 | evas_gl_common_image_free(im); | ||
1779 | im = im_new; | ||
1780 | } | ||
1781 | else | ||
1782 | evas_gl_common_image_dirty(im, 0, 0, 0, 0); | ||
1783 | } | ||
1784 | *image_data = im->im->image.data; | ||
1785 | break; | ||
1786 | case EVAS_COLORSPACE_YCBCR422P601_PL: | ||
1787 | case EVAS_COLORSPACE_YCBCR422P709_PL: | ||
1788 | case EVAS_COLORSPACE_YCBCR422601_PL: | ||
1789 | case EVAS_COLORSPACE_YCBCR420NV12601_PL: | ||
1790 | case EVAS_COLORSPACE_YCBCR420TM12601_PL: | ||
1791 | *image_data = im->cs.data; | ||
1792 | break; | ||
1793 | default: | ||
1794 | abort(); | ||
1795 | break; | ||
1796 | } | ||
1797 | if (err) *err = error; | ||
1798 | return im; | ||
1799 | } | ||
1800 | |||
1801 | static void * | ||
1802 | eng_image_data_put(void *data, void *image, DATA32 *image_data) | ||
1803 | { | ||
1804 | Render_Engine *re; | ||
1805 | Evas_GL_Image *im, *im2; | ||
1806 | |||
1807 | re = (Render_Engine *)data; | ||
1808 | if (!image) return NULL; | ||
1809 | im = image; | ||
1810 | if (im->native.data) return image; | ||
1811 | eng_window_use(re->win); | ||
1812 | if ((im->tex) && (im->tex->pt) | ||
1813 | && (im->tex->pt->dyn.data) | ||
1814 | && (im->cs.space == EVAS_COLORSPACE_ARGB8888)) | ||
1815 | { | ||
1816 | int w, h; | ||
1817 | |||
1818 | if (im->tex->pt->dyn.data == image_data) | ||
1819 | { | ||
1820 | im->tex->pt->dyn.checked_out--; | ||
1821 | if (im->tex->pt->dyn.checked_out == 0) | ||
1822 | glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img); | ||
1823 | return image; | ||
1824 | } | ||
1825 | |||
1826 | w = im->im->cache_entry.w; | ||
1827 | h = im->im->cache_entry.h; | ||
1828 | im2 = eng_image_new_from_data(data, w, h, image_data, | ||
1829 | eng_image_alpha_get(data, image), | ||
1830 | eng_image_colorspace_get(data, image)); | ||
1831 | if (!im2) return im; | ||
1832 | evas_gl_common_image_free(im); | ||
1833 | im = im2; | ||
1834 | evas_gl_common_image_dirty(im, 0, 0, 0, 0); | ||
1835 | return im; | ||
1836 | } | ||
1837 | switch (im->cs.space) | ||
1838 | { | ||
1839 | case EVAS_COLORSPACE_ARGB8888: | ||
1840 | if (image_data != im->im->image.data) | ||
1841 | { | ||
1842 | int w, h; | ||
1843 | |||
1844 | w = im->im->cache_entry.w; | ||
1845 | h = im->im->cache_entry.h; | ||
1846 | im2 = eng_image_new_from_data(data, w, h, image_data, | ||
1847 | eng_image_alpha_get(data, image), | ||
1848 | eng_image_colorspace_get(data, image)); | ||
1849 | if (!im2) return im; | ||
1850 | evas_gl_common_image_free(im); | ||
1851 | im = im2; | ||
1852 | } | ||
1853 | break; | ||
1854 | case EVAS_COLORSPACE_YCBCR422P601_PL: | ||
1855 | case EVAS_COLORSPACE_YCBCR422P709_PL: | ||
1856 | case EVAS_COLORSPACE_YCBCR422601_PL: | ||
1857 | case EVAS_COLORSPACE_YCBCR420NV12601_PL: | ||
1858 | case EVAS_COLORSPACE_YCBCR420TM12601_PL: | ||
1859 | if (image_data != im->cs.data) | ||
1860 | { | ||
1861 | if (im->cs.data) | ||
1862 | { | ||
1863 | if (!im->cs.no_free) free(im->cs.data); | ||
1864 | } | ||
1865 | im->cs.data = image_data; | ||
1866 | } | ||
1867 | evas_gl_common_image_dirty(im, 0, 0, 0, 0); | ||
1868 | break; | ||
1869 | default: | ||
1870 | abort(); | ||
1871 | break; | ||
1872 | } | ||
1873 | return im; | ||
1874 | } | ||
1875 | |||
1876 | static void | ||
1877 | eng_image_data_preload_request(void *data __UNUSED__, void *image, const void *target) | ||
1878 | { | ||
1879 | Evas_GL_Image *gim = image; | ||
1880 | RGBA_Image *im; | ||
1881 | |||
1882 | if (!gim) return; | ||
1883 | if (gim->native.data) return; | ||
1884 | im = (RGBA_Image *)gim->im; | ||
1885 | if (!im) return; | ||
1886 | evas_cache_image_preload_data(&im->cache_entry, target); | ||
1887 | } | ||
1888 | |||
1889 | static void | ||
1890 | eng_image_data_preload_cancel(void *data __UNUSED__, void *image, const void *target) | ||
1891 | { | ||
1892 | Evas_GL_Image *gim = image; | ||
1893 | RGBA_Image *im; | ||
1894 | |||
1895 | if (!gim) return; | ||
1896 | if (gim->native.data) return; | ||
1897 | im = (RGBA_Image *)gim->im; | ||
1898 | if (!im) return; | ||
1899 | evas_cache_image_preload_cancel(&im->cache_entry, target); | ||
1900 | } | ||
1901 | |||
1902 | static void | ||
1903 | eng_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) | ||
1904 | { | ||
1905 | Render_Engine *re; | ||
1906 | |||
1907 | re = (Render_Engine *)data; | ||
1908 | if (!image) return; | ||
1909 | eng_window_use(re->win); | ||
1910 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | ||
1911 | re->win->gl_context->dc = context; | ||
1912 | evas_gl_common_image_draw(re->win->gl_context, image, | ||
1913 | src_x, src_y, src_w, src_h, | ||
1914 | dst_x, dst_y, dst_w, dst_h, | ||
1915 | smooth); | ||
1916 | } | ||
1917 | |||
1918 | static void | ||
1919 | eng_image_scale_hint_set(void *data __UNUSED__, void *image, int hint) | ||
1920 | { | ||
1921 | if (image) evas_gl_common_image_scale_hint_set(image, hint); | ||
1922 | } | ||
1923 | |||
1924 | static int | ||
1925 | eng_image_scale_hint_get(void *data __UNUSED__, void *image) | ||
1926 | { | ||
1927 | Evas_GL_Image *gim = image; | ||
1928 | if (!gim) return EVAS_IMAGE_SCALE_HINT_NONE; | ||
1929 | return gim->scale_hint; | ||
1930 | } | ||
1931 | |||
1932 | static void | ||
1933 | eng_image_map_draw(void *data, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level) | ||
1934 | { | ||
1935 | Evas_GL_Image *gim = image; | ||
1936 | Render_Engine *re; | ||
1937 | |||
1938 | re = (Render_Engine *)data; | ||
1939 | if (!image) return; | ||
1940 | eng_window_use(re->win); | ||
1941 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | ||
1942 | re->win->gl_context->dc = context; | ||
1943 | if (npoints != 4) | ||
1944 | { | ||
1945 | // FIXME: nash - you didn't fix this | ||
1946 | abort(); | ||
1947 | } | ||
1948 | if ((p[0].x == p[3].x) && | ||
1949 | (p[1].x == p[2].x) && | ||
1950 | (p[0].y == p[1].y) && | ||
1951 | (p[3].y == p[2].y) && | ||
1952 | (p[0].x <= p[1].x) && | ||
1953 | (p[0].y <= p[2].y) && | ||
1954 | (p[0].u == 0) && | ||
1955 | (p[0].v == 0) && | ||
1956 | (p[1].u == (gim->w << FP)) && | ||
1957 | (p[1].v == 0) && | ||
1958 | (p[2].u == (gim->w << FP)) && | ||
1959 | (p[2].v == (gim->h << FP)) && | ||
1960 | (p[3].u == 0) && | ||
1961 | (p[3].v == (gim->h << FP)) && | ||
1962 | (p[0].col == 0xffffffff) && | ||
1963 | (p[1].col == 0xffffffff) && | ||
1964 | (p[2].col == 0xffffffff) && | ||
1965 | (p[3].col == 0xffffffff)) | ||
1966 | { | ||
1967 | int dx, dy, dw, dh; | ||
1968 | |||
1969 | dx = p[0].x >> FP; | ||
1970 | dy = p[0].y >> FP; | ||
1971 | dw = (p[2].x >> FP) - dx; | ||
1972 | dh = (p[2].y >> FP) - dy; | ||
1973 | eng_image_draw(data, context, surface, image, | ||
1974 | 0, 0, gim->w, gim->h, dx, dy, dw, dh, smooth); | ||
1975 | } | ||
1976 | else | ||
1977 | { | ||
1978 | evas_gl_common_image_map_draw(re->win->gl_context, image, npoints, p, | ||
1979 | smooth, level); | ||
1980 | } | ||
1981 | } | ||
1982 | |||
1983 | static void * | ||
1984 | eng_image_map_surface_new(void *data, int w, int h, int alpha) | ||
1985 | { | ||
1986 | Render_Engine *re; | ||
1987 | |||
1988 | re = (Render_Engine *)data; | ||
1989 | return evas_gl_common_image_surface_new(re->win->gl_context, w, h, alpha); | ||
1990 | } | ||
1991 | |||
1992 | static void | ||
1993 | eng_image_map_surface_free(void *data __UNUSED__, void *surface) | ||
1994 | { | ||
1995 | evas_gl_common_image_free(surface); | ||
1996 | } | ||
1997 | |||
1998 | static void | ||
1999 | eng_image_content_hint_set(void *data __UNUSED__, void *image, int hint) | ||
2000 | { | ||
2001 | if (image) evas_gl_common_image_content_hint_set(image, hint); | ||
2002 | } | ||
2003 | |||
2004 | static int | ||
2005 | eng_image_content_hint_get(void *data __UNUSED__, void *image) | ||
2006 | { | ||
2007 | Evas_GL_Image *gim = image; | ||
2008 | if (!gim) return EVAS_IMAGE_CONTENT_HINT_NONE; | ||
2009 | return gim->content_hint; | ||
2010 | } | ||
2011 | |||
2012 | static void | ||
2013 | eng_image_cache_flush(void *data) | ||
2014 | { | ||
2015 | Render_Engine *re; | ||
2016 | int tmp_size; | ||
2017 | |||
2018 | re = (Render_Engine *)data; | ||
2019 | |||
2020 | tmp_size = evas_common_image_get_cache(); | ||
2021 | evas_common_image_set_cache(0); | ||
2022 | evas_common_rgba_image_scalecache_flush(); | ||
2023 | evas_gl_common_image_cache_flush(re->win->gl_context); | ||
2024 | evas_common_image_set_cache(tmp_size); | ||
2025 | } | ||
2026 | |||
2027 | static void | ||
2028 | eng_image_cache_set(void *data, int bytes) | ||
2029 | { | ||
2030 | Render_Engine *re; | ||
2031 | |||
2032 | re = (Render_Engine *)data; | ||
2033 | evas_common_image_set_cache(bytes); | ||
2034 | evas_common_rgba_image_scalecache_size_set(bytes); | ||
2035 | evas_gl_common_image_cache_flush(re->win->gl_context); | ||
2036 | } | ||
2037 | |||
2038 | static int | ||
2039 | eng_image_cache_get(void *data __UNUSED__) | ||
2040 | { | ||
2041 | return evas_common_image_get_cache(); | ||
2042 | } | ||
2043 | |||
2044 | static void | ||
2045 | eng_image_stride_get(void *data __UNUSED__, void *image, int *stride) | ||
2046 | { | ||
2047 | Evas_GL_Image *im = image; | ||
2048 | |||
2049 | if ((im->tex) && (im->tex->pt->dyn.img)) | ||
2050 | *stride = im->tex->pt->dyn.stride; | ||
2051 | else | ||
2052 | *stride = im->w * 4; | ||
2053 | } | ||
2054 | |||
2055 | static void | ||
2056 | eng_font_draw(void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const Evas_Text_Props *intl_props) | ||
2057 | { | ||
2058 | Render_Engine *re; | ||
2059 | |||
2060 | re = (Render_Engine *)data; | ||
2061 | eng_window_use(re->win); | ||
2062 | evas_gl_common_context_target_surface_set(re->win->gl_context, surface); | ||
2063 | re->win->gl_context->dc = context; | ||
2064 | { | ||
2065 | // FIXME: put im into context so we can free it | ||
2066 | static RGBA_Image *im = NULL; | ||
2067 | |||
2068 | if (!im) | ||
2069 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
2070 | im->cache_entry.w = re->win->w; | ||
2071 | im->cache_entry.h = re->win->h; | ||
2072 | evas_common_draw_context_font_ext_set(context, | ||
2073 | re->win->gl_context, | ||
2074 | evas_gl_font_texture_new, | ||
2075 | evas_gl_font_texture_free, | ||
2076 | evas_gl_font_texture_draw); | ||
2077 | evas_common_font_draw(im, context, (RGBA_Font *) font, x, y, | ||
2078 | intl_props); | ||
2079 | evas_common_draw_context_font_ext_set(context, NULL, NULL, NULL, NULL); | ||
2080 | } | ||
2081 | } | ||
2082 | |||
2083 | static Eina_Bool | ||
2084 | eng_canvas_alpha_get(void *data, void *info __UNUSED__) | ||
2085 | { | ||
2086 | Render_Engine *re = (Render_Engine *)data; | ||
2087 | return re->win->alpha; | ||
2088 | } | ||
2089 | |||
2090 | static int | ||
2091 | _set_internal_config(Render_Engine_GL_Surface *sfc, Evas_GL_Config *cfg) | ||
2092 | { | ||
2093 | // Also initialize pixel format here as well... | ||
2094 | switch(cfg->color_format) | ||
2095 | { | ||
2096 | case EVAS_GL_RGB_888: | ||
2097 | sfc->rt_fmt = GL_RGB; | ||
2098 | sfc->rt_internal_fmt = GL_RGB; | ||
2099 | break; | ||
2100 | case EVAS_GL_RGBA_8888: | ||
2101 | sfc->rt_fmt = GL_RGBA; | ||
2102 | sfc->rt_internal_fmt = GL_RGBA; | ||
2103 | break; | ||
2104 | default: | ||
2105 | ERR("Invalid Color Format!"); | ||
2106 | return 0; | ||
2107 | } | ||
2108 | |||
2109 | switch(cfg->depth_bits) | ||
2110 | { | ||
2111 | case EVAS_GL_DEPTH_NONE: | ||
2112 | break; | ||
2113 | case EVAS_GL_DEPTH_BIT_8: | ||
2114 | case EVAS_GL_DEPTH_BIT_16: | ||
2115 | case EVAS_GL_DEPTH_BIT_24: | ||
2116 | // 24 bit doesn't work... just cover it with 16 for now.. | ||
2117 | sfc->rb_depth_fmt = GL_DEPTH_COMPONENT16; | ||
2118 | break; | ||
2119 | case EVAS_GL_DEPTH_BIT_32: | ||
2120 | default: | ||
2121 | ERR("Unsupported Depth Bits Format!"); | ||
2122 | return 0; | ||
2123 | } | ||
2124 | |||
2125 | switch(cfg->stencil_bits) | ||
2126 | { | ||
2127 | case EVAS_GL_STENCIL_NONE: | ||
2128 | break; | ||
2129 | case EVAS_GL_STENCIL_BIT_1: | ||
2130 | case EVAS_GL_STENCIL_BIT_2: | ||
2131 | case EVAS_GL_STENCIL_BIT_4: | ||
2132 | case EVAS_GL_STENCIL_BIT_8: | ||
2133 | sfc->rb_stencil_fmt = GL_STENCIL_INDEX8; | ||
2134 | break; | ||
2135 | case EVAS_GL_STENCIL_BIT_16: | ||
2136 | default: | ||
2137 | ERR("Unsupported Stencil Bits Format!"); | ||
2138 | return 0; | ||
2139 | } | ||
2140 | |||
2141 | // Do Packed Depth24_Stencil8 Later... | ||
2142 | |||
2143 | return 1; | ||
2144 | } | ||
2145 | |||
2146 | static int | ||
2147 | _create_rt_buffers(Render_Engine *data __UNUSED__, | ||
2148 | Render_Engine_GL_Surface *sfc) | ||
2149 | { | ||
2150 | // Render Target texture | ||
2151 | glGenTextures(1, &sfc->rt_tex ); | ||
2152 | |||
2153 | // Depth RenderBuffer - Create storage here... | ||
2154 | if (sfc->depth_bits != EVAS_GL_DEPTH_NONE) | ||
2155 | glGenRenderbuffers(1, &sfc->rb_depth); | ||
2156 | |||
2157 | // Stencil RenderBuffer - Create Storage here... | ||
2158 | if (sfc->stencil_bits != EVAS_GL_STENCIL_NONE) | ||
2159 | glGenRenderbuffers(1, &sfc->rb_stencil); | ||
2160 | |||
2161 | return 1; | ||
2162 | } | ||
2163 | |||
2164 | static int | ||
2165 | _attach_fbo_surface(Render_Engine *data __UNUSED__, | ||
2166 | Render_Engine_GL_Surface *sfc, | ||
2167 | Render_Engine_GL_Context *ctx) | ||
2168 | { | ||
2169 | int fb_status; | ||
2170 | |||
2171 | // Initialize Texture | ||
2172 | glBindTexture(GL_TEXTURE_2D, sfc->rt_tex ); | ||
2173 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | ||
2174 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | ||
2175 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | ||
2176 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | ||
2177 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sfc->w, sfc->h, 0, | ||
2178 | GL_RGBA, GL_UNSIGNED_BYTE, NULL); | ||
2179 | glBindTexture(GL_TEXTURE_2D, 0); | ||
2180 | |||
2181 | |||
2182 | // Attach texture to FBO | ||
2183 | glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo); | ||
2184 | glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, | ||
2185 | GL_TEXTURE_2D, sfc->rt_tex, 0); | ||
2186 | |||
2187 | // Depth RenderBuffer - Attach it to FBO | ||
2188 | if (sfc->depth_bits != EVAS_GL_DEPTH_NONE) | ||
2189 | { | ||
2190 | glBindRenderbuffer(GL_RENDERBUFFER, sfc->rb_depth); | ||
2191 | glRenderbufferStorage(GL_RENDERBUFFER, sfc->rb_depth_fmt, | ||
2192 | sfc->w, sfc->h); | ||
2193 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, | ||
2194 | GL_RENDERBUFFER, sfc->rb_depth); | ||
2195 | glBindRenderbuffer(GL_RENDERBUFFER, 0); | ||
2196 | } | ||
2197 | |||
2198 | // Stencil RenderBuffer - Attach it to FBO | ||
2199 | if (sfc->stencil_bits != EVAS_GL_STENCIL_NONE) | ||
2200 | { | ||
2201 | glBindRenderbuffer(GL_RENDERBUFFER, sfc->rb_stencil); | ||
2202 | glRenderbufferStorage(GL_RENDERBUFFER, sfc->rb_stencil_fmt, | ||
2203 | sfc->w, sfc->h); | ||
2204 | glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, | ||
2205 | GL_RENDERBUFFER, sfc->rb_stencil); | ||
2206 | glBindRenderbuffer(GL_RENDERBUFFER, 0); | ||
2207 | } | ||
2208 | |||
2209 | // Check FBO for completeness | ||
2210 | fb_status = glCheckFramebufferStatus(GL_FRAMEBUFFER); | ||
2211 | if (fb_status != GL_FRAMEBUFFER_COMPLETE) | ||
2212 | { | ||
2213 | ERR("FBO not complete!"); | ||
2214 | return 0; | ||
2215 | } | ||
2216 | |||
2217 | return 1; | ||
2218 | } | ||
2219 | |||
2220 | |||
2221 | static void * | ||
2222 | eng_gl_surface_create(void *data, void *config, int w, int h) | ||
2223 | { | ||
2224 | Render_Engine *re; | ||
2225 | Render_Engine_GL_Surface *sfc; | ||
2226 | Render_Engine_GL_Resource *rsc; | ||
2227 | Evas_GL_Config *cfg; | ||
2228 | int ret; | ||
2229 | |||
2230 | sfc = calloc(1, sizeof(Render_Engine_GL_Surface)); | ||
2231 | if (!sfc) return NULL; | ||
2232 | |||
2233 | re = (Render_Engine *)data; | ||
2234 | cfg = (Evas_GL_Config *)config; | ||
2235 | |||
2236 | sfc->initialized = 0; | ||
2237 | sfc->fbo_attached = 0; | ||
2238 | sfc->w = w; | ||
2239 | sfc->h = h; | ||
2240 | sfc->depth_bits = cfg->depth_bits; | ||
2241 | sfc->stencil_bits = cfg->stencil_bits; | ||
2242 | sfc->rt_tex = 0; | ||
2243 | sfc->rb_depth = 0; | ||
2244 | sfc->rb_stencil = 0; | ||
2245 | |||
2246 | // Set the internal format based on the config | ||
2247 | if (!_set_internal_config(sfc, cfg)) | ||
2248 | { | ||
2249 | ERR("Unsupported Format!"); | ||
2250 | free(sfc); | ||
2251 | return NULL; | ||
2252 | } | ||
2253 | |||
2254 | // Create internal resource context if it hasn't been created already | ||
2255 | if ((rsc = eina_tls_get(resource_key)) == NULL) | ||
2256 | { | ||
2257 | if ((rsc = _create_internal_glue_resources(re)) == NULL) | ||
2258 | { | ||
2259 | ERR("Error creating internal resources."); | ||
2260 | free(sfc); | ||
2261 | return NULL; | ||
2262 | } | ||
2263 | } | ||
2264 | |||
2265 | // I'm using evas's original context to create the render target texture | ||
2266 | // This is to prevent awkwardness in using native_surface_get() function | ||
2267 | // If the rt texture creation is deferred till the context is created and | ||
2268 | // make_current called, the user can't call native_surface_get() right | ||
2269 | // after the surface is created. hence this is done here using evas' context. | ||
2270 | ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface, rsc->context); | ||
2271 | if (!ret) | ||
2272 | { | ||
2273 | ERR("xxxMakeCurrent() failed!"); | ||
2274 | free(sfc); | ||
2275 | return NULL; | ||
2276 | } | ||
2277 | |||
2278 | // Create Render texture | ||
2279 | if (!_create_rt_buffers(re, sfc)) | ||
2280 | { | ||
2281 | ERR("_create_rt_buffers() failed."); | ||
2282 | free(sfc); | ||
2283 | return NULL; | ||
2284 | } | ||
2285 | |||
2286 | ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
2287 | if (!ret) | ||
2288 | { | ||
2289 | ERR("xxxMakeCurrent() failed!"); | ||
2290 | free(sfc); | ||
2291 | return NULL; | ||
2292 | } | ||
2293 | |||
2294 | return sfc; | ||
2295 | } | ||
2296 | |||
2297 | static int | ||
2298 | eng_gl_surface_destroy(void *data, void *surface) | ||
2299 | { | ||
2300 | Render_Engine *re; | ||
2301 | Render_Engine_GL_Surface *sfc; | ||
2302 | Render_Engine_GL_Resource *rsc; | ||
2303 | int ret; | ||
2304 | |||
2305 | re = (Render_Engine *)data; | ||
2306 | sfc = (Render_Engine_GL_Surface*)surface; | ||
2307 | |||
2308 | if (!sfc) return 0; | ||
2309 | |||
2310 | if ((rsc = eina_tls_get(resource_key)) == EINA_FALSE) return 0; | ||
2311 | |||
2312 | ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, rsc->surface, rsc->context); | ||
2313 | if (!ret) | ||
2314 | { | ||
2315 | ERR("xxxMakeCurrent() failed!"); | ||
2316 | return 0; | ||
2317 | } | ||
2318 | |||
2319 | // Delete FBO/RBO and Texture here | ||
2320 | if (sfc->rt_tex) | ||
2321 | glDeleteTextures(1, &sfc->rt_tex); | ||
2322 | |||
2323 | if (sfc->rb_depth) | ||
2324 | glDeleteRenderbuffers(1, &sfc->rb_depth); | ||
2325 | |||
2326 | if (sfc->rb_stencil) | ||
2327 | glDeleteRenderbuffers(1, &sfc->rb_stencil); | ||
2328 | |||
2329 | ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
2330 | if (!ret) | ||
2331 | { | ||
2332 | ERR("xxxMakeCurrent() failed!"); | ||
2333 | free(sfc); | ||
2334 | return 0; | ||
2335 | } | ||
2336 | |||
2337 | free(sfc); | ||
2338 | surface = NULL; | ||
2339 | |||
2340 | return 1; | ||
2341 | } | ||
2342 | |||
2343 | static void * | ||
2344 | eng_gl_context_create(void *data, void *share_context) | ||
2345 | { | ||
2346 | Render_Engine *re; | ||
2347 | Render_Engine_GL_Context *ctx; | ||
2348 | Render_Engine_GL_Context *share_ctx; | ||
2349 | int context_attrs[3]; | ||
2350 | |||
2351 | ctx = calloc(1, sizeof(Render_Engine_GL_Context)); | ||
2352 | |||
2353 | if (!ctx) return NULL; | ||
2354 | |||
2355 | re = (Render_Engine *)data; | ||
2356 | share_ctx = (Render_Engine_GL_Context *)share_context; | ||
2357 | |||
2358 | // Set the share context to Evas' GL context if share_context is NULL. | ||
2359 | // Otherwise set it to the given share_context. | ||
2360 | |||
2361 | // EGL | ||
2362 | context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION; | ||
2363 | context_attrs[1] = 2; | ||
2364 | context_attrs[2] = EGL_NONE; | ||
2365 | |||
2366 | if (share_ctx) | ||
2367 | { | ||
2368 | ctx->context = eglCreateContext(re->win->egl_disp, | ||
2369 | re->win->egl_config, | ||
2370 | share_ctx->context, // Share Context | ||
2371 | context_attrs); | ||
2372 | } | ||
2373 | else | ||
2374 | { | ||
2375 | ctx->context = eglCreateContext(re->win->egl_disp, | ||
2376 | re->win->egl_config, | ||
2377 | re->win->egl_context[0], // Evas' GL Context | ||
2378 | context_attrs); | ||
2379 | } | ||
2380 | |||
2381 | if (!ctx->context) | ||
2382 | { | ||
2383 | ERR("eglCreateContext() fail. code=%#x", eglGetError()); | ||
2384 | return NULL; | ||
2385 | } | ||
2386 | |||
2387 | ctx->initialized = 0; | ||
2388 | ctx->context_fbo = 0; | ||
2389 | ctx->current_sfc = NULL; | ||
2390 | |||
2391 | return ctx; | ||
2392 | } | ||
2393 | |||
2394 | static int | ||
2395 | eng_gl_context_destroy(void *data, void *context) | ||
2396 | { | ||
2397 | Render_Engine *re; | ||
2398 | Render_Engine_GL_Context *ctx; | ||
2399 | Render_Engine_GL_Resource *rsc; | ||
2400 | int ret; | ||
2401 | |||
2402 | re = (Render_Engine *)data; | ||
2403 | ctx = (Render_Engine_GL_Context*)context; | ||
2404 | |||
2405 | if (!ctx) return 0; | ||
2406 | |||
2407 | if ((rsc = eina_tls_get(resource_key)) == EINA_FALSE) return 0; | ||
2408 | |||
2409 | // 1. Do a make current with the given context | ||
2410 | ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, | ||
2411 | rsc->surface, ctx->context); | ||
2412 | if (!ret) | ||
2413 | { | ||
2414 | ERR("xxxMakeCurrent() failed!"); | ||
2415 | return 0; | ||
2416 | } | ||
2417 | |||
2418 | // 2. Delete the FBO | ||
2419 | if (ctx->context_fbo) | ||
2420 | glDeleteFramebuffers(1, &ctx->context_fbo); | ||
2421 | |||
2422 | // 3. Destroy the Context | ||
2423 | eglDestroyContext(re->win->egl_disp, ctx->context); | ||
2424 | |||
2425 | ctx->context = EGL_NO_CONTEXT; | ||
2426 | |||
2427 | ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, | ||
2428 | EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
2429 | if (!ret) | ||
2430 | { | ||
2431 | ERR("xxxMakeCurrent() failed!"); | ||
2432 | return 0; | ||
2433 | } | ||
2434 | |||
2435 | free(ctx); | ||
2436 | context = NULL; | ||
2437 | |||
2438 | return 1; | ||
2439 | } | ||
2440 | |||
2441 | static int | ||
2442 | eng_gl_make_current(void *data __UNUSED__, void *surface, void *context) | ||
2443 | { | ||
2444 | Render_Engine *re; | ||
2445 | Render_Engine_GL_Surface *sfc; | ||
2446 | Render_Engine_GL_Context *ctx; | ||
2447 | int ret = 0; | ||
2448 | Render_Engine_GL_Resource *rsc; | ||
2449 | |||
2450 | re = (Render_Engine *)data; | ||
2451 | sfc = (Render_Engine_GL_Surface*)surface; | ||
2452 | ctx = (Render_Engine_GL_Context*)context; | ||
2453 | |||
2454 | // Unset surface/context | ||
2455 | if ((!sfc) || (!ctx)) | ||
2456 | { | ||
2457 | ret = eglMakeCurrent(re->win->egl_disp, EGL_NO_SURFACE, | ||
2458 | EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
2459 | if (!ret) | ||
2460 | { | ||
2461 | ERR("xxxMakeCurrent() failed!"); | ||
2462 | return 0; | ||
2463 | } | ||
2464 | |||
2465 | if (ctx) ctx->current_sfc = NULL; | ||
2466 | if (sfc) sfc->current_ctx = NULL; | ||
2467 | current_evgl_ctx = NULL; | ||
2468 | return 1; | ||
2469 | } | ||
2470 | |||
2471 | // Do a make current only if it's not already current | ||
2472 | if ((rsc = eina_tls_get(resource_key)) == EINA_FALSE) return 0; | ||
2473 | |||
2474 | if ((eglGetCurrentContext() != ctx->context) || | ||
2475 | (eglGetCurrentSurface(EGL_READ) != rsc->surface) || | ||
2476 | (eglGetCurrentSurface(EGL_DRAW) != rsc->surface) ) | ||
2477 | { | ||
2478 | // Flush remainder of what's in Evas' pipeline | ||
2479 | if (re->win) eng_window_use(NULL); | ||
2480 | |||
2481 | // Do a make current | ||
2482 | ret = eglMakeCurrent(re->win->egl_disp, rsc->surface, | ||
2483 | rsc->surface, ctx->context); | ||
2484 | if (!ret) | ||
2485 | { | ||
2486 | ERR("xxxMakeCurrent() failed!"); | ||
2487 | return 0; | ||
2488 | } | ||
2489 | } | ||
2490 | |||
2491 | // Create FBO if not already created | ||
2492 | if (!ctx->initialized) | ||
2493 | { | ||
2494 | glGenFramebuffers(1, &ctx->context_fbo); | ||
2495 | ctx->initialized = 1; | ||
2496 | } | ||
2497 | |||
2498 | // Attach FBO if it hasn't been attached or if surface changed | ||
2499 | if ((!sfc->fbo_attached) || (ctx->current_sfc != sfc)) | ||
2500 | { | ||
2501 | if (!_attach_fbo_surface(re, sfc, ctx)) | ||
2502 | { | ||
2503 | ERR("_attach_fbo_surface() failed."); | ||
2504 | return 0; | ||
2505 | } | ||
2506 | |||
2507 | if (ctx->current_fbo) | ||
2508 | // Bind to the previously bound buffer | ||
2509 | glBindFramebuffer(GL_FRAMEBUFFER, ctx->current_fbo); | ||
2510 | else | ||
2511 | // Bind FBO | ||
2512 | glBindFramebuffer(GL_FRAMEBUFFER, ctx->context_fbo); | ||
2513 | |||
2514 | sfc->fbo_attached = 1; | ||
2515 | } | ||
2516 | |||
2517 | // Set the current surface/context | ||
2518 | ctx->current_sfc = sfc; | ||
2519 | sfc->current_ctx = ctx; | ||
2520 | current_evgl_ctx = ctx; | ||
2521 | |||
2522 | return 1; | ||
2523 | } | ||
2524 | |||
2525 | static void * | ||
2526 | eng_gl_string_query(void *data __UNUSED__, int name) | ||
2527 | { | ||
2528 | switch(name) | ||
2529 | { | ||
2530 | case EVAS_GL_EXTENSIONS: | ||
2531 | return (void*)_evasgl_ext_string; | ||
2532 | default: | ||
2533 | return NULL; | ||
2534 | }; | ||
2535 | } | ||
2536 | |||
2537 | static void * | ||
2538 | eng_gl_proc_address_get(void *data __UNUSED__, const char *name) | ||
2539 | { | ||
2540 | if (glsym_eglGetProcAddress) return glsym_eglGetProcAddress(name); | ||
2541 | return dlsym(RTLD_DEFAULT, name); | ||
2542 | } | ||
2543 | |||
2544 | static int | ||
2545 | eng_gl_native_surface_get(void *data, void *surface, void *native_surface) | ||
2546 | { | ||
2547 | Render_Engine *re; | ||
2548 | Render_Engine_GL_Surface *sfc; | ||
2549 | Evas_Native_Surface *ns; | ||
2550 | |||
2551 | re = (Render_Engine *)data; | ||
2552 | sfc = (Render_Engine_GL_Surface*)surface; | ||
2553 | ns = (Evas_Native_Surface*)native_surface; | ||
2554 | |||
2555 | ns->type = EVAS_NATIVE_SURFACE_OPENGL; | ||
2556 | ns->version = EVAS_NATIVE_SURFACE_VERSION; | ||
2557 | ns->data.opengl.texture_id = sfc->rt_tex; | ||
2558 | ns->data.opengl.x = 0; | ||
2559 | ns->data.opengl.y = 0; | ||
2560 | ns->data.opengl.w = sfc->w; | ||
2561 | ns->data.opengl.h = sfc->h; | ||
2562 | |||
2563 | return 1; | ||
2564 | } | ||
2565 | |||
2566 | |||
2567 | static const GLubyte * | ||
2568 | evgl_glGetString(GLenum name) | ||
2569 | { | ||
2570 | if (name == GL_EXTENSIONS) | ||
2571 | return (GLubyte *)_gl_ext_string; //glGetString(GL_EXTENSIONS); | ||
2572 | else | ||
2573 | return glGetString(name); | ||
2574 | } | ||
2575 | |||
2576 | static void | ||
2577 | evgl_glBindFramebuffer(GLenum target, GLuint framebuffer) | ||
2578 | { | ||
2579 | Render_Engine_GL_Context *ctx = current_evgl_ctx; | ||
2580 | |||
2581 | // Take care of BindFramebuffer 0 issue | ||
2582 | if (framebuffer==0) | ||
2583 | { | ||
2584 | if (ctx) | ||
2585 | { | ||
2586 | glBindFramebuffer(target, ctx->context_fbo); | ||
2587 | ctx->current_fbo = 0; | ||
2588 | } | ||
2589 | } | ||
2590 | else | ||
2591 | { | ||
2592 | glBindFramebuffer(target, framebuffer); | ||
2593 | |||
2594 | // Save this for restore when doing make current | ||
2595 | if (ctx) | ||
2596 | ctx->current_fbo = framebuffer; | ||
2597 | } | ||
2598 | } | ||
2599 | |||
2600 | static void | ||
2601 | evgl_glBindRenderbuffer(GLenum target, GLuint renderbuffer) | ||
2602 | { | ||
2603 | // Add logic to take care when renderbuffer=0 | ||
2604 | // On a second thought we don't need this | ||
2605 | glBindRenderbuffer(target, renderbuffer); | ||
2606 | } | ||
2607 | |||
2608 | static void | ||
2609 | evgl_glClearDepthf(GLclampf depth) | ||
2610 | { | ||
2611 | glClearDepthf(depth); | ||
2612 | } | ||
2613 | |||
2614 | static void | ||
2615 | evgl_glDepthRangef(GLclampf zNear, GLclampf zFar) | ||
2616 | { | ||
2617 | glDepthRangef(zNear, zFar); | ||
2618 | } | ||
2619 | |||
2620 | static void | ||
2621 | evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) | ||
2622 | { | ||
2623 | glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); | ||
2624 | } | ||
2625 | |||
2626 | static void | ||
2627 | evgl_glReleaseShaderCompiler(void) | ||
2628 | { | ||
2629 | glReleaseShaderCompiler(); | ||
2630 | } | ||
2631 | |||
2632 | static void | ||
2633 | evgl_glShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) | ||
2634 | { | ||
2635 | glShaderBinary(n, shaders, binaryformat, binary, length); | ||
2636 | } | ||
2637 | |||
2638 | //--------------------------------// | ||
2639 | //#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) | ||
2640 | // EGL Extensions | ||
2641 | static void * | ||
2642 | evgl_evasglCreateImage(int target, void* buffer, int *attrib_list) | ||
2643 | { | ||
2644 | if (current_engine) | ||
2645 | { | ||
2646 | return glsym_eglCreateImage(current_engine->win->egl_disp, | ||
2647 | EGL_NO_CONTEXT, | ||
2648 | target, | ||
2649 | buffer, | ||
2650 | attrib_list); | ||
2651 | } | ||
2652 | else | ||
2653 | { | ||
2654 | ERR("Invalid Engine... (Can't acccess EGL Display)\n"); | ||
2655 | return NULL; | ||
2656 | } | ||
2657 | } | ||
2658 | |||
2659 | static void | ||
2660 | evgl_evasglDestroyImage(EvasGLImage image) | ||
2661 | { | ||
2662 | if (current_engine) | ||
2663 | glsym_eglDestroyImage(current_engine->win->egl_disp, image); | ||
2664 | else | ||
2665 | ERR("Invalid Engine... (Can't acccess EGL Display)\n"); | ||
2666 | } | ||
2667 | |||
2668 | static void | ||
2669 | evgl_glEvasGLImageTargetTexture2DOES(GLenum target, EvasGLImage image) | ||
2670 | { | ||
2671 | glsym_glEGLImageTargetTexture2DOES(target, image); | ||
2672 | } | ||
2673 | |||
2674 | static void | ||
2675 | evgl_glEvasGLImageTargetRenderbufferStorageOES(GLenum target, EvasGLImage image) | ||
2676 | { | ||
2677 | glsym_glEGLImageTargetTexture2DOES(target, image); | ||
2678 | } | ||
2679 | |||
2680 | //--------------------------------// | ||
2681 | |||
2682 | |||
2683 | static void * | ||
2684 | eng_gl_api_get(void *data) | ||
2685 | { | ||
2686 | Render_Engine *re; | ||
2687 | |||
2688 | re = (Render_Engine *)data; | ||
2689 | |||
2690 | gl_funcs.version = EVAS_GL_API_VERSION; | ||
2691 | |||
2692 | #define ORD(f) EVAS_API_OVERRIDE(f, &gl_funcs, ) | ||
2693 | // GLES 2.0 | ||
2694 | ORD(glActiveTexture); | ||
2695 | ORD(glAttachShader); | ||
2696 | ORD(glBindAttribLocation); | ||
2697 | ORD(glBindBuffer); | ||
2698 | ORD(glBindTexture); | ||
2699 | ORD(glBlendColor); | ||
2700 | ORD(glBlendEquation); | ||
2701 | ORD(glBlendEquationSeparate); | ||
2702 | ORD(glBlendFunc); | ||
2703 | ORD(glBlendFuncSeparate); | ||
2704 | ORD(glBufferData); | ||
2705 | ORD(glBufferSubData); | ||
2706 | ORD(glCheckFramebufferStatus); | ||
2707 | ORD(glClear); | ||
2708 | ORD(glClearColor); | ||
2709 | // ORD(glClearDepthf); | ||
2710 | ORD(glClearStencil); | ||
2711 | ORD(glColorMask); | ||
2712 | ORD(glCompileShader); | ||
2713 | ORD(glCompressedTexImage2D); | ||
2714 | ORD(glCompressedTexSubImage2D); | ||
2715 | ORD(glCopyTexImage2D); | ||
2716 | ORD(glCopyTexSubImage2D); | ||
2717 | ORD(glCreateProgram); | ||
2718 | ORD(glCreateShader); | ||
2719 | ORD(glCullFace); | ||
2720 | ORD(glDeleteBuffers); | ||
2721 | ORD(glDeleteFramebuffers); | ||
2722 | ORD(glDeleteProgram); | ||
2723 | ORD(glDeleteRenderbuffers); | ||
2724 | ORD(glDeleteShader); | ||
2725 | ORD(glDeleteTextures); | ||
2726 | ORD(glDepthFunc); | ||
2727 | ORD(glDepthMask); | ||
2728 | // ORD(glDepthRangef); | ||
2729 | ORD(glDetachShader); | ||
2730 | ORD(glDisable); | ||
2731 | ORD(glDisableVertexAttribArray); | ||
2732 | ORD(glDrawArrays); | ||
2733 | ORD(glDrawElements); | ||
2734 | ORD(glEnable); | ||
2735 | ORD(glEnableVertexAttribArray); | ||
2736 | ORD(glFinish); | ||
2737 | ORD(glFlush); | ||
2738 | ORD(glFramebufferRenderbuffer); | ||
2739 | ORD(glFramebufferTexture2D); | ||
2740 | ORD(glFrontFace); | ||
2741 | ORD(glGenBuffers); | ||
2742 | ORD(glGenerateMipmap); | ||
2743 | ORD(glGenFramebuffers); | ||
2744 | ORD(glGenRenderbuffers); | ||
2745 | ORD(glGenTextures); | ||
2746 | ORD(glGetActiveAttrib); | ||
2747 | ORD(glGetActiveUniform); | ||
2748 | ORD(glGetAttachedShaders); | ||
2749 | ORD(glGetAttribLocation); | ||
2750 | ORD(glGetBooleanv); | ||
2751 | ORD(glGetBufferParameteriv); | ||
2752 | ORD(glGetError); | ||
2753 | ORD(glGetFloatv); | ||
2754 | ORD(glGetFramebufferAttachmentParameteriv); | ||
2755 | ORD(glGetIntegerv); | ||
2756 | ORD(glGetProgramiv); | ||
2757 | ORD(glGetProgramInfoLog); | ||
2758 | ORD(glGetRenderbufferParameteriv); | ||
2759 | ORD(glGetShaderiv); | ||
2760 | ORD(glGetShaderInfoLog); | ||
2761 | // ORD(glGetShaderPrecisionFormat); | ||
2762 | ORD(glGetShaderSource); | ||
2763 | // ORD(glGetString); | ||
2764 | ORD(glGetTexParameterfv); | ||
2765 | ORD(glGetTexParameteriv); | ||
2766 | ORD(glGetUniformfv); | ||
2767 | ORD(glGetUniformiv); | ||
2768 | ORD(glGetUniformLocation); | ||
2769 | ORD(glGetVertexAttribfv); | ||
2770 | ORD(glGetVertexAttribiv); | ||
2771 | ORD(glGetVertexAttribPointerv); | ||
2772 | ORD(glHint); | ||
2773 | ORD(glIsBuffer); | ||
2774 | ORD(glIsEnabled); | ||
2775 | ORD(glIsFramebuffer); | ||
2776 | ORD(glIsProgram); | ||
2777 | ORD(glIsRenderbuffer); | ||
2778 | ORD(glIsShader); | ||
2779 | ORD(glIsTexture); | ||
2780 | ORD(glLineWidth); | ||
2781 | ORD(glLinkProgram); | ||
2782 | ORD(glPixelStorei); | ||
2783 | ORD(glPolygonOffset); | ||
2784 | ORD(glReadPixels); | ||
2785 | // ORD(glReleaseShaderCompiler); | ||
2786 | ORD(glRenderbufferStorage); | ||
2787 | ORD(glSampleCoverage); | ||
2788 | ORD(glScissor); | ||
2789 | // ORD(glShaderBinary); | ||
2790 | ORD(glShaderSource); | ||
2791 | ORD(glStencilFunc); | ||
2792 | ORD(glStencilFuncSeparate); | ||
2793 | ORD(glStencilMask); | ||
2794 | ORD(glStencilMaskSeparate); | ||
2795 | ORD(glStencilOp); | ||
2796 | ORD(glStencilOpSeparate); | ||
2797 | ORD(glTexImage2D); | ||
2798 | ORD(glTexParameterf); | ||
2799 | ORD(glTexParameterfv); | ||
2800 | ORD(glTexParameteri); | ||
2801 | ORD(glTexParameteriv); | ||
2802 | ORD(glTexSubImage2D); | ||
2803 | ORD(glUniform1f); | ||
2804 | ORD(glUniform1fv); | ||
2805 | ORD(glUniform1i); | ||
2806 | ORD(glUniform1iv); | ||
2807 | ORD(glUniform2f); | ||
2808 | ORD(glUniform2fv); | ||
2809 | ORD(glUniform2i); | ||
2810 | ORD(glUniform2iv); | ||
2811 | ORD(glUniform3f); | ||
2812 | ORD(glUniform3fv); | ||
2813 | ORD(glUniform3i); | ||
2814 | ORD(glUniform3iv); | ||
2815 | ORD(glUniform4f); | ||
2816 | ORD(glUniform4fv); | ||
2817 | ORD(glUniform4i); | ||
2818 | ORD(glUniform4iv); | ||
2819 | ORD(glUniformMatrix2fv); | ||
2820 | ORD(glUniformMatrix3fv); | ||
2821 | ORD(glUniformMatrix4fv); | ||
2822 | ORD(glUseProgram); | ||
2823 | ORD(glValidateProgram); | ||
2824 | ORD(glVertexAttrib1f); | ||
2825 | ORD(glVertexAttrib1fv); | ||
2826 | ORD(glVertexAttrib2f); | ||
2827 | ORD(glVertexAttrib2fv); | ||
2828 | ORD(glVertexAttrib3f); | ||
2829 | ORD(glVertexAttrib3fv); | ||
2830 | ORD(glVertexAttrib4f); | ||
2831 | ORD(glVertexAttrib4fv); | ||
2832 | ORD(glVertexAttribPointer); | ||
2833 | ORD(glViewport); | ||
2834 | #undef ORD | ||
2835 | |||
2836 | #define ORD(f) EVAS_API_OVERRIDE(f, &gl_funcs, glsym_) | ||
2837 | // Extensions | ||
2838 | ORD(glGetProgramBinaryOES); | ||
2839 | ORD(glProgramBinaryOES); | ||
2840 | ORD(glMapBufferOES); | ||
2841 | ORD(glUnmapBufferOES); | ||
2842 | ORD(glGetBufferPointervOES); | ||
2843 | ORD(glTexImage3DOES); | ||
2844 | ORD(glTexSubImage3DOES); | ||
2845 | ORD(glCopyTexSubImage3DOES); | ||
2846 | ORD(glCompressedTexImage3DOES); | ||
2847 | ORD(glCompressedTexSubImage3DOES); | ||
2848 | ORD(glFramebufferTexture3DOES); | ||
2849 | ORD(glGetPerfMonitorGroupsAMD); | ||
2850 | ORD(glGetPerfMonitorCountersAMD); | ||
2851 | ORD(glGetPerfMonitorGroupStringAMD); | ||
2852 | ORD(glGetPerfMonitorCounterStringAMD); | ||
2853 | ORD(glGetPerfMonitorCounterInfoAMD); | ||
2854 | ORD(glGenPerfMonitorsAMD); | ||
2855 | ORD(glDeletePerfMonitorsAMD); | ||
2856 | ORD(glSelectPerfMonitorCountersAMD); | ||
2857 | ORD(glBeginPerfMonitorAMD); | ||
2858 | ORD(glEndPerfMonitorAMD); | ||
2859 | ORD(glGetPerfMonitorCounterDataAMD); | ||
2860 | ORD(glDiscardFramebufferEXT); | ||
2861 | ORD(glMultiDrawArraysEXT); | ||
2862 | ORD(glMultiDrawElementsEXT); | ||
2863 | ORD(glDeleteFencesNV); | ||
2864 | ORD(glGenFencesNV); | ||
2865 | ORD(glIsFenceNV); | ||
2866 | ORD(glTestFenceNV); | ||
2867 | ORD(glGetFenceivNV); | ||
2868 | ORD(glFinishFenceNV); | ||
2869 | ORD(glSetFenceNV); | ||
2870 | ORD(glGetDriverControlsQCOM); | ||
2871 | ORD(glGetDriverControlStringQCOM); | ||
2872 | ORD(glEnableDriverControlQCOM); | ||
2873 | ORD(glDisableDriverControlQCOM); | ||
2874 | ORD(glExtGetTexturesQCOM); | ||
2875 | ORD(glExtGetBuffersQCOM); | ||
2876 | ORD(glExtGetRenderbuffersQCOM); | ||
2877 | ORD(glExtGetFramebuffersQCOM); | ||
2878 | ORD(glExtGetTexLevelParameterivQCOM); | ||
2879 | ORD(glExtTexObjectStateOverrideiQCOM); | ||
2880 | ORD(glExtGetTexSubImageQCOM); | ||
2881 | ORD(glExtGetBufferPointervQCOM); | ||
2882 | ORD(glExtGetShadersQCOM); | ||
2883 | ORD(glExtGetProgramsQCOM); | ||
2884 | ORD(glExtIsProgramBinaryQCOM); | ||
2885 | ORD(glExtGetProgramBinarySourceQCOM); | ||
2886 | #undef ORD | ||
2887 | |||
2888 | // Override functions wrapped by Evas_GL | ||
2889 | #define ORD(f) EVAS_API_OVERRIDE(f, &gl_funcs, evgl_) | ||
2890 | ORD(glBindFramebuffer); | ||
2891 | ORD(glBindRenderbuffer); | ||
2892 | |||
2893 | // GLES2.0 API compat on top of desktop gl | ||
2894 | ORD(glClearDepthf); | ||
2895 | ORD(glDepthRangef); | ||
2896 | ORD(glGetShaderPrecisionFormat); | ||
2897 | ORD(glReleaseShaderCompiler); | ||
2898 | ORD(glShaderBinary); | ||
2899 | |||
2900 | ORD(glGetString); | ||
2901 | |||
2902 | // GLES 2.0 Extensions that needs wrapping | ||
2903 | ORD(evasglCreateImage); | ||
2904 | ORD(evasglDestroyImage); | ||
2905 | ORD(glEvasGLImageTargetTexture2DOES); | ||
2906 | ORD(glEvasGLImageTargetRenderbufferStorageOES); | ||
2907 | |||
2908 | #undef ORD | ||
2909 | |||
2910 | return &gl_funcs; | ||
2911 | } | ||
2912 | |||
2913 | static int | ||
2914 | eng_image_load_error_get(void *data __UNUSED__, void *image) | ||
2915 | { | ||
2916 | Evas_GL_Image *im; | ||
2917 | |||
2918 | if (!image) return EVAS_LOAD_ERROR_NONE; | ||
2919 | im = image; | ||
2920 | return im->im->cache_entry.load_error; | ||
2921 | } | ||
2922 | |||
2923 | static Eina_Bool | ||
2924 | eng_image_animated_get(void *data __UNUSED__, void *image) | ||
2925 | { | ||
2926 | Evas_GL_Image *gim = image; | ||
2927 | Image_Entry *im; | ||
2928 | |||
2929 | if (!gim) return EINA_FALSE; | ||
2930 | im = (Image_Entry *)gim->im; | ||
2931 | if (!im) return EINA_FALSE; | ||
2932 | |||
2933 | return im->flags.animated; | ||
2934 | } | ||
2935 | |||
2936 | static int | ||
2937 | eng_image_animated_frame_count_get(void *data __UNUSED__, void *image) | ||
2938 | { | ||
2939 | Evas_GL_Image *gim = image; | ||
2940 | Image_Entry *im; | ||
2941 | |||
2942 | if (!gim) return -1; | ||
2943 | im = (Image_Entry *)gim->im; | ||
2944 | if (!im) return -1; | ||
2945 | |||
2946 | if (!im->flags.animated) return -1; | ||
2947 | return im->frame_count; | ||
2948 | } | ||
2949 | |||
2950 | static Evas_Image_Animated_Loop_Hint | ||
2951 | eng_image_animated_loop_type_get(void *data __UNUSED__, void *image) | ||
2952 | { | ||
2953 | Evas_GL_Image *gim = image; | ||
2954 | Image_Entry *im; | ||
2955 | |||
2956 | if (!gim) return EVAS_IMAGE_ANIMATED_HINT_NONE; | ||
2957 | im = (Image_Entry *)gim->im; | ||
2958 | if (!im) return EVAS_IMAGE_ANIMATED_HINT_NONE; | ||
2959 | |||
2960 | if (!im->flags.animated) return EVAS_IMAGE_ANIMATED_HINT_NONE; | ||
2961 | return im->loop_hint; | ||
2962 | } | ||
2963 | |||
2964 | static int | ||
2965 | eng_image_animated_loop_count_get(void *data __UNUSED__, void *image) | ||
2966 | { | ||
2967 | Evas_GL_Image *gim = image; | ||
2968 | Image_Entry *im; | ||
2969 | |||
2970 | if (!gim) return -1; | ||
2971 | im = (Image_Entry *)gim->im; | ||
2972 | if (!im) return -1; | ||
2973 | |||
2974 | if (!im->flags.animated) return -1; | ||
2975 | return im->loop_count; | ||
2976 | } | ||
2977 | |||
2978 | static double | ||
2979 | eng_image_animated_frame_duration_get(void *data __UNUSED__, void *image, int start_frame, int frame_num) | ||
2980 | { | ||
2981 | Evas_GL_Image *gim = image; | ||
2982 | Image_Entry *im; | ||
2983 | |||
2984 | if (!gim) return -1; | ||
2985 | im = (Image_Entry *)gim->im; | ||
2986 | if (!im) return -1; | ||
2987 | |||
2988 | if (!im->flags.animated) return -1; | ||
2989 | return evas_common_load_rgba_image_frame_duration_from_file(im, start_frame, frame_num); | ||
2990 | } | ||
2991 | |||
2992 | static Eina_Bool | ||
2993 | eng_image_animated_frame_set(void *data __UNUSED__, void *image, int frame_index) | ||
2994 | { | ||
2995 | Evas_GL_Image *gim = image; | ||
2996 | Image_Entry *im; | ||
2997 | |||
2998 | if (!gim) return EINA_FALSE; | ||
2999 | im = (Image_Entry *)gim->im; | ||
3000 | if (!im) return EINA_FALSE; | ||
3001 | |||
3002 | if (!im->flags.animated) return EINA_FALSE; | ||
3003 | if (im->cur_frame == frame_index) return EINA_FALSE; | ||
3004 | |||
3005 | im->cur_frame = frame_index; | ||
3006 | return EINA_TRUE; | ||
3007 | } | ||
3008 | |||
3009 | static Eina_Bool | ||
3010 | eng_image_can_region_get(void *data __UNUSED__, void *image) | ||
3011 | { | ||
3012 | Evas_GL_Image *gim = image; | ||
3013 | Image_Entry *im; | ||
3014 | if (!gim) return EINA_FALSE; | ||
3015 | im = (Image_Entry *)gim->im; | ||
3016 | if (!im) return EINA_FALSE; | ||
3017 | return ((Evas_Image_Load_Func*) im->info.loader)->do_region; | ||
3018 | } | ||
3019 | |||
3020 | |||
3021 | static void | ||
3022 | eng_image_max_size_get(void *data, int *maxw, int *maxh) | ||
3023 | { | ||
3024 | Render_Engine *re = (Render_Engine *)data; | ||
3025 | if (maxw) *maxw = re->win->gl_context->shared->info.max_texture_size; | ||
3026 | if (maxh) *maxh = re->win->gl_context->shared->info.max_texture_size; | ||
3027 | } | ||
3028 | |||
3029 | static int | ||
3030 | module_open(Evas_Module *em) | ||
3031 | { | ||
3032 | static Eina_Bool xrm_inited = EINA_FALSE; | ||
3033 | if (!xrm_inited) | ||
3034 | { | ||
3035 | xrm_inited = EINA_TRUE; | ||
3036 | XrmInitialize(); | ||
3037 | } | ||
3038 | |||
3039 | if (!em) return 0; | ||
3040 | if (!evas_gl_common_module_open()) return 0; | ||
3041 | /* get whatever engine module we inherit from */ | ||
3042 | if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0; | ||
3043 | if (_evas_engine_wl_egl_log_dom < 0) | ||
3044 | { | ||
3045 | _evas_engine_wl_egl_log_dom = | ||
3046 | eina_log_domain_register("evas-gl_x11", EVAS_DEFAULT_LOG_COLOR); | ||
3047 | } | ||
3048 | |||
3049 | if (_evas_engine_wl_egl_log_dom < 0) | ||
3050 | { | ||
3051 | EINA_LOG_ERR("Can not create a module log domain."); | ||
3052 | return 0; | ||
3053 | } | ||
3054 | /* store it for later use */ | ||
3055 | func = pfunc; | ||
3056 | /* now to override methods */ | ||
3057 | #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) | ||
3058 | ORD(info); | ||
3059 | ORD(info_free); | ||
3060 | ORD(setup); | ||
3061 | ORD(canvas_alpha_get); | ||
3062 | ORD(output_free); | ||
3063 | ORD(output_resize); | ||
3064 | ORD(output_tile_size_set); | ||
3065 | ORD(output_redraws_rect_add); | ||
3066 | ORD(output_redraws_rect_del); | ||
3067 | ORD(output_redraws_clear); | ||
3068 | ORD(output_redraws_next_update_get); | ||
3069 | ORD(output_redraws_next_update_push); | ||
3070 | ORD(context_cutout_add); | ||
3071 | ORD(context_cutout_clear); | ||
3072 | ORD(output_flush); | ||
3073 | ORD(output_idle_flush); | ||
3074 | ORD(output_dump); | ||
3075 | ORD(rectangle_draw); | ||
3076 | ORD(line_draw); | ||
3077 | ORD(polygon_point_add); | ||
3078 | ORD(polygon_points_clear); | ||
3079 | ORD(polygon_draw); | ||
3080 | |||
3081 | ORD(image_load); | ||
3082 | ORD(image_new_from_data); | ||
3083 | ORD(image_new_from_copied_data); | ||
3084 | ORD(image_free); | ||
3085 | ORD(image_size_get); | ||
3086 | ORD(image_size_set); | ||
3087 | ORD(image_dirty_region); | ||
3088 | ORD(image_data_get); | ||
3089 | ORD(image_data_put); | ||
3090 | ORD(image_data_preload_request); | ||
3091 | ORD(image_data_preload_cancel); | ||
3092 | ORD(image_alpha_set); | ||
3093 | ORD(image_alpha_get); | ||
3094 | ORD(image_border_set); | ||
3095 | ORD(image_border_get); | ||
3096 | ORD(image_draw); | ||
3097 | ORD(image_comment_get); | ||
3098 | ORD(image_format_get); | ||
3099 | ORD(image_colorspace_set); | ||
3100 | ORD(image_colorspace_get); | ||
3101 | ORD(image_can_region_get); | ||
3102 | ORD(image_mask_create); | ||
3103 | ORD(image_native_set); | ||
3104 | ORD(image_native_get); | ||
3105 | #if 0 // filtering disabled | ||
3106 | ORD(image_draw_filtered); | ||
3107 | ORD(image_filtered_get); | ||
3108 | ORD(image_filtered_save); | ||
3109 | ORD(image_filtered_free); | ||
3110 | #endif | ||
3111 | |||
3112 | ORD(font_draw); | ||
3113 | |||
3114 | ORD(image_scale_hint_set); | ||
3115 | ORD(image_scale_hint_get); | ||
3116 | ORD(image_stride_get); | ||
3117 | |||
3118 | ORD(image_map_draw); | ||
3119 | ORD(image_map_surface_new); | ||
3120 | ORD(image_map_surface_free); | ||
3121 | |||
3122 | ORD(image_content_hint_set); | ||
3123 | ORD(image_content_hint_get); | ||
3124 | |||
3125 | ORD(image_cache_flush); | ||
3126 | ORD(image_cache_set); | ||
3127 | ORD(image_cache_get); | ||
3128 | |||
3129 | ORD(gl_surface_create); | ||
3130 | ORD(gl_surface_destroy); | ||
3131 | ORD(gl_context_create); | ||
3132 | ORD(gl_context_destroy); | ||
3133 | ORD(gl_make_current); | ||
3134 | ORD(gl_string_query); | ||
3135 | ORD(gl_proc_address_get); | ||
3136 | ORD(gl_native_surface_get); | ||
3137 | ORD(gl_api_get); | ||
3138 | |||
3139 | ORD(image_load_error_get); | ||
3140 | |||
3141 | /* now advertise out own api */ | ||
3142 | ORD(image_animated_get); | ||
3143 | ORD(image_animated_frame_count_get); | ||
3144 | ORD(image_animated_loop_type_get); | ||
3145 | ORD(image_animated_loop_count_get); | ||
3146 | ORD(image_animated_frame_duration_get); | ||
3147 | ORD(image_animated_frame_set); | ||
3148 | |||
3149 | ORD(image_max_size_get); | ||
3150 | |||
3151 | /* now advertise out own api */ | ||
3152 | em->functions = (void *)(&func); | ||
3153 | return 1; | ||
3154 | } | ||
3155 | |||
3156 | static void | ||
3157 | module_close(Evas_Module *em __UNUSED__) | ||
3158 | { | ||
3159 | eina_log_domain_unregister(_evas_engine_wl_egl_log_dom); | ||
3160 | evas_gl_common_module_close(); | ||
3161 | } | ||
3162 | |||
3163 | static Evas_Module_Api evas_modapi = | ||
3164 | { | ||
3165 | EVAS_MODULE_API_VERSION, "wayland_egl", "none", {module_open, module_close} | ||
3166 | }; | ||
3167 | |||
3168 | EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, gl_x11); | ||
3169 | |||
3170 | #ifndef EVAS_STATIC_BUILD_GL_XLIB | ||
3171 | EVAS_EINA_MODULE_DEFINE(engine, gl_x11); | ||
3172 | #endif | ||
3173 | |||
3174 | /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/ | ||
diff --git a/libraries/evas/src/modules/engines/wayland_egl/evas_engine.h b/libraries/evas/src/modules/engines/wayland_egl/evas_engine.h new file mode 100644 index 0000000..204d793 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_egl/evas_engine.h | |||
@@ -0,0 +1,82 @@ | |||
1 | #ifndef EVAS_ENGINE_H | ||
2 | #define EVAS_ENGINE_H | ||
3 | |||
4 | #include "config.h" | ||
5 | #include "evas_common.h" | ||
6 | #include "evas_private.h" | ||
7 | #include "evas_gl_common.h" | ||
8 | #include "Evas.h" | ||
9 | #include "Evas_Engine_Wayland_Egl.h" | ||
10 | |||
11 | #define GL_GLEXT_PROTOTYPES | ||
12 | |||
13 | #include <EGL/egl.h> | ||
14 | #include <GLES2/gl2.h> | ||
15 | #include <GLES2/gl2ext.h> | ||
16 | #include <wayland-egl.h> | ||
17 | |||
18 | extern int _evas_engine_wl_egl_log_dom; | ||
19 | #ifdef ERR | ||
20 | # undef ERR | ||
21 | #endif | ||
22 | #define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_wl_egl_log_dom, __VA_ARGS__) | ||
23 | |||
24 | #ifdef DBG | ||
25 | # undef DBG | ||
26 | #endif | ||
27 | #define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_wl_egl_log_dom, __VA_ARGS__) | ||
28 | |||
29 | #ifdef INF | ||
30 | # undef INF | ||
31 | #endif | ||
32 | #define INF(...) EINA_LOG_DOM_INFO(_evas_engine_wl_egl_log_dom, __VA_ARGS__) | ||
33 | |||
34 | #ifdef WRN | ||
35 | # undef WRN | ||
36 | #endif | ||
37 | #define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_wl_egl_log_dom, __VA_ARGS__) | ||
38 | |||
39 | #ifdef CRIT | ||
40 | # undef CRIT | ||
41 | #endif | ||
42 | #define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_wl_egl_log_dom, __VA_ARGS__) | ||
43 | |||
44 | typedef struct _Evas_GL_Wl_Window Evas_GL_Wl_Window; | ||
45 | |||
46 | struct _Evas_GL_Wl_Window | ||
47 | { | ||
48 | struct wl_display *disp; | ||
49 | struct wl_egl_window *win; | ||
50 | struct wl_surface *surface; | ||
51 | int w, h; | ||
52 | int screen; | ||
53 | // XVisualInfo *visualinfo; | ||
54 | // Visual *visual; | ||
55 | // Colormap colormap; | ||
56 | int depth; | ||
57 | int alpha; | ||
58 | int rot; | ||
59 | Evas_Engine_GL_Context *gl_context; | ||
60 | struct { | ||
61 | int redraw : 1; | ||
62 | int drew : 1; | ||
63 | int x1, y1, x2, y2; | ||
64 | } draw; | ||
65 | EGLContext egl_context[1]; | ||
66 | EGLSurface egl_surface[1]; | ||
67 | EGLConfig egl_config; | ||
68 | EGLDisplay egl_disp; | ||
69 | int surf : 1; | ||
70 | }; | ||
71 | |||
72 | Evas_GL_Wl_Window *eng_window_new(struct wl_display *disp, struct wl_surface *surface, int screen, | ||
73 | int depth, int w, int h, int indirect, | ||
74 | int alpha, int rot); | ||
75 | void eng_window_free(Evas_GL_Wl_Window *gw); | ||
76 | void eng_window_use(Evas_GL_Wl_Window *gw); | ||
77 | void eng_window_unsurf(Evas_GL_Wl_Window *gw); | ||
78 | void eng_window_resurf(Evas_GL_Wl_Window *gw); | ||
79 | |||
80 | int eng_best_depth_get(Evas_Engine_Info_Wayland_Egl *einfo); | ||
81 | |||
82 | #endif | ||
diff --git a/libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c b/libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c new file mode 100644 index 0000000..537fcc6 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_egl/evas_wl_main.c | |||
@@ -0,0 +1,323 @@ | |||
1 | #include "evas_engine.h" | ||
2 | |||
3 | static Evas_GL_Wl_Window *_evas_gl_wl_window = NULL; | ||
4 | |||
5 | static EGLContext context = EGL_NO_CONTEXT; | ||
6 | |||
7 | // fixme: something is up/wrong here - dont know what tho... | ||
8 | //#define NEWGL 1 | ||
9 | |||
10 | static int win_count = 0; | ||
11 | |||
12 | Evas_GL_Wl_Window * | ||
13 | eng_window_new(struct wl_display *disp, struct wl_surface *surface, int screen, | ||
14 | int depth, int w, int h, int indirect, int alpha, int rot) | ||
15 | { | ||
16 | Evas_GL_Wl_Window *gw; | ||
17 | int context_attrs[3]; | ||
18 | int config_attrs[40]; | ||
19 | int major_version, minor_version; | ||
20 | int num_config, n = 0; | ||
21 | const GLubyte *vendor, *renderer, *version; | ||
22 | |||
23 | gw = calloc(1, sizeof(Evas_GL_Wl_Window)); | ||
24 | if (!gw) return NULL; | ||
25 | |||
26 | win_count++; | ||
27 | gw->disp = disp; | ||
28 | gw->surface = surface; | ||
29 | gw->screen = screen; | ||
30 | gw->depth = depth; | ||
31 | gw->alpha = alpha; | ||
32 | gw->w = w; | ||
33 | gw->h = h; | ||
34 | gw->rot = rot; | ||
35 | |||
36 | // EGL / GLES | ||
37 | context_attrs[0] = EGL_CONTEXT_CLIENT_VERSION; | ||
38 | context_attrs[1] = 2; | ||
39 | context_attrs[2] = EGL_NONE; | ||
40 | |||
41 | #if defined(GLES_VARIETY_S3C6410) | ||
42 | if (gw->visualinfo->depth == 16) // 16bpp | ||
43 | { | ||
44 | config_attrs[n++] = EGL_SURFACE_TYPE; | ||
45 | config_attrs[n++] = EGL_WINDOW_BIT; | ||
46 | config_attrs[n++] = EGL_RENDERABLE_TYPE; | ||
47 | config_attrs[n++] = EGL_OPENGL_ES2_BIT; | ||
48 | config_attrs[n++] = EGL_RED_SIZE; | ||
49 | config_attrs[n++] = 5; | ||
50 | config_attrs[n++] = EGL_GREEN_SIZE; | ||
51 | config_attrs[n++] = 6; | ||
52 | config_attrs[n++] = EGL_BLUE_SIZE; | ||
53 | config_attrs[n++] = 5; | ||
54 | config_attrs[n++] = EGL_DEPTH_SIZE; | ||
55 | config_attrs[n++] = 0; | ||
56 | config_attrs[n++] = EGL_STENCIL_SIZE; | ||
57 | config_attrs[n++] = 0; | ||
58 | config_attrs[n++] = EGL_NONE; | ||
59 | } | ||
60 | else // 24/32bit. no one does 8bpp anymore. and 15bpp... dead | ||
61 | { | ||
62 | config_attrs[n++] = EGL_SURFACE_TYPE; | ||
63 | config_attrs[n++] = EGL_WINDOW_BIT; | ||
64 | config_attrs[n++] = EGL_RENDERABLE_TYPE; | ||
65 | config_attrs[n++] = EGL_OPENGL_ES2_BIT; | ||
66 | config_attrs[n++] = EGL_RED_SIZE; | ||
67 | config_attrs[n++] = 8; | ||
68 | config_attrs[n++] = EGL_GREEN_SIZE; | ||
69 | config_attrs[n++] = 8; | ||
70 | config_attrs[n++] = EGL_BLUE_SIZE; | ||
71 | config_attrs[n++] = 8; | ||
72 | config_attrs[n++] = EGL_DEPTH_SIZE; | ||
73 | config_attrs[n++] = 0; | ||
74 | config_attrs[n++] = EGL_STENCIL_SIZE; | ||
75 | config_attrs[n++] = 0; | ||
76 | config_attrs[n++] = EGL_NONE; | ||
77 | } | ||
78 | #elif defined(GLES_VARIETY_SGX) | ||
79 | config_attrs[n++] = EGL_SURFACE_TYPE; | ||
80 | config_attrs[n++] = EGL_WINDOW_BIT; | ||
81 | config_attrs[n++] = EGL_RENDERABLE_TYPE; | ||
82 | config_attrs[n++] = EGL_OPENGL_ES2_BIT; | ||
83 | # if 0 | ||
84 | // FIXME: n900 - omap3 sgx libs break here | ||
85 | config_attrs[n++] = EGL_RED_SIZE; | ||
86 | config_attrs[n++] = 1; | ||
87 | config_attrs[n++] = EGL_GREEN_SIZE; | ||
88 | config_attrs[n++] = 1; | ||
89 | config_attrs[n++] = EGL_BLUE_SIZE; | ||
90 | config_attrs[n++] = 1; | ||
91 | // FIXME: end n900 breakage | ||
92 | # endif | ||
93 | if (gw->alpha) | ||
94 | { | ||
95 | config_attrs[n++] = EGL_ALPHA_SIZE; | ||
96 | config_attrs[n++] = 1; | ||
97 | } | ||
98 | else | ||
99 | { | ||
100 | config_attrs[n++] = EGL_ALPHA_SIZE; | ||
101 | config_attrs[n++] = 0; | ||
102 | } | ||
103 | config_attrs[n++] = EGL_DEPTH_SIZE; | ||
104 | config_attrs[n++] = 0; | ||
105 | config_attrs[n++] = EGL_STENCIL_SIZE; | ||
106 | config_attrs[n++] = 0; | ||
107 | config_attrs[n++] = EGL_NONE; | ||
108 | #endif | ||
109 | |||
110 | gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)(gw->disp)); | ||
111 | if (!gw->egl_disp) | ||
112 | { | ||
113 | ERR("eglGetDisplay() fail. code=%#x", eglGetError()); | ||
114 | eng_window_free(gw); | ||
115 | return NULL; | ||
116 | } | ||
117 | if (!eglInitialize(gw->egl_disp, &major_version, &minor_version)) | ||
118 | { | ||
119 | ERR("eglInitialize() fail. code=%#x", eglGetError()); | ||
120 | eng_window_free(gw); | ||
121 | return NULL; | ||
122 | } | ||
123 | eglBindAPI(EGL_OPENGL_ES_API); | ||
124 | if (eglGetError() != EGL_SUCCESS) | ||
125 | { | ||
126 | ERR("eglBindAPI() fail. code=%#x", eglGetError()); | ||
127 | eng_window_free(gw); | ||
128 | return NULL; | ||
129 | } | ||
130 | |||
131 | num_config = 0; | ||
132 | if (!eglChooseConfig(gw->egl_disp, config_attrs, &gw->egl_config, | ||
133 | 1, &num_config) || (num_config != 1)) | ||
134 | { | ||
135 | ERR("eglChooseConfig() fail. code=%#x", eglGetError()); | ||
136 | eng_window_free(gw); | ||
137 | return NULL; | ||
138 | } | ||
139 | |||
140 | gw->win = wl_egl_window_create(gw->surface, gw->w, gw->h); | ||
141 | |||
142 | gw->egl_surface[0] = eglCreateWindowSurface(gw->egl_disp, gw->egl_config, | ||
143 | (EGLNativeWindowType)gw->win, | ||
144 | NULL); | ||
145 | if (gw->egl_surface[0] == EGL_NO_SURFACE) | ||
146 | { | ||
147 | ERR("eglCreateWindowSurface() fail for %#x. code=%#x", | ||
148 | (unsigned int)gw->win, eglGetError()); | ||
149 | eng_window_free(gw); | ||
150 | return NULL; | ||
151 | } | ||
152 | |||
153 | if (context == EGL_NO_CONTEXT) | ||
154 | context = eglCreateContext(gw->egl_disp, gw->egl_config, NULL, | ||
155 | context_attrs); | ||
156 | gw->egl_context[0] = context; | ||
157 | if (gw->egl_context[0] == EGL_NO_CONTEXT) | ||
158 | { | ||
159 | ERR("eglCreateContext() fail. code=%#x", eglGetError()); | ||
160 | eng_window_free(gw); | ||
161 | return NULL; | ||
162 | } | ||
163 | |||
164 | if (eglMakeCurrent(gw->egl_disp, gw->egl_surface[0], gw->egl_surface[0], | ||
165 | gw->egl_context[0]) == EGL_FALSE) | ||
166 | { | ||
167 | ERR("eglMakeCurrent() fail. code=%#x", eglGetError()); | ||
168 | eng_window_free(gw); | ||
169 | return NULL; | ||
170 | } | ||
171 | |||
172 | vendor = glGetString(GL_VENDOR); | ||
173 | renderer = glGetString(GL_RENDERER); | ||
174 | version = glGetString(GL_VERSION); | ||
175 | if (!vendor) vendor = (unsigned char *)"-UNKNOWN-"; | ||
176 | if (!renderer) renderer = (unsigned char *)"-UNKNOWN-"; | ||
177 | if (!version) version = (unsigned char *)"-UNKNOWN-"; | ||
178 | if (getenv("EVAS_GL_INFO")) | ||
179 | { | ||
180 | fprintf(stderr, "vendor: %s\n", vendor); | ||
181 | fprintf(stderr, "renderer: %s\n", renderer); | ||
182 | fprintf(stderr, "version: %s\n", version); | ||
183 | } | ||
184 | |||
185 | gw->gl_context = evas_gl_common_context_new(); | ||
186 | if (!gw->gl_context) | ||
187 | { | ||
188 | eng_window_free(gw); | ||
189 | return NULL; | ||
190 | } | ||
191 | gw->gl_context->egldisp = gw->egl_disp; | ||
192 | eng_window_use(gw); | ||
193 | evas_gl_common_context_resize(gw->gl_context, w, h, rot); | ||
194 | gw->surf = 1; | ||
195 | return gw; | ||
196 | indirect = 0; | ||
197 | } | ||
198 | |||
199 | void | ||
200 | eng_window_free(Evas_GL_Wl_Window *gw) | ||
201 | { | ||
202 | int ref = 0; | ||
203 | |||
204 | win_count--; | ||
205 | eng_window_use(gw); | ||
206 | if (gw == _evas_gl_wl_window) _evas_gl_wl_window = NULL; | ||
207 | // if (gw->win) wl_egl_window_destroy(gw->win); | ||
208 | if (gw->gl_context) | ||
209 | { | ||
210 | ref = gw->gl_context->references - 1; | ||
211 | evas_gl_common_context_free(gw->gl_context); | ||
212 | } | ||
213 | if (gw->egl_surface[0] != EGL_NO_SURFACE) | ||
214 | eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); | ||
215 | eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
216 | if (ref == 0) | ||
217 | { | ||
218 | if (context) eglDestroyContext(gw->egl_disp, context); | ||
219 | context = EGL_NO_CONTEXT; | ||
220 | eglTerminate(gw->egl_disp); | ||
221 | eglReleaseThread(); | ||
222 | } | ||
223 | free(gw); | ||
224 | } | ||
225 | |||
226 | void | ||
227 | eng_window_use(Evas_GL_Wl_Window *gw) | ||
228 | { | ||
229 | Eina_Bool force_use = EINA_FALSE; | ||
230 | |||
231 | if (_evas_gl_wl_window) | ||
232 | { | ||
233 | if ((eglGetCurrentContext() != | ||
234 | _evas_gl_wl_window->egl_context[0]) || | ||
235 | (eglGetCurrentSurface(EGL_READ) != | ||
236 | _evas_gl_wl_window->egl_surface[0]) || | ||
237 | (eglGetCurrentSurface(EGL_DRAW) != | ||
238 | _evas_gl_wl_window->egl_surface[0])) | ||
239 | force_use = EINA_TRUE; | ||
240 | } | ||
241 | if ((_evas_gl_wl_window != gw) || (force_use)) | ||
242 | { | ||
243 | if (_evas_gl_wl_window) | ||
244 | { | ||
245 | evas_gl_common_context_use(_evas_gl_wl_window->gl_context); | ||
246 | evas_gl_common_context_flush(_evas_gl_wl_window->gl_context); | ||
247 | } | ||
248 | _evas_gl_wl_window = gw; | ||
249 | if (gw) | ||
250 | { | ||
251 | // EGL / GLES | ||
252 | if (gw->egl_surface[0] != EGL_NO_SURFACE) | ||
253 | { | ||
254 | if (eglMakeCurrent(gw->egl_disp, gw->egl_surface[0], | ||
255 | gw->egl_surface[0], | ||
256 | gw->egl_context[0]) == EGL_FALSE) | ||
257 | { | ||
258 | ERR("eglMakeCurrent() failed!"); | ||
259 | } | ||
260 | } | ||
261 | } | ||
262 | } | ||
263 | if (gw) evas_gl_common_context_use(gw->gl_context); | ||
264 | } | ||
265 | |||
266 | void | ||
267 | eng_window_unsurf(Evas_GL_Wl_Window *gw) | ||
268 | { | ||
269 | if (!gw->surf) return; | ||
270 | if (!getenv("EVAS_GL_WIN_RESURF")) return; | ||
271 | if (getenv("EVAS_GL_INFO")) printf("unsurf %p\n", gw); | ||
272 | |||
273 | if (_evas_gl_wl_window) | ||
274 | evas_gl_common_context_flush(_evas_gl_wl_window->gl_context); | ||
275 | if (_evas_gl_wl_window == gw) | ||
276 | { | ||
277 | eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); | ||
278 | if (gw->egl_surface[0] != EGL_NO_SURFACE) | ||
279 | eglDestroySurface(gw->egl_disp, gw->egl_surface[0]); | ||
280 | gw->egl_surface[0] = EGL_NO_SURFACE; | ||
281 | _evas_gl_wl_window = NULL; | ||
282 | } | ||
283 | gw->surf = 0; | ||
284 | } | ||
285 | |||
286 | void | ||
287 | eng_window_resurf(Evas_GL_Wl_Window *gw) | ||
288 | { | ||
289 | if (gw->surf) return; | ||
290 | if (getenv("EVAS_GL_INFO")) printf("resurf %p\n", gw); | ||
291 | |||
292 | gw->egl_surface[0] = | ||
293 | eglCreateWindowSurface(gw->egl_disp, gw->egl_config, | ||
294 | (EGLNativeWindowType)gw->win, NULL); | ||
295 | |||
296 | if (gw->egl_surface[0] == EGL_NO_SURFACE) | ||
297 | { | ||
298 | ERR("eglCreateWindowSurface() fail for %#x. code=%#x", | ||
299 | (unsigned int)gw->win, eglGetError()); | ||
300 | return; | ||
301 | } | ||
302 | if (eglMakeCurrent(gw->egl_disp, gw->egl_surface[0], gw->egl_surface[0], | ||
303 | gw->egl_context[0]) == EGL_FALSE) | ||
304 | { | ||
305 | ERR("eglMakeCurrent() failed!"); | ||
306 | } | ||
307 | gw->surf = 1; | ||
308 | } | ||
309 | |||
310 | int | ||
311 | eng_best_depth_get(Evas_Engine_Info_Wayland_Egl *einfo) | ||
312 | { | ||
313 | if (!einfo) return 0; | ||
314 | if (!einfo->info.display) return 0; | ||
315 | return 32; | ||
316 | /* if (!_evas_gl_x11_vi) eng_best_visual_get(einfo); */ | ||
317 | /* if (!_evas_gl_x11_vi) return 0; */ | ||
318 | /* if (einfo->info.destination_alpha) */ | ||
319 | /* { */ | ||
320 | /* if (_evas_gl_x11_rgba_vi) return _evas_gl_x11_rgba_vi->depth; */ | ||
321 | /* } */ | ||
322 | /* return _evas_gl_x11_vi->depth; */ | ||
323 | } | ||
diff --git a/libraries/evas/src/modules/engines/wayland_shm/Evas_Engine_Wayland_Shm.h b/libraries/evas/src/modules/engines/wayland_shm/Evas_Engine_Wayland_Shm.h new file mode 100644 index 0000000..b34b2c1 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_shm/Evas_Engine_Wayland_Shm.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _EVAS_ENGINE_WAYLAND_SHM_H | ||
2 | # define _EVAS_ENGINE_WAYLAND_SHM_H | ||
3 | |||
4 | typedef struct _Evas_Engine_Info_Wayland_Shm Evas_Engine_Info_Wayland_Shm; | ||
5 | struct _Evas_Engine_Info_Wayland_Shm | ||
6 | { | ||
7 | Evas_Engine_Info magic; | ||
8 | |||
9 | struct | ||
10 | { | ||
11 | void *dest; | ||
12 | int rotation; | ||
13 | |||
14 | unsigned char debug : 1; | ||
15 | } info; | ||
16 | |||
17 | Evas_Engine_Render_Mode render_mode; | ||
18 | }; | ||
19 | |||
20 | #endif | ||
diff --git a/libraries/evas/src/modules/engines/wayland_shm/Makefile.am b/libraries/evas/src/modules/engines/wayland_shm/Makefile.am new file mode 100644 index 0000000..455b82c --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_shm/Makefile.am | |||
@@ -0,0 +1,45 @@ | |||
1 | |||
2 | MAINTAINERCLEANFILES = Makefile.in | ||
3 | |||
4 | AM_CPPFLAGS = \ | ||
5 | -I. \ | ||
6 | -I$(top_srcdir)/src/lib \ | ||
7 | -I$(top_srcdir)/src/lib/include \ | ||
8 | -I$(top_srcdir)/src/modules/engines \ | ||
9 | @FREETYPE_CFLAGS@ \ | ||
10 | @EINA_CFLAGS@ \ | ||
11 | @evas_engine_wayland_shm_cflags@ | ||
12 | |||
13 | if BUILD_ENGINE_WAYLAND_SHM | ||
14 | |||
15 | WAYLAND_SHM_SOURCES = \ | ||
16 | evas_engine.c \ | ||
17 | evas_outbuf.c | ||
18 | |||
19 | WAYLAND_SHM_LIBADD = @FREETYPE_LIBS@ @EINA_LIBS@ @evas_engine_wayland_shm_libs@ | ||
20 | |||
21 | includes_HEADERS = Evas_Engine_Wayland_Shm.h | ||
22 | includesdir = $(includedir)/evas-@VMAJ@ | ||
23 | |||
24 | if !EVAS_STATIC_BUILD_WAYLAND_SHM | ||
25 | |||
26 | pkgdir = $(libdir)/evas/modules/engines/wayland_shm/$(MODULE_ARCH) | ||
27 | pkg_LTLIBRARIES = module.la | ||
28 | |||
29 | module_la_SOURCES = $(WAYLAND_SHM_SOURCES) | ||
30 | module_la_LIBADD = $(WAYLAND_SHM_LIBADD) $(top_builddir)/src/lib/libevas.la | ||
31 | module_la_LDFLAGS = -no-undefined -module -avoid-version | ||
32 | module_la_LIBTOOLFLAGS = --tag=disable-static | ||
33 | |||
34 | else | ||
35 | |||
36 | noinst_LTLIBRARIES = libevas_engine_wayland_shm.la | ||
37 | |||
38 | libevas_engine_wayland_shm_la_SOURCES = $(WAYLAND_SHM_SOURCES) | ||
39 | libevas_engine_wayland_shm_la_LIBADD = $(WAYLAND_SHM_LIBADD) | ||
40 | |||
41 | endif | ||
42 | endif | ||
43 | |||
44 | EXTRA_DIST = \ | ||
45 | evas_engine.h | ||
diff --git a/libraries/evas/src/modules/engines/wayland_shm/Makefile.in b/libraries/evas/src/modules/engines/wayland_shm/Makefile.in new file mode 100644 index 0000000..4d69209 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_shm/Makefile.in | |||
@@ -0,0 +1,816 @@ | |||
1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | ||
6 | # Inc. | ||
7 | # This Makefile.in is free software; the Free Software Foundation | ||
8 | # gives unlimited permission to copy and/or distribute it, | ||
9 | # with or without modifications, as long as this notice is preserved. | ||
10 | |||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
14 | # PARTICULAR PURPOSE. | ||
15 | |||
16 | @SET_MAKE@ | ||
17 | |||
18 | |||
19 | VPATH = @srcdir@ | ||
20 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
21 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
22 | pkglibdir = $(libdir)/@PACKAGE@ | ||
23 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
24 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
25 | install_sh_DATA = $(install_sh) -c -m 644 | ||
26 | install_sh_PROGRAM = $(install_sh) -c | ||
27 | install_sh_SCRIPT = $(install_sh) -c | ||
28 | INSTALL_HEADER = $(INSTALL_DATA) | ||
29 | transform = $(program_transform_name) | ||
30 | NORMAL_INSTALL = : | ||
31 | PRE_INSTALL = : | ||
32 | POST_INSTALL = : | ||
33 | NORMAL_UNINSTALL = : | ||
34 | PRE_UNINSTALL = : | ||
35 | POST_UNINSTALL = : | ||
36 | build_triplet = @build@ | ||
37 | host_triplet = @host@ | ||
38 | subdir = src/modules/engines/wayland_shm | ||
39 | DIST_COMMON = $(am__includes_HEADERS_DIST) $(srcdir)/Makefile.am \ | ||
40 | $(srcdir)/Makefile.in | ||
41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
42 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
43 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
44 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
45 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
46 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
47 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
48 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
49 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
50 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
51 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
52 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
53 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
54 | $(top_srcdir)/configure.ac | ||
55 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
56 | $(ACLOCAL_M4) | ||
57 | mkinstalldirs = $(install_sh) -d | ||
58 | CONFIG_HEADER = $(top_builddir)/config.h | ||
59 | CONFIG_CLEAN_FILES = | ||
60 | CONFIG_CLEAN_VPATH_FILES = | ||
61 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
62 | am__vpath_adj = case $$p in \ | ||
63 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
64 | *) f=$$p;; \ | ||
65 | esac; | ||
66 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
67 | am__install_max = 40 | ||
68 | am__nobase_strip_setup = \ | ||
69 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
70 | am__nobase_strip = \ | ||
71 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
72 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
73 | for p in $$list; do echo "$$p $$p"; done | \ | ||
74 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
75 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
76 | if (++n[$$2] == $(am__install_max)) \ | ||
77 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
78 | END { for (dir in files) print dir, files[dir] }' | ||
79 | am__base_list = \ | ||
80 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
81 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
82 | am__installdirs = "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)" | ||
83 | LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkg_LTLIBRARIES) | ||
84 | am__DEPENDENCIES_1 = | ||
85 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_TRUE@libevas_engine_wayland_shm_la_DEPENDENCIES = $(am__DEPENDENCIES_1) | ||
86 | am__libevas_engine_wayland_shm_la_SOURCES_DIST = evas_engine.c \ | ||
87 | evas_outbuf.c | ||
88 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@am__objects_1 = evas_engine.lo \ | ||
89 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@ evas_outbuf.lo | ||
90 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_TRUE@am_libevas_engine_wayland_shm_la_OBJECTS = $(am__objects_1) | ||
91 | libevas_engine_wayland_shm_la_OBJECTS = \ | ||
92 | $(am_libevas_engine_wayland_shm_la_OBJECTS) | ||
93 | AM_V_lt = $(am__v_lt_$(V)) | ||
94 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
95 | am__v_lt_0 = --silent | ||
96 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_TRUE@am_libevas_engine_wayland_shm_la_rpath = | ||
97 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@module_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ | ||
98 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@ $(top_builddir)/src/lib/libevas.la | ||
99 | am__module_la_SOURCES_DIST = evas_engine.c evas_outbuf.c | ||
100 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@am__objects_2 = \ | ||
101 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@ module_la-evas_engine.lo \ | ||
102 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@ module_la-evas_outbuf.lo | ||
103 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@am_module_la_OBJECTS = $(am__objects_2) | ||
104 | module_la_OBJECTS = $(am_module_la_OBJECTS) | ||
105 | module_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | ||
106 | $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | ||
107 | $(AM_CFLAGS) $(CFLAGS) $(module_la_LDFLAGS) $(LDFLAGS) -o $@ | ||
108 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@am_module_la_rpath = -rpath \ | ||
109 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@ $(pkgdir) | ||
110 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
111 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
112 | am__depfiles_maybe = depfiles | ||
113 | am__mv = mv -f | ||
114 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
115 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
116 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
117 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
118 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
119 | $(AM_CFLAGS) $(CFLAGS) | ||
120 | AM_V_CC = $(am__v_CC_$(V)) | ||
121 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
122 | am__v_CC_0 = @echo " CC " $@; | ||
123 | AM_V_at = $(am__v_at_$(V)) | ||
124 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
125 | am__v_at_0 = @ | ||
126 | CCLD = $(CC) | ||
127 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
128 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
129 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
130 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
131 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
132 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
133 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
134 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
135 | am__v_GEN_0 = @echo " GEN " $@; | ||
136 | SOURCES = $(libevas_engine_wayland_shm_la_SOURCES) \ | ||
137 | $(module_la_SOURCES) | ||
138 | DIST_SOURCES = $(am__libevas_engine_wayland_shm_la_SOURCES_DIST) \ | ||
139 | $(am__module_la_SOURCES_DIST) | ||
140 | am__includes_HEADERS_DIST = Evas_Engine_Wayland_Shm.h | ||
141 | HEADERS = $(includes_HEADERS) | ||
142 | ETAGS = etags | ||
143 | CTAGS = ctags | ||
144 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
145 | ACLOCAL = @ACLOCAL@ | ||
146 | ALLOCA = @ALLOCA@ | ||
147 | AMTAR = @AMTAR@ | ||
148 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
149 | AR = @AR@ | ||
150 | AS = @AS@ | ||
151 | AUTOCONF = @AUTOCONF@ | ||
152 | AUTOHEADER = @AUTOHEADER@ | ||
153 | AUTOMAKE = @AUTOMAKE@ | ||
154 | AWK = @AWK@ | ||
155 | CC = @CC@ | ||
156 | CCDEPMODE = @CCDEPMODE@ | ||
157 | CFLAGS = @CFLAGS@ | ||
158 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
159 | CHECK_LIBS = @CHECK_LIBS@ | ||
160 | CPP = @CPP@ | ||
161 | CPPFLAGS = @CPPFLAGS@ | ||
162 | CXX = @CXX@ | ||
163 | CXXCPP = @CXXCPP@ | ||
164 | CXXDEPMODE = @CXXDEPMODE@ | ||
165 | CXXFLAGS = @CXXFLAGS@ | ||
166 | CYGPATH_W = @CYGPATH_W@ | ||
167 | DEFS = @DEFS@ | ||
168 | DEPDIR = @DEPDIR@ | ||
169 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
170 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
171 | DLLTOOL = @DLLTOOL@ | ||
172 | DSYMUTIL = @DSYMUTIL@ | ||
173 | DUMPBIN = @DUMPBIN@ | ||
174 | ECHO_C = @ECHO_C@ | ||
175 | ECHO_N = @ECHO_N@ | ||
176 | ECHO_T = @ECHO_T@ | ||
177 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
178 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
179 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
180 | EDB_LIBS = @EDB_LIBS@ | ||
181 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
182 | EDJE_LIBS = @EDJE_LIBS@ | ||
183 | EET_CFLAGS = @EET_CFLAGS@ | ||
184 | EET_LIBS = @EET_LIBS@ | ||
185 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
186 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
187 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
188 | EGREP = @EGREP@ | ||
189 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
190 | EINA_LIBS = @EINA_LIBS@ | ||
191 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
192 | EVAS_LIBS = @EVAS_LIBS@ | ||
193 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
194 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
195 | EVIL_LIBS = @EVIL_LIBS@ | ||
196 | EXEEXT = @EXEEXT@ | ||
197 | FGREP = @FGREP@ | ||
198 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
199 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
200 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
201 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
202 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
203 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
204 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
205 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
206 | GREP = @GREP@ | ||
207 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
208 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
209 | INSTALL = @INSTALL@ | ||
210 | INSTALL_DATA = @INSTALL_DATA@ | ||
211 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
212 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
213 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
214 | LD = @LD@ | ||
215 | LDFLAGS = @LDFLAGS@ | ||
216 | LIBOBJS = @LIBOBJS@ | ||
217 | LIBS = @LIBS@ | ||
218 | LIBTOOL = @LIBTOOL@ | ||
219 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
220 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
221 | LIPO = @LIPO@ | ||
222 | LN_S = @LN_S@ | ||
223 | LTLIBOBJS = @LTLIBOBJS@ | ||
224 | MAKEINFO = @MAKEINFO@ | ||
225 | MKDIR_P = @MKDIR_P@ | ||
226 | MODULE_ARCH = @MODULE_ARCH@ | ||
227 | NM = @NM@ | ||
228 | NMEDIT = @NMEDIT@ | ||
229 | OBJC = @OBJC@ | ||
230 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
231 | OBJCFLAGS = @OBJCFLAGS@ | ||
232 | OBJDUMP = @OBJDUMP@ | ||
233 | OBJEXT = @OBJEXT@ | ||
234 | OTOOL = @OTOOL@ | ||
235 | OTOOL64 = @OTOOL64@ | ||
236 | PACKAGE = @PACKAGE@ | ||
237 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
238 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
239 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
240 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
241 | PACKAGE_URL = @PACKAGE_URL@ | ||
242 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
243 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
244 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
245 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
246 | PKG_CONFIG = @PKG_CONFIG@ | ||
247 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
248 | PNG_LIBS = @PNG_LIBS@ | ||
249 | RANLIB = @RANLIB@ | ||
250 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
251 | SDL_LIBS = @SDL_LIBS@ | ||
252 | SED = @SED@ | ||
253 | SET_MAKE = @SET_MAKE@ | ||
254 | SHELL = @SHELL@ | ||
255 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
256 | STRIP = @STRIP@ | ||
257 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
258 | SVG_LIBS = @SVG_LIBS@ | ||
259 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
260 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
261 | VERSION = @VERSION@ | ||
262 | VMAJ = @VMAJ@ | ||
263 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
264 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
265 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
266 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
267 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
268 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
269 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
270 | XCB_LIBS = @XCB_LIBS@ | ||
271 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
272 | XEXT_LIBS = @XEXT_LIBS@ | ||
273 | XMKMF = @XMKMF@ | ||
274 | X_CFLAGS = @X_CFLAGS@ | ||
275 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
276 | X_LIBS = @X_LIBS@ | ||
277 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
278 | abs_builddir = @abs_builddir@ | ||
279 | abs_srcdir = @abs_srcdir@ | ||
280 | abs_top_builddir = @abs_top_builddir@ | ||
281 | abs_top_srcdir = @abs_top_srcdir@ | ||
282 | ac_ct_CC = @ac_ct_CC@ | ||
283 | ac_ct_CXX = @ac_ct_CXX@ | ||
284 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
285 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
286 | altivec_cflags = @altivec_cflags@ | ||
287 | am__include = @am__include@ | ||
288 | am__leading_dot = @am__leading_dot@ | ||
289 | am__quote = @am__quote@ | ||
290 | am__tar = @am__tar@ | ||
291 | am__untar = @am__untar@ | ||
292 | bindir = @bindir@ | ||
293 | build = @build@ | ||
294 | build_alias = @build_alias@ | ||
295 | build_cpu = @build_cpu@ | ||
296 | build_os = @build_os@ | ||
297 | build_vendor = @build_vendor@ | ||
298 | builddir = @builddir@ | ||
299 | datadir = @datadir@ | ||
300 | datarootdir = @datarootdir@ | ||
301 | dlopen_libs = @dlopen_libs@ | ||
302 | docdir = @docdir@ | ||
303 | dvidir = @dvidir@ | ||
304 | edje_cc = @edje_cc@ | ||
305 | efl_doxygen = @efl_doxygen@ | ||
306 | efl_have_doxygen = @efl_have_doxygen@ | ||
307 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
308 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
309 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
310 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
311 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
312 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
313 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
314 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
315 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
316 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
317 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
318 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
319 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
320 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
321 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
322 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
323 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
324 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
325 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
326 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
327 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
328 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
329 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
330 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
331 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
332 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
333 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
334 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
335 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
336 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
337 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
338 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
339 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
340 | evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ | ||
341 | evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ | ||
342 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
343 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
344 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
345 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
346 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
347 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
348 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
349 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
350 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
351 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
352 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
353 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
354 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
355 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
356 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
357 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
358 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
359 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
360 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
361 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
362 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
363 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
364 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
365 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
366 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
367 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
368 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
369 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
370 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
371 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
372 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
373 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
374 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
375 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
376 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
377 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
378 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
379 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
380 | exec_prefix = @exec_prefix@ | ||
381 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
382 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
383 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
384 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
385 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
386 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
387 | have_lcov = @have_lcov@ | ||
388 | host = @host@ | ||
389 | host_alias = @host_alias@ | ||
390 | host_cpu = @host_cpu@ | ||
391 | host_os = @host_os@ | ||
392 | host_vendor = @host_vendor@ | ||
393 | htmldir = @htmldir@ | ||
394 | includedir = @includedir@ | ||
395 | infodir = @infodir@ | ||
396 | install_sh = @install_sh@ | ||
397 | libdir = @libdir@ | ||
398 | libexecdir = @libexecdir@ | ||
399 | localedir = @localedir@ | ||
400 | localstatedir = @localstatedir@ | ||
401 | lt_ECHO = @lt_ECHO@ | ||
402 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
403 | mandir = @mandir@ | ||
404 | mkdir_p = @mkdir_p@ | ||
405 | oldincludedir = @oldincludedir@ | ||
406 | pdfdir = @pdfdir@ | ||
407 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
408 | prefix = @prefix@ | ||
409 | program_transform_name = @program_transform_name@ | ||
410 | psdir = @psdir@ | ||
411 | pthread_cflags = @pthread_cflags@ | ||
412 | pthread_libs = @pthread_libs@ | ||
413 | release_info = @release_info@ | ||
414 | requirement_evas = @requirement_evas@ | ||
415 | sbindir = @sbindir@ | ||
416 | sharedstatedir = @sharedstatedir@ | ||
417 | srcdir = @srcdir@ | ||
418 | sysconfdir = @sysconfdir@ | ||
419 | target_alias = @target_alias@ | ||
420 | top_build_prefix = @top_build_prefix@ | ||
421 | top_builddir = @top_builddir@ | ||
422 | top_srcdir = @top_srcdir@ | ||
423 | version_info = @version_info@ | ||
424 | MAINTAINERCLEANFILES = Makefile.in | ||
425 | AM_CPPFLAGS = \ | ||
426 | -I. \ | ||
427 | -I$(top_srcdir)/src/lib \ | ||
428 | -I$(top_srcdir)/src/lib/include \ | ||
429 | -I$(top_srcdir)/src/modules/engines \ | ||
430 | @FREETYPE_CFLAGS@ \ | ||
431 | @EINA_CFLAGS@ \ | ||
432 | @evas_engine_wayland_shm_cflags@ | ||
433 | |||
434 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@WAYLAND_SHM_SOURCES = \ | ||
435 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@evas_engine.c \ | ||
436 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@evas_outbuf.c | ||
437 | |||
438 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@WAYLAND_SHM_LIBADD = @FREETYPE_LIBS@ @EINA_LIBS@ @evas_engine_wayland_shm_libs@ | ||
439 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@includes_HEADERS = Evas_Engine_Wayland_Shm.h | ||
440 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@includesdir = $(includedir)/evas-@VMAJ@ | ||
441 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@pkgdir = $(libdir)/evas/modules/engines/wayland_shm/$(MODULE_ARCH) | ||
442 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@pkg_LTLIBRARIES = module.la | ||
443 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@module_la_SOURCES = $(WAYLAND_SHM_SOURCES) | ||
444 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@module_la_LIBADD = $(WAYLAND_SHM_LIBADD) $(top_builddir)/src/lib/libevas.la | ||
445 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@module_la_LDFLAGS = -no-undefined -module -avoid-version | ||
446 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_FALSE@module_la_LIBTOOLFLAGS = --tag=disable-static | ||
447 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_TRUE@noinst_LTLIBRARIES = libevas_engine_wayland_shm.la | ||
448 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_TRUE@libevas_engine_wayland_shm_la_SOURCES = $(WAYLAND_SHM_SOURCES) | ||
449 | @BUILD_ENGINE_WAYLAND_SHM_TRUE@@EVAS_STATIC_BUILD_WAYLAND_SHM_TRUE@libevas_engine_wayland_shm_la_LIBADD = $(WAYLAND_SHM_LIBADD) | ||
450 | EXTRA_DIST = \ | ||
451 | evas_engine.h | ||
452 | |||
453 | all: all-am | ||
454 | |||
455 | .SUFFIXES: | ||
456 | .SUFFIXES: .c .lo .o .obj | ||
457 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
458 | @for dep in $?; do \ | ||
459 | case '$(am__configure_deps)' in \ | ||
460 | *$$dep*) \ | ||
461 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
462 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
463 | exit 1;; \ | ||
464 | esac; \ | ||
465 | done; \ | ||
466 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/engines/wayland_shm/Makefile'; \ | ||
467 | $(am__cd) $(top_srcdir) && \ | ||
468 | $(AUTOMAKE) --gnu src/modules/engines/wayland_shm/Makefile | ||
469 | .PRECIOUS: Makefile | ||
470 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
471 | @case '$?' in \ | ||
472 | *config.status*) \ | ||
473 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
474 | *) \ | ||
475 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
476 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
477 | esac; | ||
478 | |||
479 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
480 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
481 | |||
482 | $(top_srcdir)/configure: $(am__configure_deps) | ||
483 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
484 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
485 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
486 | $(am__aclocal_m4_deps): | ||
487 | |||
488 | clean-noinstLTLIBRARIES: | ||
489 | -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) | ||
490 | @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ | ||
491 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
492 | test "$$dir" != "$$p" || dir=.; \ | ||
493 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
494 | rm -f "$${dir}/so_locations"; \ | ||
495 | done | ||
496 | install-pkgLTLIBRARIES: $(pkg_LTLIBRARIES) | ||
497 | @$(NORMAL_INSTALL) | ||
498 | test -z "$(pkgdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdir)" | ||
499 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
500 | list2=; for p in $$list; do \ | ||
501 | if test -f $$p; then \ | ||
502 | list2="$$list2 $$p"; \ | ||
503 | else :; fi; \ | ||
504 | done; \ | ||
505 | test -z "$$list2" || { \ | ||
506 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgdir)'"; \ | ||
507 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgdir)"; \ | ||
508 | } | ||
509 | |||
510 | uninstall-pkgLTLIBRARIES: | ||
511 | @$(NORMAL_UNINSTALL) | ||
512 | @list='$(pkg_LTLIBRARIES)'; test -n "$(pkgdir)" || list=; \ | ||
513 | for p in $$list; do \ | ||
514 | $(am__strip_dir) \ | ||
515 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgdir)/$$f'"; \ | ||
516 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgdir)/$$f"; \ | ||
517 | done | ||
518 | |||
519 | clean-pkgLTLIBRARIES: | ||
520 | -test -z "$(pkg_LTLIBRARIES)" || rm -f $(pkg_LTLIBRARIES) | ||
521 | @list='$(pkg_LTLIBRARIES)'; for p in $$list; do \ | ||
522 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
523 | test "$$dir" != "$$p" || dir=.; \ | ||
524 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
525 | rm -f "$${dir}/so_locations"; \ | ||
526 | done | ||
527 | libevas_engine_wayland_shm.la: $(libevas_engine_wayland_shm_la_OBJECTS) $(libevas_engine_wayland_shm_la_DEPENDENCIES) | ||
528 | $(AM_V_CCLD)$(LINK) $(am_libevas_engine_wayland_shm_la_rpath) $(libevas_engine_wayland_shm_la_OBJECTS) $(libevas_engine_wayland_shm_la_LIBADD) $(LIBS) | ||
529 | module.la: $(module_la_OBJECTS) $(module_la_DEPENDENCIES) | ||
530 | $(AM_V_CCLD)$(module_la_LINK) $(am_module_la_rpath) $(module_la_OBJECTS) $(module_la_LIBADD) $(LIBS) | ||
531 | |||
532 | mostlyclean-compile: | ||
533 | -rm -f *.$(OBJEXT) | ||
534 | |||
535 | distclean-compile: | ||
536 | -rm -f *.tab.c | ||
537 | |||
538 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_engine.Plo@am__quote@ | ||
539 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_outbuf.Plo@am__quote@ | ||
540 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_engine.Plo@am__quote@ | ||
541 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_la-evas_outbuf.Plo@am__quote@ | ||
542 | |||
543 | .c.o: | ||
544 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
545 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
546 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
547 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
548 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
549 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
550 | |||
551 | .c.obj: | ||
552 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
553 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
554 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
555 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
556 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
557 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
558 | |||
559 | .c.lo: | ||
560 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
561 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
562 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
563 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
564 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
565 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
566 | |||
567 | module_la-evas_engine.lo: evas_engine.c | ||
568 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_engine.lo -MD -MP -MF $(DEPDIR)/module_la-evas_engine.Tpo -c -o module_la-evas_engine.lo `test -f 'evas_engine.c' || echo '$(srcdir)/'`evas_engine.c | ||
569 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_engine.Tpo $(DEPDIR)/module_la-evas_engine.Plo | ||
570 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
571 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_engine.c' object='module_la-evas_engine.lo' libtool=yes @AMDEPBACKSLASH@ | ||
572 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
573 | @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_engine.lo `test -f 'evas_engine.c' || echo '$(srcdir)/'`evas_engine.c | ||
574 | |||
575 | module_la-evas_outbuf.lo: evas_outbuf.c | ||
576 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT module_la-evas_outbuf.lo -MD -MP -MF $(DEPDIR)/module_la-evas_outbuf.Tpo -c -o module_la-evas_outbuf.lo `test -f 'evas_outbuf.c' || echo '$(srcdir)/'`evas_outbuf.c | ||
577 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/module_la-evas_outbuf.Tpo $(DEPDIR)/module_la-evas_outbuf.Plo | ||
578 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
579 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='evas_outbuf.c' object='module_la-evas_outbuf.lo' libtool=yes @AMDEPBACKSLASH@ | ||
580 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
581 | @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(module_la_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o module_la-evas_outbuf.lo `test -f 'evas_outbuf.c' || echo '$(srcdir)/'`evas_outbuf.c | ||
582 | |||
583 | mostlyclean-libtool: | ||
584 | -rm -f *.lo | ||
585 | |||
586 | clean-libtool: | ||
587 | -rm -rf .libs _libs | ||
588 | install-includesHEADERS: $(includes_HEADERS) | ||
589 | @$(NORMAL_INSTALL) | ||
590 | test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)" | ||
591 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
592 | for p in $$list; do \ | ||
593 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
594 | echo "$$d$$p"; \ | ||
595 | done | $(am__base_list) | \ | ||
596 | while read files; do \ | ||
597 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \ | ||
598 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \ | ||
599 | done | ||
600 | |||
601 | uninstall-includesHEADERS: | ||
602 | @$(NORMAL_UNINSTALL) | ||
603 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
604 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
605 | test -n "$$files" || exit 0; \ | ||
606 | echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \ | ||
607 | cd "$(DESTDIR)$(includesdir)" && rm -f $$files | ||
608 | |||
609 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
610 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
611 | unique=`for i in $$list; do \ | ||
612 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
613 | done | \ | ||
614 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
615 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
616 | mkid -fID $$unique | ||
617 | tags: TAGS | ||
618 | |||
619 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
620 | $(TAGS_FILES) $(LISP) | ||
621 | set x; \ | ||
622 | here=`pwd`; \ | ||
623 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
624 | unique=`for i in $$list; do \ | ||
625 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
626 | done | \ | ||
627 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
628 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
629 | shift; \ | ||
630 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
631 | test -n "$$unique" || unique=$$empty_fix; \ | ||
632 | if test $$# -gt 0; then \ | ||
633 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
634 | "$$@" $$unique; \ | ||
635 | else \ | ||
636 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
637 | $$unique; \ | ||
638 | fi; \ | ||
639 | fi | ||
640 | ctags: CTAGS | ||
641 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
642 | $(TAGS_FILES) $(LISP) | ||
643 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
644 | unique=`for i in $$list; do \ | ||
645 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
646 | done | \ | ||
647 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
648 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
649 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
650 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
651 | $$unique | ||
652 | |||
653 | GTAGS: | ||
654 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
655 | && $(am__cd) $(top_srcdir) \ | ||
656 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
657 | |||
658 | distclean-tags: | ||
659 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
660 | |||
661 | distdir: $(DISTFILES) | ||
662 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
663 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
664 | list='$(DISTFILES)'; \ | ||
665 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
666 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
667 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
668 | case $$dist_files in \ | ||
669 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
670 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
671 | sort -u` ;; \ | ||
672 | esac; \ | ||
673 | for file in $$dist_files; do \ | ||
674 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
675 | if test -d $$d/$$file; then \ | ||
676 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
677 | if test -d "$(distdir)/$$file"; then \ | ||
678 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
679 | fi; \ | ||
680 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
681 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
682 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
683 | fi; \ | ||
684 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
685 | else \ | ||
686 | test -f "$(distdir)/$$file" \ | ||
687 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
688 | || exit 1; \ | ||
689 | fi; \ | ||
690 | done | ||
691 | check-am: all-am | ||
692 | check: check-am | ||
693 | all-am: Makefile $(LTLIBRARIES) $(HEADERS) | ||
694 | installdirs: | ||
695 | for dir in "$(DESTDIR)$(pkgdir)" "$(DESTDIR)$(includesdir)"; do \ | ||
696 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
697 | done | ||
698 | install: install-am | ||
699 | install-exec: install-exec-am | ||
700 | install-data: install-data-am | ||
701 | uninstall: uninstall-am | ||
702 | |||
703 | install-am: all-am | ||
704 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
705 | |||
706 | installcheck: installcheck-am | ||
707 | install-strip: | ||
708 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
709 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
710 | `test -z '$(STRIP)' || \ | ||
711 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
712 | mostlyclean-generic: | ||
713 | |||
714 | clean-generic: | ||
715 | |||
716 | distclean-generic: | ||
717 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
718 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
719 | |||
720 | maintainer-clean-generic: | ||
721 | @echo "This command is intended for maintainers to use" | ||
722 | @echo "it deletes files that may require special tools to rebuild." | ||
723 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
724 | clean: clean-am | ||
725 | |||
726 | clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ | ||
727 | clean-pkgLTLIBRARIES mostlyclean-am | ||
728 | |||
729 | distclean: distclean-am | ||
730 | -rm -rf ./$(DEPDIR) | ||
731 | -rm -f Makefile | ||
732 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
733 | distclean-tags | ||
734 | |||
735 | dvi: dvi-am | ||
736 | |||
737 | dvi-am: | ||
738 | |||
739 | html: html-am | ||
740 | |||
741 | html-am: | ||
742 | |||
743 | info: info-am | ||
744 | |||
745 | info-am: | ||
746 | |||
747 | install-data-am: install-includesHEADERS install-pkgLTLIBRARIES | ||
748 | |||
749 | install-dvi: install-dvi-am | ||
750 | |||
751 | install-dvi-am: | ||
752 | |||
753 | install-exec-am: | ||
754 | |||
755 | install-html: install-html-am | ||
756 | |||
757 | install-html-am: | ||
758 | |||
759 | install-info: install-info-am | ||
760 | |||
761 | install-info-am: | ||
762 | |||
763 | install-man: | ||
764 | |||
765 | install-pdf: install-pdf-am | ||
766 | |||
767 | install-pdf-am: | ||
768 | |||
769 | install-ps: install-ps-am | ||
770 | |||
771 | install-ps-am: | ||
772 | |||
773 | installcheck-am: | ||
774 | |||
775 | maintainer-clean: maintainer-clean-am | ||
776 | -rm -rf ./$(DEPDIR) | ||
777 | -rm -f Makefile | ||
778 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
779 | |||
780 | mostlyclean: mostlyclean-am | ||
781 | |||
782 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
783 | mostlyclean-libtool | ||
784 | |||
785 | pdf: pdf-am | ||
786 | |||
787 | pdf-am: | ||
788 | |||
789 | ps: ps-am | ||
790 | |||
791 | ps-am: | ||
792 | |||
793 | uninstall-am: uninstall-includesHEADERS uninstall-pkgLTLIBRARIES | ||
794 | |||
795 | .MAKE: install-am install-strip | ||
796 | |||
797 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
798 | clean-libtool clean-noinstLTLIBRARIES clean-pkgLTLIBRARIES \ | ||
799 | ctags distclean distclean-compile distclean-generic \ | ||
800 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
801 | html-am info info-am install install-am install-data \ | ||
802 | install-data-am install-dvi install-dvi-am install-exec \ | ||
803 | install-exec-am install-html install-html-am \ | ||
804 | install-includesHEADERS install-info install-info-am \ | ||
805 | install-man install-pdf install-pdf-am install-pkgLTLIBRARIES \ | ||
806 | install-ps install-ps-am install-strip installcheck \ | ||
807 | installcheck-am installdirs maintainer-clean \ | ||
808 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
809 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
810 | tags uninstall uninstall-am uninstall-includesHEADERS \ | ||
811 | uninstall-pkgLTLIBRARIES | ||
812 | |||
813 | |||
814 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
815 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
816 | .NOEXPORT: | ||
diff --git a/libraries/evas/src/modules/engines/wayland_shm/evas_engine.c b/libraries/evas/src/modules/engines/wayland_shm/evas_engine.c new file mode 100644 index 0000000..7c55517 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_shm/evas_engine.c | |||
@@ -0,0 +1,370 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_private.h" | ||
3 | #include "evas_engine.h" | ||
4 | #include "Evas_Engine_Wayland_Shm.h" | ||
5 | |||
6 | /* local structures */ | ||
7 | typedef struct _Render_Engine Render_Engine; | ||
8 | struct _Render_Engine | ||
9 | { | ||
10 | Tilebuf *tb; | ||
11 | Tilebuf_Rect *rects; | ||
12 | Outbuf *ob; | ||
13 | Eina_Inlist *cur_rect; | ||
14 | |||
15 | Eina_Bool end : 1; | ||
16 | |||
17 | void (*outbuf_free)(Outbuf *ob); | ||
18 | void (*outbuf_resize)(Outbuf *ob, int w, int h); | ||
19 | RGBA_Image *(*outbuf_new_region_for_update)(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); | ||
20 | void (*outbuf_push_updated_region)(Outbuf *ob, RGBA_Image *surface, int x, int y, int w, int h); | ||
21 | void (*outbuf_free_region_for_update)(Outbuf *ob, RGBA_Image *update); | ||
22 | }; | ||
23 | |||
24 | /* local variables */ | ||
25 | static Evas_Func func, pfunc; | ||
26 | |||
27 | /* external variables */ | ||
28 | int _evas_engine_way_shm_log_dom = -1; | ||
29 | |||
30 | /* local function prototypes */ | ||
31 | static void *_output_setup(int w, int h, int rotation, void *dest); | ||
32 | |||
33 | /* engine function prototypes */ | ||
34 | static void *eng_info(Evas *evas __UNUSED__); | ||
35 | static void eng_info_free(Evas *evas __UNUSED__, void *info); | ||
36 | static int eng_setup(Evas *evas, void *info); | ||
37 | static void eng_output_free(void *data); | ||
38 | static void eng_output_resize(void *data, int w, int h); | ||
39 | static void eng_output_tile_size_set(void *data, int w, int h); | ||
40 | static void eng_output_redraws_rect_add(void *data, int x, int y, int w, int h); | ||
41 | static void eng_output_redraws_rect_del(void *data, int x, int y, int w, int h); | ||
42 | static void eng_output_redraws_clear(void *data); | ||
43 | static void *eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch); | ||
44 | static void eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h); | ||
45 | static void eng_output_flush(void *data); | ||
46 | static void eng_output_idle_flush(void *data); | ||
47 | static Eina_Bool eng_canvas_alpha_get(void *data, void *context __UNUSED__); | ||
48 | |||
49 | /* local functions */ | ||
50 | static void * | ||
51 | _output_setup(int w, int h, int rotation, void *dest) | ||
52 | { | ||
53 | Render_Engine *re = NULL; | ||
54 | |||
55 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
56 | |||
57 | if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; | ||
58 | |||
59 | if (!(re->ob = evas_outbuf_setup(w, h, rotation, dest))) | ||
60 | { | ||
61 | free(re); | ||
62 | return NULL; | ||
63 | } | ||
64 | |||
65 | if (!(re->tb = evas_common_tilebuf_new(w, h))) | ||
66 | { | ||
67 | evas_outbuf_free(re->ob); | ||
68 | free(re); | ||
69 | return NULL; | ||
70 | } | ||
71 | |||
72 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
73 | return re; | ||
74 | } | ||
75 | |||
76 | /* engine functions */ | ||
77 | static void * | ||
78 | eng_info(Evas *evas __UNUSED__) | ||
79 | { | ||
80 | Evas_Engine_Info_Wayland_Shm *info; | ||
81 | |||
82 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
83 | |||
84 | if (!(info = calloc(1, sizeof(Evas_Engine_Info_Wayland_Shm)))) | ||
85 | return NULL; | ||
86 | |||
87 | info->magic.magic = rand(); | ||
88 | info->info.debug = EINA_FALSE; | ||
89 | info->render_mode = EVAS_RENDER_MODE_BLOCKING; | ||
90 | |||
91 | return info; | ||
92 | } | ||
93 | |||
94 | static void | ||
95 | eng_info_free(Evas *evas __UNUSED__, void *info) | ||
96 | { | ||
97 | Evas_Engine_Info_Wayland_Shm *in; | ||
98 | |||
99 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
100 | |||
101 | if (!(in = (Evas_Engine_Info_Wayland_Shm *)info)) return; | ||
102 | free(in); | ||
103 | } | ||
104 | |||
105 | static int | ||
106 | eng_setup(Evas *evas, void *info) | ||
107 | { | ||
108 | Evas_Engine_Info_Wayland_Shm *in; | ||
109 | Render_Engine *re = NULL; | ||
110 | |||
111 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
112 | |||
113 | if (!(in = (Evas_Engine_Info_Wayland_Shm *)info)) return 0; | ||
114 | |||
115 | if (!evas->engine.data.output) | ||
116 | { | ||
117 | evas_common_cpu_init(); | ||
118 | evas_common_blend_init(); | ||
119 | evas_common_image_init(); | ||
120 | evas_common_convert_init(); | ||
121 | evas_common_scale_init(); | ||
122 | evas_common_rectangle_init(); | ||
123 | evas_common_polygon_init(); | ||
124 | evas_common_line_init(); | ||
125 | evas_common_font_init(); | ||
126 | evas_common_draw_init(); | ||
127 | evas_common_tilebuf_init(); | ||
128 | |||
129 | re = _output_setup(evas->output.w, evas->output.h, | ||
130 | in->info.rotation, in->info.dest); | ||
131 | if (!re) return 0; | ||
132 | |||
133 | re->outbuf_free = evas_outbuf_free; | ||
134 | re->outbuf_resize = evas_outbuf_resize; | ||
135 | re->outbuf_new_region_for_update = evas_outbuf_new_region_for_update; | ||
136 | re->outbuf_push_updated_region = evas_outbuf_push_updated_region; | ||
137 | re->outbuf_free_region_for_update = evas_outbuf_free_region_for_update; | ||
138 | } | ||
139 | else | ||
140 | { | ||
141 | if (!(re = evas->engine.data.output)) return 0; | ||
142 | if (re->ob) re->outbuf_free(re->ob); | ||
143 | re->ob = evas_outbuf_setup(evas->output.w, evas->output.h, | ||
144 | in->info.rotation, in->info.dest); | ||
145 | if (re->tb) evas_common_tilebuf_free(re->tb); | ||
146 | if ((re->tb = evas_common_tilebuf_new(evas->output.w, evas->output.h))) | ||
147 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
148 | } | ||
149 | |||
150 | evas->engine.data.output = re; | ||
151 | |||
152 | if (!evas->engine.data.context) | ||
153 | { | ||
154 | evas->engine.data.context = | ||
155 | evas->engine.func->context_new(evas->engine.data.output); | ||
156 | } | ||
157 | |||
158 | return 1; | ||
159 | } | ||
160 | |||
161 | static void | ||
162 | eng_output_free(void *data) | ||
163 | { | ||
164 | Render_Engine *re = NULL; | ||
165 | |||
166 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
167 | |||
168 | if ((re = (Render_Engine *)data)) | ||
169 | { | ||
170 | if (re->ob) re->outbuf_free(re->ob); | ||
171 | if (re->tb) evas_common_tilebuf_free(re->tb); | ||
172 | if (re->rects) evas_common_tilebuf_free_render_rects(re->rects); | ||
173 | free(re); | ||
174 | } | ||
175 | evas_common_font_shutdown(); | ||
176 | evas_common_image_shutdown(); | ||
177 | } | ||
178 | |||
179 | static void | ||
180 | eng_output_resize(void *data, int w, int h) | ||
181 | { | ||
182 | Render_Engine *re = NULL; | ||
183 | |||
184 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
185 | |||
186 | if (!(re = (Render_Engine *)data)) return; | ||
187 | |||
188 | if (re->ob) re->outbuf_resize(re->ob, w, h); | ||
189 | if (re->tb) evas_common_tilebuf_free(re->tb); | ||
190 | if ((re->tb = evas_common_tilebuf_new(w, h))) | ||
191 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | ||
192 | } | ||
193 | |||
194 | static void | ||
195 | eng_output_tile_size_set(void *data, int w, int h) | ||
196 | { | ||
197 | Render_Engine *re = NULL; | ||
198 | |||
199 | if (!(re = (Render_Engine *)data)) return; | ||
200 | if (re->tb) evas_common_tilebuf_set_tile_size(re->tb, w, h); | ||
201 | } | ||
202 | |||
203 | static void | ||
204 | eng_output_redraws_rect_add(void *data, int x, int y, int w, int h) | ||
205 | { | ||
206 | Render_Engine *re = NULL; | ||
207 | |||
208 | if (!(re = (Render_Engine *)data)) return; | ||
209 | if (re->tb) evas_common_tilebuf_add_redraw(re->tb, x, y, w, h); | ||
210 | } | ||
211 | |||
212 | static void | ||
213 | eng_output_redraws_rect_del(void *data, int x, int y, int w, int h) | ||
214 | { | ||
215 | Render_Engine *re = NULL; | ||
216 | |||
217 | if (!(re = (Render_Engine *)data)) return; | ||
218 | if (re->tb) evas_common_tilebuf_del_redraw(re->tb, x, y, w, h); | ||
219 | } | ||
220 | |||
221 | static void | ||
222 | eng_output_redraws_clear(void *data) | ||
223 | { | ||
224 | Render_Engine *re = NULL; | ||
225 | |||
226 | if (!(re = (Render_Engine *)data)) return; | ||
227 | if (re->tb) evas_common_tilebuf_clear(re->tb); | ||
228 | } | ||
229 | |||
230 | static void * | ||
231 | eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch) | ||
232 | { | ||
233 | Render_Engine *re = NULL; | ||
234 | RGBA_Image *surface; | ||
235 | Tilebuf_Rect *rect; | ||
236 | int ux = 0, uy = 0, uw = 0, uh = 0; | ||
237 | |||
238 | if (!(re = (Render_Engine *)data)) return NULL; | ||
239 | if (re->end) | ||
240 | { | ||
241 | re->end = EINA_FALSE; | ||
242 | return NULL; | ||
243 | } | ||
244 | if (!re->rects) | ||
245 | { | ||
246 | re->rects = evas_common_tilebuf_get_render_rects(re->tb); | ||
247 | re->cur_rect = EINA_INLIST_GET(re->rects); | ||
248 | } | ||
249 | if (!re->cur_rect) return NULL; | ||
250 | rect = (Tilebuf_Rect *)re->cur_rect; | ||
251 | ux = rect->x; | ||
252 | uy = rect->y; | ||
253 | uw = rect->w; | ||
254 | uh = rect->h; | ||
255 | re->cur_rect = re->cur_rect->next; | ||
256 | if (!re->cur_rect) | ||
257 | { | ||
258 | evas_common_tilebuf_free_render_rects(re->rects); | ||
259 | re->rects = NULL; | ||
260 | re->end = EINA_TRUE; | ||
261 | } | ||
262 | if ((ux + uw) > re->ob->w) uw = re->ob->w - ux; | ||
263 | if ((uy + uh) > re->ob->h) uh = re->ob->h - uy; | ||
264 | if ((uw <= 0) || (uh <= 0)) return NULL; | ||
265 | surface = | ||
266 | re->outbuf_new_region_for_update(re->ob, ux, uy, uw, uh, cx, cy, cw, ch); | ||
267 | if (x) *x = ux; | ||
268 | if (y) *y = uy; | ||
269 | if (w) *w = uw; | ||
270 | if (h) *h = uh; | ||
271 | return surface; | ||
272 | } | ||
273 | |||
274 | static void | ||
275 | eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int w, int h) | ||
276 | { | ||
277 | Render_Engine *re = NULL; | ||
278 | |||
279 | if (!(re = (Render_Engine *)data)) return; | ||
280 | #ifdef BUILD_PIPE_RENDER | ||
281 | evas_common_pipe_map_begin(surface); | ||
282 | #endif | ||
283 | if (re->ob) | ||
284 | { | ||
285 | re->outbuf_push_updated_region(re->ob, surface, x, y, w, h); | ||
286 | re->outbuf_free_region_for_update(re->ob, surface); | ||
287 | } | ||
288 | evas_common_cpu_end_opt(); | ||
289 | } | ||
290 | |||
291 | static void | ||
292 | eng_output_flush(void *data) | ||
293 | { | ||
294 | Render_Engine *re = NULL; | ||
295 | |||
296 | if (!(re = (Render_Engine *)data)) return; | ||
297 | } | ||
298 | |||
299 | static void | ||
300 | eng_output_idle_flush(void *data) | ||
301 | { | ||
302 | Render_Engine *re = NULL; | ||
303 | |||
304 | if (!(re = (Render_Engine *)data)) return; | ||
305 | } | ||
306 | |||
307 | static Eina_Bool | ||
308 | eng_canvas_alpha_get(void *data, void *context __UNUSED__) | ||
309 | { | ||
310 | Render_Engine *re = NULL; | ||
311 | |||
312 | if (!(re = (Render_Engine *)data)) return EINA_FALSE; | ||
313 | return EINA_TRUE; | ||
314 | } | ||
315 | |||
316 | /* module functions */ | ||
317 | static int | ||
318 | module_open(Evas_Module *em) | ||
319 | { | ||
320 | if (!em) return 0; | ||
321 | |||
322 | if (!_evas_module_engine_inherit(&pfunc, "software_generic")) | ||
323 | return 0; | ||
324 | |||
325 | _evas_engine_way_shm_log_dom = | ||
326 | eina_log_domain_register("evas-wayland_shm", EVAS_DEFAULT_LOG_COLOR); | ||
327 | if (_evas_engine_way_shm_log_dom < 0) | ||
328 | { | ||
329 | EINA_LOG_ERR("Could not create a module log domain."); | ||
330 | return 0; | ||
331 | } | ||
332 | |||
333 | func = pfunc; | ||
334 | |||
335 | #define ORD(f) EVAS_API_OVERRIDE(f, &func, eng_) | ||
336 | ORD(info); | ||
337 | ORD(info_free); | ||
338 | ORD(setup); | ||
339 | ORD(canvas_alpha_get); | ||
340 | ORD(output_free); | ||
341 | ORD(output_resize); | ||
342 | ORD(output_tile_size_set); | ||
343 | ORD(output_redraws_rect_add); | ||
344 | ORD(output_redraws_rect_del); | ||
345 | ORD(output_redraws_clear); | ||
346 | ORD(output_redraws_next_update_get); | ||
347 | ORD(output_redraws_next_update_push); | ||
348 | ORD(output_flush); | ||
349 | ORD(output_idle_flush); | ||
350 | |||
351 | em->functions = (void *)(&func); | ||
352 | return 1; | ||
353 | } | ||
354 | |||
355 | static void | ||
356 | module_close(Evas_Module *em __UNUSED__) | ||
357 | { | ||
358 | eina_log_domain_unregister(_evas_engine_way_shm_log_dom); | ||
359 | } | ||
360 | |||
361 | static Evas_Module_Api evas_modapi = | ||
362 | { | ||
363 | EVAS_MODULE_API_VERSION, "wayland_shm", "none", {module_open, module_close} | ||
364 | }; | ||
365 | |||
366 | EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, wayland_shm); | ||
367 | |||
368 | #ifndef EVAS_STATIC_BUILD_WAYLAND_SHM | ||
369 | EVAS_EINA_MODULE_DEFINE(engine, wayland_shm); | ||
370 | #endif | ||
diff --git a/libraries/evas/src/modules/engines/wayland_shm/evas_engine.h b/libraries/evas/src/modules/engines/wayland_shm/evas_engine.h new file mode 100644 index 0000000..878851a --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_shm/evas_engine.h | |||
@@ -0,0 +1,60 @@ | |||
1 | #ifndef _EVAS_ENGINE_H | ||
2 | # define _EVAS_ENGINE_H | ||
3 | |||
4 | //# define LOGFNS 1 | ||
5 | |||
6 | # ifdef LOGFNS | ||
7 | # include <stdio.h> | ||
8 | # define LOGFN(fl, ln, fn) printf("-EVAS-WL: %25s: %5i - %s\n", fl, ln, fn); | ||
9 | # else | ||
10 | # define LOGFN(fl, ln, fn) | ||
11 | # endif | ||
12 | |||
13 | extern int _evas_engine_way_shm_log_dom; | ||
14 | |||
15 | # ifdef ERR | ||
16 | # undef ERR | ||
17 | # endif | ||
18 | # define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_way_shm_log_dom, __VA_ARGS__) | ||
19 | |||
20 | # ifdef DBG | ||
21 | # undef DBG | ||
22 | # endif | ||
23 | # define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_way_shm_log_dom, __VA_ARGS__) | ||
24 | |||
25 | # ifdef INF | ||
26 | # undef INF | ||
27 | # endif | ||
28 | # define INF(...) EINA_LOG_DOM_INFO(_evas_engine_way_shm_log_dom, __VA_ARGS__) | ||
29 | |||
30 | # ifdef WRN | ||
31 | # undef WRN | ||
32 | # endif | ||
33 | # define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_way_shm_log_dom, __VA_ARGS__) | ||
34 | |||
35 | # ifdef CRIT | ||
36 | # undef CRIT | ||
37 | # endif | ||
38 | # define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_way_shm_log_dom, __VA_ARGS__) | ||
39 | |||
40 | typedef struct _Outbuf Outbuf; | ||
41 | struct _Outbuf | ||
42 | { | ||
43 | int w, h; | ||
44 | int rotation; | ||
45 | |||
46 | struct | ||
47 | { | ||
48 | void *dest; | ||
49 | RGBA_Image *buffer; | ||
50 | } priv; | ||
51 | }; | ||
52 | |||
53 | void evas_outbuf_free(Outbuf *ob); | ||
54 | void evas_outbuf_resize(Outbuf *ob, int w, int h); | ||
55 | Outbuf *evas_outbuf_setup(int w, int h, int rot, void *dest); | ||
56 | RGBA_Image *evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); | ||
57 | void evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__, int y, int w, int h); | ||
58 | void evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update); | ||
59 | |||
60 | #endif | ||
diff --git a/libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c b/libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c new file mode 100644 index 0000000..490a978 --- /dev/null +++ b/libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c | |||
@@ -0,0 +1,100 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_engine.h" | ||
3 | |||
4 | void | ||
5 | evas_outbuf_free(Outbuf *ob) | ||
6 | { | ||
7 | if (!ob) return; | ||
8 | if (ob->priv.buffer) evas_cache_image_drop(&ob->priv.buffer->cache_entry); | ||
9 | free(ob); | ||
10 | } | ||
11 | |||
12 | void | ||
13 | evas_outbuf_resize(Outbuf *ob, int w, int h) | ||
14 | { | ||
15 | if (!ob) return; | ||
16 | if ((ob->w == w) && (ob->h == h)) return; | ||
17 | ob->w = w; | ||
18 | ob->h = h; | ||
19 | if (ob->priv.buffer) evas_cache_image_drop(&ob->priv.buffer->cache_entry); | ||
20 | ob->priv.buffer = NULL; | ||
21 | } | ||
22 | |||
23 | Outbuf * | ||
24 | evas_outbuf_setup(int w, int h, int rot, void *dest) | ||
25 | { | ||
26 | Outbuf *ob = NULL; | ||
27 | |||
28 | if (!(ob = calloc(1, sizeof(Outbuf)))) return NULL; | ||
29 | |||
30 | ob->w = w; | ||
31 | ob->h = h; | ||
32 | ob->rotation = rot; | ||
33 | ob->priv.dest = dest; | ||
34 | |||
35 | ob->priv.buffer = | ||
36 | (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), | ||
37 | w, h, ob->priv.dest, | ||
38 | 1, EVAS_COLORSPACE_ARGB8888); | ||
39 | |||
40 | return ob; | ||
41 | } | ||
42 | |||
43 | RGBA_Image * | ||
44 | evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch) | ||
45 | { | ||
46 | if (ob->priv.buffer) | ||
47 | { | ||
48 | *cx = x; *cy = y; *cw = w; *ch = h; | ||
49 | return ob->priv.buffer; | ||
50 | } | ||
51 | else | ||
52 | { | ||
53 | RGBA_Image *im; | ||
54 | |||
55 | *cx = 0; *cy = 0; *cw = w; *ch = h; | ||
56 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
57 | if (im) | ||
58 | { | ||
59 | im->cache_entry.flags.alpha = 1; | ||
60 | im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h); | ||
61 | } | ||
62 | |||
63 | return im; | ||
64 | } | ||
65 | |||
66 | return NULL; | ||
67 | } | ||
68 | |||
69 | void | ||
70 | evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__, int y, int w, int h) | ||
71 | { | ||
72 | if (!ob->priv.dest) return; | ||
73 | if (!ob->priv.buffer) | ||
74 | { | ||
75 | Gfx_Func_Copy func; | ||
76 | |||
77 | func = evas_common_draw_func_copy_get(w, 0); | ||
78 | if (func) | ||
79 | { | ||
80 | DATA32 *dst, *src; | ||
81 | int yy = 0, bytes = 0; | ||
82 | |||
83 | bytes = ((w * sizeof(int)) * h); | ||
84 | for (yy = 0; yy < h; yy++) | ||
85 | { | ||
86 | src = update->image.data + (yy * update->cache_entry.w); | ||
87 | dst = (DATA32 *)((DATA8 *)(ob->priv.dest) + | ||
88 | ((y + yy) * bytes)); | ||
89 | func(src, dst, w); | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | |||
95 | void | ||
96 | evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update) | ||
97 | { | ||
98 | if (!ob) return; | ||
99 | if (update != ob->priv.buffer) evas_cache_image_drop(&update->cache_entry); | ||
100 | } | ||
diff --git a/libraries/evas/src/modules/loaders/Makefile.in b/libraries/evas/src/modules/loaders/Makefile.in index 2120a33..454dcd8 100644 --- a/libraries/evas/src/modules/loaders/Makefile.in +++ b/libraries/evas/src/modules/loaders/Makefile.in | |||
@@ -49,7 +49,7 @@ host_triplet = @host@ | |||
49 | @BUILD_LOADER_WBMP_TRUE@@EVAS_STATIC_BUILD_WBMP_FALSE@am__append_14 = wbmp | 49 | @BUILD_LOADER_WBMP_TRUE@@EVAS_STATIC_BUILD_WBMP_FALSE@am__append_14 = wbmp |
50 | @BUILD_LOADER_XPM_TRUE@@EVAS_STATIC_BUILD_XPM_FALSE@am__append_15 = xpm | 50 | @BUILD_LOADER_XPM_TRUE@@EVAS_STATIC_BUILD_XPM_FALSE@am__append_15 = xpm |
51 | subdir = src/modules/loaders | 51 | subdir = src/modules/loaders |
52 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in TODO | 52 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in |
53 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | 53 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
54 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | 54 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ |
55 | $(top_srcdir)/m4/efl_coverage.m4 \ | 55 | $(top_srcdir)/m4/efl_coverage.m4 \ |
@@ -222,8 +222,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
222 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 222 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
223 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 223 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
224 | PKG_CONFIG = @PKG_CONFIG@ | 224 | PKG_CONFIG = @PKG_CONFIG@ |
225 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
226 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
227 | PNG_CFLAGS = @PNG_CFLAGS@ | 225 | PNG_CFLAGS = @PNG_CFLAGS@ |
228 | PNG_LIBS = @PNG_LIBS@ | 226 | PNG_LIBS = @PNG_LIBS@ |
229 | RANLIB = @RANLIB@ | 227 | RANLIB = @RANLIB@ |
@@ -240,6 +238,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
240 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 238 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
241 | VERSION = @VERSION@ | 239 | VERSION = @VERSION@ |
242 | VMAJ = @VMAJ@ | 240 | VMAJ = @VMAJ@ |
241 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
242 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
243 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 243 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
244 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 244 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
245 | XCB_CFLAGS = @XCB_CFLAGS@ | 245 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -321,6 +321,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
321 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 321 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
322 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 322 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
323 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 323 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
324 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
325 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
326 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
327 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
324 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 328 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
325 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 329 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
326 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 330 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/TODO b/libraries/evas/src/modules/loaders/TODO deleted file mode 100644 index 3b82543..0000000 --- a/libraries/evas/src/modules/loaders/TODO +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | DONE -> bmp tga ico | ||
2 | id3 gz bz2 <- extraction loaders | ||
3 | lbm <- aaah amiga days | ||
4 | ani <- why> | ||
5 | |||
diff --git a/libraries/evas/src/modules/loaders/bmp/Makefile.in b/libraries/evas/src/modules/loaders/bmp/Makefile.in index f2c3e20..943fb74 100644 --- a/libraries/evas/src/modules/loaders/bmp/Makefile.in +++ b/libraries/evas/src/modules/loaders/bmp/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c b/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c index 38e3680..6d15783 100644 --- a/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c +++ b/libraries/evas/src/modules/loaders/bmp/evas_image_load_bmp.c | |||
@@ -21,50 +21,91 @@ static Evas_Image_Load_Func evas_image_load_bmp_func = | |||
21 | EINA_TRUE, | 21 | EINA_TRUE, |
22 | evas_image_load_file_head_bmp, | 22 | evas_image_load_file_head_bmp, |
23 | evas_image_load_file_data_bmp, | 23 | evas_image_load_file_data_bmp, |
24 | NULL | 24 | NULL, |
25 | EINA_FALSE | ||
25 | }; | 26 | }; |
26 | 27 | ||
27 | static int | 28 | static Eina_Bool |
28 | read_short(FILE *file, short *ret) | 29 | read_short(unsigned char *map, size_t length, size_t *position, short *ret) |
29 | { | 30 | { |
30 | unsigned char b[2]; | 31 | unsigned char b[2]; |
31 | if (fread(b, sizeof(unsigned char), 2, file) != 2) return 0; | 32 | |
33 | if (*position + 2 > length) return EINA_FALSE; | ||
34 | b[0] = map[(*position)++]; | ||
35 | b[1] = map[(*position)++]; | ||
32 | *ret = (b[1] << 8) | b[0]; | 36 | *ret = (b[1] << 8) | b[0]; |
33 | return 1; | 37 | return EINA_TRUE; |
34 | } | 38 | } |
35 | 39 | ||
36 | static int | 40 | static Eina_Bool |
37 | read_ushort(FILE *file, unsigned short *ret) | 41 | read_ushort(unsigned char *map, size_t length, size_t *position, unsigned short *ret) |
38 | { | 42 | { |
39 | unsigned char b[2]; | 43 | unsigned char b[2]; |
40 | if (fread(b, sizeof(unsigned char), 2, file) != 2) return 0; | 44 | |
45 | if (*position + 2 > length) return EINA_FALSE; | ||
46 | b[0] = map[(*position)++]; | ||
47 | b[1] = map[(*position)++]; | ||
41 | *ret = (b[1] << 8) | b[0]; | 48 | *ret = (b[1] << 8) | b[0]; |
42 | return 1; | 49 | return EINA_TRUE; |
43 | } | 50 | } |
44 | 51 | ||
45 | static int | 52 | static Eina_Bool |
46 | read_int(FILE *file, int *ret) | 53 | read_int(unsigned char *map, size_t length, size_t *position, int *ret) |
47 | { | 54 | { |
48 | unsigned char b[4]; | 55 | unsigned char b[4]; |
49 | if (fread(b, sizeof(unsigned char), 4, file) != 4) return 0; | 56 | int i; |
57 | |||
58 | if (*position + 4 > length) return EINA_FALSE; | ||
59 | for (i = 0; i < 4; i++) | ||
60 | b[i] = map[(*position)++]; | ||
50 | *ret = ARGB_JOIN(b[3], b[2], b[1], b[0]); | 61 | *ret = ARGB_JOIN(b[3], b[2], b[1], b[0]); |
51 | return 1; | 62 | return EINA_TRUE; |
52 | } | 63 | } |
53 | 64 | ||
54 | static int | 65 | static Eina_Bool |
55 | read_uint(FILE *file, unsigned int *ret) | 66 | read_uint(unsigned char *map, size_t length, size_t *position, unsigned int *ret) |
56 | { | 67 | { |
57 | unsigned char b[4]; | 68 | unsigned char b[4]; |
58 | if (fread(b, sizeof(unsigned char), 4, file) != 4) return 0; | 69 | int i; |
70 | |||
71 | if (*position + 4 > length) return EINA_FALSE; | ||
72 | for (i = 0; i < 4; i++) | ||
73 | b[i] = map[(*position)++]; | ||
59 | *ret = ARGB_JOIN(b[3], b[2], b[1], b[0]); | 74 | *ret = ARGB_JOIN(b[3], b[2], b[1], b[0]); |
60 | return 1; | 75 | return EINA_TRUE; |
76 | } | ||
77 | |||
78 | static Eina_Bool | ||
79 | read_uchar(unsigned char *map, size_t length, size_t *position, unsigned char *ret) | ||
80 | { | ||
81 | if (*position + 1 > length) return EINA_FALSE; | ||
82 | *ret = map[(*position)++]; | ||
83 | return EINA_TRUE; | ||
84 | } | ||
85 | |||
86 | static Eina_Bool | ||
87 | read_skip(size_t length, size_t *position, int skip) | ||
88 | { | ||
89 | if (*position + skip > length) return EINA_FALSE; | ||
90 | *position += skip; | ||
91 | return EINA_TRUE; | ||
92 | } | ||
93 | |||
94 | static Eina_Bool | ||
95 | read_mem(unsigned char *map, size_t length, size_t *position, void *buffer, int size) | ||
96 | { | ||
97 | if (*position + size > length) return EINA_FALSE; | ||
98 | memcpy(buffer, map + *position, size); | ||
99 | *position += size; | ||
100 | return EINA_TRUE; | ||
61 | } | 101 | } |
62 | 102 | ||
63 | static Eina_Bool | 103 | static Eina_Bool |
64 | evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) | 104 | evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) |
65 | { | 105 | { |
66 | FILE *f; | 106 | Eina_File *f; |
67 | char buf[4096]; | 107 | void *map = NULL; |
108 | size_t position = 0; | ||
68 | char hasa = 0; | 109 | char hasa = 0; |
69 | int w = 0, h = 0, planes = 0, bit_count = 0, | 110 | int w = 0, h = 0, planes = 0, bit_count = 0, |
70 | image_size = 0, comp = 0, hdpi = 0, vdpi = 0, | 111 | image_size = 0, comp = 0, hdpi = 0, vdpi = 0, |
@@ -76,7 +117,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key | |||
76 | unsigned int bmpsize; | 117 | unsigned int bmpsize; |
77 | unsigned short res1, res2; | 118 | unsigned short res1, res2; |
78 | 119 | ||
79 | f = fopen(file, "rb"); | 120 | f = eina_file_open(file, 0); |
80 | if (!f) | 121 | if (!f) |
81 | { | 122 | { |
82 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 123 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
@@ -84,84 +125,85 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key | |||
84 | } | 125 | } |
85 | 126 | ||
86 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 127 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
87 | fseek(f, 0, SEEK_END); | 128 | fsize = eina_file_size_get(f); |
88 | fsize = ftell(f); | ||
89 | fseek(f, 0, SEEK_SET); | ||
90 | if (fsize < 2) goto close_file; | 129 | if (fsize < 2) goto close_file; |
91 | 130 | ||
92 | if (fread(buf, 2, 1, f) != 1) goto close_file; | 131 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); |
93 | if (strncmp(buf, "BM", 2)) goto close_file; // magic number | 132 | if (!map) goto close_file; |
133 | |||
134 | if (strncmp(map, "BM", 2)) goto close_file; // magic number | ||
135 | position += 2; | ||
94 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 136 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
95 | if (!read_uint(f, &bmpsize)) goto close_file; | 137 | if (!read_uint(map, fsize, &position, &bmpsize)) goto close_file; |
96 | if (!read_ushort(f, &res1)) goto close_file; | 138 | if (!read_ushort(map, fsize, &position, &res1)) goto close_file; |
97 | if (!read_ushort(f, &res2)) goto close_file; | 139 | if (!read_ushort(map, fsize, &position, &res2)) goto close_file; |
98 | if (!read_uint(f, &offset)) goto close_file; | 140 | if (!read_uint(map, fsize, &position, &offset)) goto close_file; |
99 | if (!read_uint(f, &head_size)) goto close_file; | 141 | if (!read_uint(map, fsize, &position, &head_size)) goto close_file; |
100 | if (head_size == 12) // OS/2 V1 + Windows 3.0 | 142 | if (head_size == 12) // OS/2 V1 + Windows 3.0 |
101 | { | 143 | { |
102 | short tmp; | 144 | short tmp; |
103 | 145 | ||
104 | if (!read_short(f, &tmp)) goto close_file; | 146 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
105 | w = tmp; // width | 147 | w = tmp; // width |
106 | if (!read_short(f, &tmp)) goto close_file; | 148 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
107 | h = tmp; // height | 149 | h = tmp; // height |
108 | if (!read_short(f, &tmp)) goto close_file; | 150 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
109 | planes = tmp; // must be 1 | 151 | planes = tmp; // must be 1 |
110 | if (!read_short(f, &tmp)) goto close_file; | 152 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
111 | bit_count = tmp; // bits per pixel: 1, 4, 8 & 24 | 153 | bit_count = tmp; // bits per pixel: 1, 4, 8 & 24 |
112 | } | 154 | } |
113 | else if (head_size == 64) // OS/2 V2 | 155 | else if (head_size == 64) // OS/2 V2 |
114 | { | 156 | { |
115 | short tmp; | 157 | short tmp; |
116 | int tmp2; | 158 | int tmp2; |
117 | 159 | ||
118 | if (!read_int(f, &tmp2)) goto close_file; | 160 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
119 | w = tmp2; // width | 161 | w = tmp2; // width |
120 | if (!read_int(f, &tmp2)) goto close_file; | 162 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
121 | h = tmp2; // height | 163 | h = tmp2; // height |
122 | if (!read_short(f, &tmp)) goto close_file; | 164 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
123 | planes = tmp; // must be 1 | 165 | planes = tmp; // must be 1 |
124 | if (!read_short(f, &tmp)) goto close_file; | 166 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
125 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 167 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
126 | if (!read_int(f, &tmp2)) goto close_file; | 168 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
127 | comp = tmp2; // compression method | 169 | comp = tmp2; // compression method |
128 | if (!read_int(f, &tmp2)) goto close_file; | 170 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
129 | image_size = tmp2; // bitmap data size | 171 | image_size = tmp2; // bitmap data size |
130 | if (!read_int(f, &tmp2)) goto close_file; | 172 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
131 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 173 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
132 | if (!read_int(f, &tmp2)) goto close_file; | 174 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
133 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 175 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
134 | if (!read_int(f, &tmp2)) goto close_file; | 176 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
135 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 177 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
136 | if (!read_int(f, &tmp2)) goto close_file; | 178 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
137 | important_colors = tmp2; // number of important colors - 0 if all | 179 | important_colors = tmp2; // number of important colors - 0 if all |
138 | if (fread(buf, 24, 1, f) != 1) goto close_file; // skip unused header | 180 | if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header |
139 | if (image_size == 0) image_size = fsize - offset; | 181 | if (image_size == 0) image_size = fsize - offset; |
140 | } | 182 | } |
141 | else if (head_size == 40) // Windows 3.0 + (v3) | 183 | else if (head_size == 40) // Windows 3.0 + (v3) |
142 | { | 184 | { |
143 | short tmp; | 185 | short tmp; |
144 | int tmp2; | 186 | int tmp2; |
145 | 187 | ||
146 | if (!read_int(f, &tmp2)) goto close_file; | 188 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
147 | w = tmp2; // width | 189 | w = tmp2; // width |
148 | if (!read_int(f, &tmp2)) goto close_file; | 190 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
149 | h = tmp2; // height | 191 | h = tmp2; // height |
150 | if (!read_short(f, &tmp)) goto close_file; | 192 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
151 | planes = tmp; // must be 1 | 193 | planes = tmp; // must be 1 |
152 | if (!read_short(f, &tmp)) goto close_file; | 194 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
153 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 195 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
154 | if (!read_int(f, &tmp2)) goto close_file; | 196 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
155 | comp = tmp2; // compression method | 197 | comp = tmp2; // compression method |
156 | if (!read_int(f, &tmp2)) goto close_file; | 198 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
157 | image_size = tmp2; // bitmap data size | 199 | image_size = tmp2; // bitmap data size |
158 | if (!read_int(f, &tmp2)) goto close_file; | 200 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
159 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 201 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
160 | if (!read_int(f, &tmp2)) goto close_file; | 202 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
161 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 203 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
162 | if (!read_int(f, &tmp2)) goto close_file; | 204 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
163 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 205 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
164 | if (!read_int(f, &tmp2)) goto close_file; | 206 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
165 | important_colors = tmp2; // number of important colors - 0 if all | 207 | important_colors = tmp2; // number of important colors - 0 if all |
166 | if (image_size == 0) image_size = fsize - offset; | 208 | if (image_size == 0) image_size = fsize - offset; |
167 | if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way | 209 | if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way |
@@ -170,37 +212,37 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key | |||
170 | { | 212 | { |
171 | short tmp; | 213 | short tmp; |
172 | int tmp2; | 214 | int tmp2; |
173 | 215 | ||
174 | if (!read_int(f, &tmp2)) goto close_file; | 216 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
175 | w = tmp2; // width | 217 | w = tmp2; // width |
176 | if (!read_int(f, &tmp2)) goto close_file; | 218 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
177 | h = tmp2; // height | 219 | h = tmp2; // height |
178 | if (!read_short(f, &tmp)) goto close_file; | 220 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
179 | planes = tmp; // must be 1 | 221 | planes = tmp; // must be 1 |
180 | if (!read_short(f, &tmp)) goto close_file; | 222 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
181 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 223 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
182 | if (!read_int(f, &tmp2)) goto close_file; | 224 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
183 | comp = tmp2; // compression method | 225 | comp = tmp2; // compression method |
184 | if (!read_int(f, &tmp2)) goto close_file; | 226 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
185 | image_size = tmp2; // bitmap data size | 227 | image_size = tmp2; // bitmap data size |
186 | if (!read_int(f, &tmp2)) goto close_file; | 228 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
187 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 229 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
188 | if (!read_int(f, &tmp2)) goto close_file; | 230 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
189 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 231 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
190 | if (!read_int(f, &tmp2)) goto close_file; | 232 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
191 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 233 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
192 | if (!read_int(f, &tmp2)) goto close_file; | 234 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
193 | important_colors = tmp2; // number of important colors - 0 if all | 235 | important_colors = tmp2; // number of important colors - 0 if all |
194 | if (!read_int(f, &tmp2)) goto close_file; | 236 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
195 | rmask = tmp2; // red mask | 237 | rmask = tmp2; // red mask |
196 | if (!read_int(f, &tmp2)) goto close_file; | 238 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
197 | gmask = tmp2; // green mask | 239 | gmask = tmp2; // green mask |
198 | if (!read_int(f, &tmp2)) goto close_file; | 240 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
199 | bmask = tmp2; // blue mask | 241 | bmask = tmp2; // blue mask |
200 | if (!read_int(f, &tmp2)) goto close_file; | 242 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
201 | amask = tmp2; // alpha mask | 243 | amask = tmp2; // alpha mask |
202 | if (fread(buf, 36, 1, f) != 1) goto close_file; // skip unused cie | 244 | if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie |
203 | if (fread(buf, 12, 1, f) != 1) goto close_file; // skip unused gamma | 245 | if (!read_skip(fsize, &position, 12)) goto close_file; // skip unused gamma |
204 | if (image_size == 0) image_size = fsize - offset; | 246 | if (image_size == 0) image_size = fsize - offset; |
205 | if ((amask) && (bit_count == 32)) hasa = 1; | 247 | if ((amask) && (bit_count == 32)) hasa = 1; |
206 | } | 248 | } |
@@ -208,38 +250,38 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key | |||
208 | { | 250 | { |
209 | short tmp; | 251 | short tmp; |
210 | int tmp2; | 252 | int tmp2; |
211 | 253 | ||
212 | if (!read_int(f, &tmp2)) goto close_file; | 254 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
213 | w = tmp2; // width | 255 | w = tmp2; // width |
214 | if (!read_int(f, &tmp2)) goto close_file; | 256 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
215 | h = tmp2; // height | 257 | h = tmp2; // height |
216 | if (!read_short(f, &tmp)) goto close_file; | 258 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
217 | planes = tmp; // must be 1 | 259 | planes = tmp; // must be 1 |
218 | if (!read_short(f, &tmp)) goto close_file; | 260 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
219 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 261 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
220 | if (!read_int(f, &tmp2)) goto close_file; | 262 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
221 | comp = tmp2; // compression method | 263 | comp = tmp2; // compression method |
222 | if (!read_int(f, &tmp2)) goto close_file; | 264 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
223 | image_size = tmp2; // bitmap data size | 265 | image_size = tmp2; // bitmap data size |
224 | if (!read_int(f, &tmp2)) goto close_file; | 266 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
225 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 267 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
226 | if (!read_int(f, &tmp2)) goto close_file; | 268 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
227 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 269 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
228 | if (!read_int(f, &tmp2)) goto close_file; | 270 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
229 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 271 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
230 | if (!read_int(f, &tmp2)) goto close_file; | 272 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
231 | important_colors = tmp2; // number of important colors - 0 if all | 273 | important_colors = tmp2; // number of important colors - 0 if all |
232 | if (!read_int(f, &tmp2)) goto close_file; | 274 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
233 | rmask = tmp2; // red mask | 275 | rmask = tmp2; // red mask |
234 | if (!read_int(f, &tmp2)) goto close_file; | 276 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
235 | gmask = tmp2; // green mask | 277 | gmask = tmp2; // green mask |
236 | if (!read_int(f, &tmp2)) goto close_file; | 278 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
237 | bmask = tmp2; // blue mask | 279 | bmask = tmp2; // blue mask |
238 | if (!read_int(f, &tmp2)) goto close_file; | 280 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
239 | amask = tmp2; // alpha mask | 281 | amask = tmp2; // alpha mask |
240 | if (fread(buf, 36, 1, f) != 1) goto close_file; // skip unused cie | 282 | if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie |
241 | if (fread(buf, 12, 1, f) != 1) goto close_file; // skip unused gamma | 283 | if (!read_skip(fsize, &position, 12)) goto close_file; // skip unused gamma |
242 | if (fread(buf, 16, 1, f) != 1) goto close_file; // skip others | 284 | if (!read_skip(fsize, &position, 16)) goto close_file; // skip others |
243 | if (image_size == 0) image_size = fsize - offset; | 285 | if (image_size == 0) image_size = fsize - offset; |
244 | if ((amask) && (bit_count == 32)) hasa = 1; | 286 | if ((amask) && (bit_count == 32)) hasa = 1; |
245 | } | 287 | } |
@@ -251,7 +293,7 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key | |||
251 | h = -h; | 293 | h = -h; |
252 | right_way_up = 1; | 294 | right_way_up = 1; |
253 | } | 295 | } |
254 | 296 | ||
255 | if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) || | 297 | if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) || |
256 | IMG_TOO_BIG(w, h)) | 298 | IMG_TOO_BIG(w, h)) |
257 | { | 299 | { |
@@ -327,21 +369,24 @@ evas_image_load_file_head_bmp(Image_Entry *ie, const char *file, const char *key | |||
327 | ie->w = w; | 369 | ie->w = w; |
328 | ie->h = h; | 370 | ie->h = h; |
329 | if (hasa) ie->flags.alpha = 1; | 371 | if (hasa) ie->flags.alpha = 1; |
330 | 372 | ||
331 | fclose(f); | 373 | eina_file_map_free(f, map); |
374 | eina_file_close(f); | ||
332 | *error = EVAS_LOAD_ERROR_NONE; | 375 | *error = EVAS_LOAD_ERROR_NONE; |
333 | return EINA_TRUE; | 376 | return EINA_TRUE; |
334 | 377 | ||
335 | close_file: | 378 | close_file: |
336 | fclose(f); | 379 | if (map) eina_file_map_free(f, map); |
380 | eina_file_close(f); | ||
337 | return EINA_FALSE; | 381 | return EINA_FALSE; |
338 | } | 382 | } |
339 | 383 | ||
340 | static Eina_Bool | 384 | static Eina_Bool |
341 | evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) | 385 | evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) |
342 | { | 386 | { |
343 | FILE *f; | 387 | Eina_File *f; |
344 | char buf[4096]; | 388 | void *map = NULL; |
389 | size_t position = 0; | ||
345 | unsigned char *buffer = NULL, *buffer_end = NULL, *p; | 390 | unsigned char *buffer = NULL, *buffer_end = NULL, *p; |
346 | char hasa = 0; | 391 | char hasa = 0; |
347 | int x = 0, y = 0, w = 0, h = 0, planes = 0, bit_count = 0, image_size = 0, | 392 | int x = 0, y = 0, w = 0, h = 0, planes = 0, bit_count = 0, image_size = 0, |
@@ -361,96 +406,96 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
361 | int row_size = 0; /* Row size is rounded up to a multiple of 4bytes */ | 406 | int row_size = 0; /* Row size is rounded up to a multiple of 4bytes */ |
362 | int read_line = 0; /* total read line */ | 407 | int read_line = 0; /* total read line */ |
363 | 408 | ||
364 | 409 | f = eina_file_open(file, 0); | |
365 | f = fopen(file, "rb"); | ||
366 | if (!f) | 410 | if (!f) |
367 | { | 411 | { |
368 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 412 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
369 | return EINA_FALSE; | 413 | return EINA_FALSE; |
370 | } | 414 | } |
371 | 415 | ||
372 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 416 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
373 | fseek(f, 0, SEEK_END); | 417 | fsize = eina_file_size_get(f); |
374 | fsize = ftell(f); | ||
375 | fseek(f, 0, SEEK_SET); | ||
376 | if (fsize < 2) goto close_file; | 418 | if (fsize < 2) goto close_file; |
419 | |||
420 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); | ||
421 | if (!map) goto close_file; | ||
377 | 422 | ||
378 | if (fread(buf, 2, 1, f) != 1) goto close_file; | 423 | if (strncmp(map, "BM", 2)) goto close_file; // magic number |
379 | if (strncmp(buf, "BM", 2)) goto close_file; // magic number | 424 | position += 2; |
380 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 425 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
381 | if (!read_uint(f, &bmpsize)) goto close_file; | 426 | if (!read_uint(map, fsize, &position, &bmpsize)) goto close_file; |
382 | if (!read_ushort(f, &res1)) goto close_file; | 427 | if (!read_ushort(map, fsize, &position, &res1)) goto close_file; |
383 | if (!read_ushort(f, &res2)) goto close_file; | 428 | if (!read_ushort(map, fsize, &position, &res2)) goto close_file; |
384 | if (!read_uint(f, &offset)) goto close_file; | 429 | if (!read_uint(map, fsize, &position, &offset)) goto close_file; |
385 | if (!read_uint(f, &head_size)) goto close_file; | 430 | if (!read_uint(map, fsize, &position, &head_size)) goto close_file; |
386 | image_size = fsize - offset; | 431 | image_size = fsize - offset; |
387 | if (image_size < 1) goto close_file; | 432 | if (image_size < 1) goto close_file; |
388 | 433 | ||
389 | if (head_size == 12) // OS/2 V1 + Windows 3.0 | 434 | if (head_size == 12) // OS/2 V1 + Windows 3.0 |
390 | { | 435 | { |
391 | short tmp; | 436 | short tmp; |
392 | 437 | ||
393 | if (!read_short(f, &tmp)) goto close_file; | 438 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
394 | w = tmp; // width | 439 | w = tmp; // width |
395 | if (!read_short(f, &tmp)) goto close_file; | 440 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
396 | h = tmp; // height | 441 | h = tmp; // height |
397 | if (!read_short(f, &tmp)) goto close_file; | 442 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
398 | planes = tmp; // must be 1 | 443 | planes = tmp; // must be 1 |
399 | if (!read_short(f, &tmp)) goto close_file; | 444 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
400 | bit_count = tmp; // bits per pixel: 1, 4, 8 & 24 | 445 | bit_count = tmp; // bits per pixel: 1, 4, 8 & 24 |
401 | } | 446 | } |
402 | else if (head_size == 64) // OS/2 V2 | 447 | else if (head_size == 64) // OS/2 V2 |
403 | { | 448 | { |
404 | short tmp; | 449 | short tmp; |
405 | int tmp2; | 450 | int tmp2; |
406 | 451 | ||
407 | if (!read_int(f, &tmp2)) goto close_file; | 452 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
408 | w = tmp2; // width | 453 | w = tmp2; // width |
409 | if (!read_int(f, &tmp2)) goto close_file; | 454 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
410 | h = tmp2; // height | 455 | h = tmp2; // height |
411 | if (!read_short(f, &tmp)) goto close_file; | 456 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
412 | planes = tmp; // must be 1 | 457 | planes = tmp; // must be 1 |
413 | if (!read_short(f, &tmp)) goto close_file; | 458 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
414 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 459 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
415 | if (!read_int(f, &tmp2)) goto close_file; | 460 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
416 | comp = tmp2; // compression method | 461 | comp = tmp2; // compression method |
417 | if (!read_int(f, &tmp2)) goto close_file; | 462 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
418 | image_size = tmp2; // bitmap data size | 463 | image_size = tmp2; // bitmap data size |
419 | if (!read_int(f, &tmp2)) goto close_file; | 464 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
420 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 465 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
421 | if (!read_int(f, &tmp2)) goto close_file; | 466 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
422 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 467 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
423 | if (!read_int(f, &tmp2)) goto close_file; | 468 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
424 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 469 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
425 | if (!read_int(f, &tmp2)) goto close_file; | 470 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
426 | important_colors = tmp2; // number of important colors - 0 if all | 471 | important_colors = tmp2; // number of important colors - 0 if all |
427 | if (fread(buf, 24, 1, f) != 1) goto close_file; // skip unused header | 472 | if (!read_skip(fsize, &position, 24)) goto close_file; // skip unused header |
428 | if (image_size == 0) image_size = fsize - offset; | 473 | if (image_size == 0) image_size = fsize - offset; |
429 | } | 474 | } |
430 | else if (head_size == 40) // Windows 3.0 + (v3) | 475 | else if (head_size == 40) // Windows 3.0 + (v3) |
431 | { | 476 | { |
432 | short tmp; | 477 | short tmp; |
433 | int tmp2; | 478 | int tmp2; |
434 | 479 | ||
435 | if (!read_int(f, &tmp2)) goto close_file; | 480 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
436 | w = tmp2; // width | 481 | w = tmp2; // width |
437 | if (!read_int(f, &tmp2)) goto close_file; | 482 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
438 | h = tmp2; // height | 483 | h = tmp2; // height |
439 | if (!read_short(f, &tmp)) goto close_file; | 484 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
440 | planes = tmp; // must be 1 | 485 | planes = tmp; // must be 1 |
441 | if (!read_short(f, &tmp)) goto close_file; | 486 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
442 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 487 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
443 | if (!read_int(f, &tmp2)) goto close_file; | 488 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
444 | comp = tmp2; // compression method | 489 | comp = tmp2; // compression method |
445 | if (!read_int(f, &tmp2)) goto close_file; | 490 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
446 | image_size = tmp2; // bitmap data size | 491 | image_size = tmp2; // bitmap data size |
447 | if (!read_int(f, &tmp2)) goto close_file; | 492 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
448 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 493 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
449 | if (!read_int(f, &tmp2)) goto close_file; | 494 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
450 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 495 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
451 | if (!read_int(f, &tmp2)) goto close_file; | 496 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
452 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 497 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
453 | if (!read_int(f, &tmp2)) goto close_file; | 498 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
454 | important_colors = tmp2; // number of important colors - 0 if all | 499 | important_colors = tmp2; // number of important colors - 0 if all |
455 | if (image_size == 0) image_size = fsize - offset; | 500 | if (image_size == 0) image_size = fsize - offset; |
456 | if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way | 501 | if ((comp == 0) && (bit_count == 32)) hasa = 1; // GIMP seems to store it this way |
@@ -459,37 +504,37 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
459 | { | 504 | { |
460 | short tmp; | 505 | short tmp; |
461 | int tmp2; | 506 | int tmp2; |
462 | 507 | ||
463 | if (!read_int(f, &tmp2)) goto close_file; | 508 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
464 | w = tmp2; // width | 509 | w = tmp2; // width |
465 | if (!read_int(f, &tmp2)) goto close_file; | 510 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
466 | h = tmp2; // height | 511 | h = tmp2; // height |
467 | if (!read_short(f, &tmp)) goto close_file; | 512 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
468 | planes = tmp; // must be 1 | 513 | planes = tmp; // must be 1 |
469 | if (!read_short(f, &tmp)) goto close_file; | 514 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
470 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 515 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
471 | if (!read_int(f, &tmp2)) goto close_file; | 516 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
472 | comp = tmp2; // compression method | 517 | comp = tmp2; // compression method |
473 | if (!read_int(f, &tmp2)) goto close_file; | 518 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
474 | image_size = tmp2; // bitmap data size | 519 | image_size = tmp2; // bitmap data size |
475 | if (!read_int(f, &tmp2)) goto close_file; | 520 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
476 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 521 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
477 | if (!read_int(f, &tmp2)) goto close_file; | 522 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
478 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 523 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
479 | if (!read_int(f, &tmp2)) goto close_file; | 524 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
480 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 525 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
481 | if (!read_int(f, &tmp2)) goto close_file; | 526 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
482 | important_colors = tmp2; // number of important colors - 0 if all | 527 | important_colors = tmp2; // number of important colors - 0 if all |
483 | if (!read_int(f, &tmp2)) goto close_file; | 528 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
484 | rmask = tmp2; // red mask | 529 | rmask = tmp2; // red mask |
485 | if (!read_int(f, &tmp2)) goto close_file; | 530 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
486 | gmask = tmp2; // green mask | 531 | gmask = tmp2; // green mask |
487 | if (!read_int(f, &tmp2)) goto close_file; | 532 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
488 | bmask = tmp2; // blue mask | 533 | bmask = tmp2; // blue mask |
489 | if (!read_int(f, &tmp2)) goto close_file; | 534 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
490 | amask = tmp2; // alpha mask | 535 | amask = tmp2; // alpha mask |
491 | if (fread(buf, 36, 1, f) != 1) goto close_file; // skip unused cie | 536 | if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie |
492 | if (fread(buf, 12, 1, f) != 1) goto close_file; // skip unused gamma | 537 | if (!read_skip(fsize, &position, 12)) goto close_file; // skip unused gamma |
493 | if (image_size == 0) image_size = fsize - offset; | 538 | if (image_size == 0) image_size = fsize - offset; |
494 | if ((amask) && (bit_count == 32)) hasa = 1; | 539 | if ((amask) && (bit_count == 32)) hasa = 1; |
495 | } | 540 | } |
@@ -497,38 +542,38 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
497 | { | 542 | { |
498 | short tmp; | 543 | short tmp; |
499 | int tmp2; | 544 | int tmp2; |
500 | 545 | ||
501 | if (!read_int(f, &tmp2)) goto close_file; | 546 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
502 | w = tmp2; // width | 547 | w = tmp2; // width |
503 | if (!read_int(f, &tmp2)) goto close_file; | 548 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
504 | h = tmp2; // height | 549 | h = tmp2; // height |
505 | if (!read_short(f, &tmp)) goto close_file; | 550 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
506 | planes = tmp; // must be 1 | 551 | planes = tmp; // must be 1 |
507 | if (!read_short(f, &tmp)) goto close_file; | 552 | if (!read_short(map, fsize, &position, &tmp)) goto close_file; |
508 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 | 553 | bit_count = tmp; // bits per pixel: 1, 4, 8, 16, 24 & 32 |
509 | if (!read_int(f, &tmp2)) goto close_file; | 554 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
510 | comp = tmp2; // compression method | 555 | comp = tmp2; // compression method |
511 | if (!read_int(f, &tmp2)) goto close_file; | 556 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
512 | image_size = tmp2; // bitmap data size | 557 | image_size = tmp2; // bitmap data size |
513 | if (!read_int(f, &tmp2)) goto close_file; | 558 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
514 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter | 559 | hdpi = (tmp2 * 254) / 10000; // horizontal pixels/meter |
515 | if (!read_int(f, &tmp2)) goto close_file; | 560 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
516 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter | 561 | vdpi = (tmp2 * 254) / 10000; // vertical pixles/meter |
517 | if (!read_int(f, &tmp2)) goto close_file; | 562 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
518 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) | 563 | palette_size = tmp2; // number of palette colors power (2^n - so 0 - 8) |
519 | if (!read_int(f, &tmp2)) goto close_file; | 564 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
520 | important_colors = tmp2; // number of important colors - 0 if all | 565 | important_colors = tmp2; // number of important colors - 0 if all |
521 | if (!read_int(f, &tmp2)) goto close_file; | 566 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
522 | rmask = tmp2; // red mask | 567 | rmask = tmp2; // red mask |
523 | if (!read_int(f, &tmp2)) goto close_file; | 568 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
524 | gmask = tmp2; // green mask | 569 | gmask = tmp2; // green mask |
525 | if (!read_int(f, &tmp2)) goto close_file; | 570 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
526 | bmask = tmp2; // blue mask | 571 | bmask = tmp2; // blue mask |
527 | if (!read_int(f, &tmp2)) goto close_file; | 572 | if (!read_int(map, fsize, &position, &tmp2)) goto close_file; |
528 | amask = tmp2; // alpha mask | 573 | amask = tmp2; // alpha mask |
529 | if (fread(buf, 36, 1, f) != 1) goto close_file; // skip unused cie | 574 | if (!read_skip(fsize, &position, 36)) goto close_file; // skip unused cie |
530 | if (fread(buf, 12, 1, f) != 1) goto close_file; // skip unused gamma | 575 | if (!read_skip(fsize, &position, 12)) goto close_file; // skip unused gamma |
531 | if (fread(buf, 16, 1, f) != 1) goto close_file; // skip others | 576 | if (!read_skip(fsize, &position, 16)) goto close_file; // skip others |
532 | if (image_size == 0) image_size = fsize - offset; | 577 | if (image_size == 0) image_size = fsize - offset; |
533 | if ((amask) && (bit_count == 32)) hasa = 1; | 578 | if ((amask) && (bit_count == 32)) hasa = 1; |
534 | } | 579 | } |
@@ -605,17 +650,17 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
605 | pal = alloca(256 * 4); | 650 | pal = alloca(256 * 4); |
606 | for (i = 0; i < pal_num; i++) | 651 | for (i = 0; i < pal_num; i++) |
607 | { | 652 | { |
608 | if (fread(&b, 1, 1, f) != 1) goto close_file; | 653 | if (!read_uchar(map, fsize, &position, &b)) goto close_file; |
609 | if (fread(&g, 1, 1, f) != 1) goto close_file; | 654 | if (!read_uchar(map, fsize, &position, &g)) goto close_file; |
610 | if (fread(&r, 1, 1, f) != 1) goto close_file; | 655 | if (!read_uchar(map, fsize, &position, &r)) goto close_file; |
611 | if ((head_size != 12) /*&& (palette_size != 0)*/) | 656 | if ((head_size != 12) /*&& (palette_size != 0)*/) |
612 | { // OS/2 V1 doesn't do the pad byte | 657 | { // OS/2 V1 doesn't do the pad byte |
613 | if (fread(&a, 1, 1, f) != 1) goto close_file; | 658 | if (!read_uchar(map, fsize, &position, &a)) goto close_file; |
614 | } | 659 | } |
615 | a = 0xff; // fillin a as solid for paletted images | 660 | a = 0xff; // fillin a as solid for paletted images |
616 | pal[i] = ARGB_JOIN(a, r, g, b); | 661 | pal[i] = ARGB_JOIN(a, r, g, b); |
617 | } | 662 | } |
618 | fseek(f, offset, SEEK_SET); | 663 | position = offset; |
619 | 664 | ||
620 | if ((scale_ratio == 1) || (comp !=0)) | 665 | if ((scale_ratio == 1) || (comp !=0)) |
621 | buffer = malloc(image_size + 8); // add 8 for padding to avoid checks | 666 | buffer = malloc(image_size + 8); // add 8 for padding to avoid checks |
@@ -643,11 +688,11 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
643 | 688 | ||
644 | if ((scale_ratio == 1) || (comp !=0)) | 689 | if ((scale_ratio == 1) || (comp !=0)) |
645 | { | 690 | { |
646 | if (fread(buffer, image_size, 1, f) != 1) goto close_file; | 691 | if (!read_mem(map, fsize, &position, buffer, image_size)) goto close_file; |
647 | } | 692 | } |
648 | else | 693 | else |
649 | { | 694 | { |
650 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 695 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
651 | } | 696 | } |
652 | 697 | ||
653 | if (bit_count == 1) | 698 | if (bit_count == 1) |
@@ -715,8 +760,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
715 | read_line += scale_ratio; | 760 | read_line += scale_ratio; |
716 | if (read_line >= image_h) break; | 761 | if (read_line >= image_h) break; |
717 | 762 | ||
718 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 763 | position += row_size * (scale_ratio - 1); |
719 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 764 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
720 | p = buffer; | 765 | p = buffer; |
721 | buffer_end = buffer + row_size; | 766 | buffer_end = buffer + row_size; |
722 | } | 767 | } |
@@ -770,8 +815,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
770 | read_line += scale_ratio; | 815 | read_line += scale_ratio; |
771 | if (read_line >= image_h) break; | 816 | if (read_line >= image_h) break; |
772 | 817 | ||
773 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 818 | position += row_size * (scale_ratio - 1); |
774 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 819 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
775 | p = buffer; | 820 | p = buffer; |
776 | buffer_end = buffer + row_size; | 821 | buffer_end = buffer + row_size; |
777 | } | 822 | } |
@@ -960,8 +1005,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
960 | read_line += scale_ratio; | 1005 | read_line += scale_ratio; |
961 | if (read_line >= image_h) break; | 1006 | if (read_line >= image_h) break; |
962 | 1007 | ||
963 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 1008 | position += row_size * (scale_ratio - 1); |
964 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1009 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
965 | p = buffer; | 1010 | p = buffer; |
966 | buffer_end = buffer + row_size; | 1011 | buffer_end = buffer + row_size; |
967 | } | 1012 | } |
@@ -1088,7 +1133,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1088 | { | 1133 | { |
1089 | if (comp == 0) // no compression | 1134 | if (comp == 0) // no compression |
1090 | { | 1135 | { |
1091 | fseek(f, offset, SEEK_SET); | 1136 | position = offset; |
1092 | if (scale_ratio == 1) | 1137 | if (scale_ratio == 1) |
1093 | buffer = malloc(image_size + 8); // add 8 for padding to avoid checks | 1138 | buffer = malloc(image_size + 8); // add 8 for padding to avoid checks |
1094 | else | 1139 | else |
@@ -1106,11 +1151,11 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1106 | p = buffer; | 1151 | p = buffer; |
1107 | if (scale_ratio == 1) | 1152 | if (scale_ratio == 1) |
1108 | { | 1153 | { |
1109 | if (fread(buffer, image_size, 1, f) != 1) goto close_file; | 1154 | if (!read_mem(map, fsize, &position, buffer, image_size)) goto close_file; |
1110 | } | 1155 | } |
1111 | else | 1156 | else |
1112 | { | 1157 | { |
1113 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1158 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
1114 | } | 1159 | } |
1115 | if (bit_count == 16) | 1160 | if (bit_count == 16) |
1116 | { | 1161 | { |
@@ -1139,8 +1184,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1139 | read_line += scale_ratio; | 1184 | read_line += scale_ratio; |
1140 | if (read_line >= image_h) break; | 1185 | if (read_line >= image_h) break; |
1141 | 1186 | ||
1142 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 1187 | position += row_size * (scale_ratio - 1); |
1143 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1188 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
1144 | p = buffer; | 1189 | p = buffer; |
1145 | buffer_end = buffer + row_size; | 1190 | buffer_end = buffer + row_size; |
1146 | } | 1191 | } |
@@ -1173,8 +1218,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1173 | read_line += scale_ratio; | 1218 | read_line += scale_ratio; |
1174 | if (read_line >= image_h) break; | 1219 | if (read_line >= image_h) break; |
1175 | 1220 | ||
1176 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 1221 | position += row_size * (scale_ratio - 1); |
1177 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1222 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
1178 | p = buffer; | 1223 | p = buffer; |
1179 | buffer_end = buffer + row_size; | 1224 | buffer_end = buffer + row_size; |
1180 | } | 1225 | } |
@@ -1212,8 +1257,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1212 | read_line += scale_ratio; | 1257 | read_line += scale_ratio; |
1213 | if (read_line >= image_h) break; | 1258 | if (read_line >= image_h) break; |
1214 | 1259 | ||
1215 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 1260 | position += row_size * (scale_ratio - 1); |
1216 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1261 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
1217 | p = buffer; | 1262 | p = buffer; |
1218 | buffer_end = buffer + row_size; | 1263 | buffer_end = buffer + row_size; |
1219 | } | 1264 | } |
@@ -1230,7 +1275,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1230 | if (hasa) | 1275 | if (hasa) |
1231 | { | 1276 | { |
1232 | unsigned int *pixend = surface + (w * h); | 1277 | unsigned int *pixend = surface + (w * h); |
1233 | 1278 | ||
1234 | for (pix = surface; pix < pixend; pix++) | 1279 | for (pix = surface; pix < pixend; pix++) |
1235 | A_VAL(pix) = 0xff; | 1280 | A_VAL(pix) = 0xff; |
1236 | } | 1281 | } |
@@ -1241,11 +1286,11 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1241 | } | 1286 | } |
1242 | else if (comp == 3) // bit field | 1287 | else if (comp == 3) // bit field |
1243 | { | 1288 | { |
1244 | if (!read_uint(f, &rmask)) goto close_file; | 1289 | if (!read_uint(map, fsize, &position, &rmask)) goto close_file; |
1245 | if (!read_uint(f, &gmask)) goto close_file; | 1290 | if (!read_uint(map, fsize, &position, &gmask)) goto close_file; |
1246 | if (!read_uint(f, &bmask)) goto close_file; | 1291 | if (!read_uint(map, fsize, &position, &bmask)) goto close_file; |
1247 | 1292 | ||
1248 | fseek(f, offset, SEEK_SET); | 1293 | position = offset; |
1249 | if (scale_ratio == 1) | 1294 | if (scale_ratio == 1) |
1250 | buffer = malloc(image_size + 8); // add 8 for padding to avoid checks | 1295 | buffer = malloc(image_size + 8); // add 8 for padding to avoid checks |
1251 | else | 1296 | else |
@@ -1264,14 +1309,14 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1264 | p = buffer; | 1309 | p = buffer; |
1265 | if (scale_ratio == 1) | 1310 | if (scale_ratio == 1) |
1266 | { | 1311 | { |
1267 | if (fread(buffer, image_size, 1, f) != 1) goto close_file; | 1312 | if (!read_mem(map, fsize, &position, buffer, image_size)) goto close_file; |
1268 | } | 1313 | } |
1269 | else | 1314 | else |
1270 | { | 1315 | { |
1271 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1316 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; |
1272 | } | 1317 | } |
1273 | 1318 | ||
1274 | if ((bit_count == 16) && | 1319 | if ((bit_count == 16) && |
1275 | (rmask == 0xf800) && (gmask == 0x07e0) && (bmask == 0x001f) | 1320 | (rmask == 0xf800) && (gmask == 0x07e0) && (bmask == 0x001f) |
1276 | ) | 1321 | ) |
1277 | { | 1322 | { |
@@ -1299,8 +1344,9 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1299 | { | 1344 | { |
1300 | read_line += scale_ratio; | 1345 | read_line += scale_ratio; |
1301 | if (read_line >= image_h) break; | 1346 | if (read_line >= image_h) break; |
1302 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 1347 | |
1303 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1348 | position += row_size * (scale_ratio - 1); |
1349 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; | ||
1304 | p = buffer; | 1350 | p = buffer; |
1305 | buffer_end = buffer + row_size; | 1351 | buffer_end = buffer + row_size; |
1306 | } | 1352 | } |
@@ -1338,8 +1384,9 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1338 | { | 1384 | { |
1339 | read_line += scale_ratio; | 1385 | read_line += scale_ratio; |
1340 | if (read_line >= image_h) break; | 1386 | if (read_line >= image_h) break; |
1341 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 1387 | |
1342 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1388 | position += row_size * (scale_ratio - 1); |
1389 | if (!read_mem(map, fsize, &position, buffer_end, row_size)) goto close_file; | ||
1343 | p = buffer; | 1390 | p = buffer; |
1344 | buffer_end = buffer + row_size; | 1391 | buffer_end = buffer + row_size; |
1345 | } | 1392 | } |
@@ -1375,8 +1422,9 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1375 | { | 1422 | { |
1376 | read_line += scale_ratio; | 1423 | read_line += scale_ratio; |
1377 | if (read_line >= image_h) break; | 1424 | if (read_line >= image_h) break; |
1378 | fseek(f, row_size * (scale_ratio - 1), SEEK_CUR); | 1425 | |
1379 | if (fread(buffer, row_size, 1, f) != 1) goto close_file; | 1426 | position += row_size * (scale_ratio - 1); |
1427 | if (!read_mem(map, fsize, &position, buffer, row_size)) goto close_file; | ||
1380 | p = buffer; | 1428 | p = buffer; |
1381 | buffer_end = buffer + row_size; | 1429 | buffer_end = buffer + row_size; |
1382 | } | 1430 | } |
@@ -1404,10 +1452,12 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1404 | } | 1452 | } |
1405 | else | 1453 | else |
1406 | goto close_file; | 1454 | goto close_file; |
1407 | 1455 | ||
1408 | if (buffer) free(buffer); | 1456 | if (buffer) free(buffer); |
1409 | if (scale_surface) free(scale_surface); | 1457 | if (scale_surface) free(scale_surface); |
1410 | fclose(f); | 1458 | |
1459 | eina_file_map_free(f, map); | ||
1460 | eina_file_close(f); | ||
1411 | 1461 | ||
1412 | evas_common_image_premul(ie); | 1462 | evas_common_image_premul(ie); |
1413 | *error = EVAS_LOAD_ERROR_NONE; | 1463 | *error = EVAS_LOAD_ERROR_NONE; |
@@ -1416,7 +1466,8 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key | |||
1416 | close_file: | 1466 | close_file: |
1417 | if (buffer) free(buffer); | 1467 | if (buffer) free(buffer); |
1418 | if (scale_surface) free(scale_surface); | 1468 | if (scale_surface) free(scale_surface); |
1419 | fclose(f); | 1469 | if (map) eina_file_map_free(f, map); |
1470 | eina_file_close(f); | ||
1420 | return EINA_FALSE; | 1471 | return EINA_FALSE; |
1421 | } | 1472 | } |
1422 | 1473 | ||
diff --git a/libraries/evas/src/modules/loaders/edb/Makefile.in b/libraries/evas/src/modules/loaders/edb/Makefile.in index 38c1fa2..87356b4 100644 --- a/libraries/evas/src/modules/loaders/edb/Makefile.in +++ b/libraries/evas/src/modules/loaders/edb/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/edb/evas_image_load_edb.c b/libraries/evas/src/modules/loaders/edb/evas_image_load_edb.c index 94b121e..521161f 100644 --- a/libraries/evas/src/modules/loaders/edb/evas_image_load_edb.c +++ b/libraries/evas/src/modules/loaders/edb/evas_image_load_edb.c | |||
@@ -16,7 +16,8 @@ static Evas_Image_Load_Func evas_image_load_edb_func = | |||
16 | EINA_TRUE, | 16 | EINA_TRUE, |
17 | evas_image_load_file_head_edb, | 17 | evas_image_load_file_head_edb, |
18 | evas_image_load_file_data_edb, | 18 | evas_image_load_file_data_edb, |
19 | NULL | 19 | NULL, |
20 | EINA_FALSE | ||
20 | }; | 21 | }; |
21 | 22 | ||
22 | static Eina_Bool | 23 | static Eina_Bool |
diff --git a/libraries/evas/src/modules/loaders/eet/Makefile.in b/libraries/evas/src/modules/loaders/eet/Makefile.in index 6a6c40e..25a30cf 100644 --- a/libraries/evas/src/modules/loaders/eet/Makefile.in +++ b/libraries/evas/src/modules/loaders/eet/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/eet/evas_image_load_eet.c b/libraries/evas/src/modules/loaders/eet/evas_image_load_eet.c index a187b9e..f86246a 100644 --- a/libraries/evas/src/modules/loaders/eet/evas_image_load_eet.c +++ b/libraries/evas/src/modules/loaders/eet/evas_image_load_eet.c | |||
@@ -16,7 +16,8 @@ Evas_Image_Load_Func evas_image_load_eet_func = | |||
16 | EINA_TRUE, | 16 | EINA_TRUE, |
17 | evas_image_load_file_head_eet, | 17 | evas_image_load_file_head_eet, |
18 | evas_image_load_file_data_eet, | 18 | evas_image_load_file_data_eet, |
19 | NULL | 19 | NULL, |
20 | EINA_FALSE | ||
20 | }; | 21 | }; |
21 | 22 | ||
22 | 23 | ||
diff --git a/libraries/evas/src/modules/loaders/generic/Makefile.in b/libraries/evas/src/modules/loaders/generic/Makefile.in index 65a0bac..dfd5294 100644 --- a/libraries/evas/src/modules/loaders/generic/Makefile.in +++ b/libraries/evas/src/modules/loaders/generic/Makefile.in | |||
@@ -232,8 +232,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
232 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 232 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
233 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 233 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
234 | PKG_CONFIG = @PKG_CONFIG@ | 234 | PKG_CONFIG = @PKG_CONFIG@ |
235 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
236 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
237 | PNG_CFLAGS = @PNG_CFLAGS@ | 235 | PNG_CFLAGS = @PNG_CFLAGS@ |
238 | PNG_LIBS = @PNG_LIBS@ | 236 | PNG_LIBS = @PNG_LIBS@ |
239 | RANLIB = @RANLIB@ | 237 | RANLIB = @RANLIB@ |
@@ -250,6 +248,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
250 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 248 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
251 | VERSION = @VERSION@ | 249 | VERSION = @VERSION@ |
252 | VMAJ = @VMAJ@ | 250 | VMAJ = @VMAJ@ |
251 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
252 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
253 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 253 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
254 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 254 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
255 | XCB_CFLAGS = @XCB_CFLAGS@ | 255 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -331,6 +331,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
331 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 331 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
332 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 332 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
333 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 333 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
334 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
335 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
336 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
337 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
334 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 338 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
335 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 339 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
336 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 340 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/generic/evas_image_load_generic.c b/libraries/evas/src/modules/loaders/generic/evas_image_load_generic.c index 88c189d..2bbfd3e 100644 --- a/libraries/evas/src/modules/loaders/generic/evas_image_load_generic.c +++ b/libraries/evas/src/modules/loaders/generic/evas_image_load_generic.c | |||
@@ -24,7 +24,8 @@ Evas_Image_Load_Func evas_image_load_generic_func = | |||
24 | EINA_TRUE, | 24 | EINA_TRUE, |
25 | evas_image_load_file_head_generic, | 25 | evas_image_load_file_head_generic, |
26 | evas_image_load_file_data_generic, | 26 | evas_image_load_file_data_generic, |
27 | NULL | 27 | NULL, |
28 | EINA_FALSE | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | static Eina_Bool | 31 | static Eina_Bool |
@@ -117,7 +118,7 @@ _load(Image_Entry *ie, const char *file, const char *key, int *error, Eina_Bool | |||
117 | int read_data = 0; | 118 | int read_data = 0; |
118 | char *tmpfname = NULL, *shmfname = NULL; | 119 | char *tmpfname = NULL, *shmfname = NULL; |
119 | DATA32 *body; | 120 | DATA32 *body; |
120 | FILE *f; | 121 | FILE *f = NULL; |
121 | 122 | ||
122 | libdir = _evas_module_libdir_get(); | 123 | libdir = _evas_module_libdir_get(); |
123 | cmd_len = strlen(libdir); | 124 | cmd_len = strlen(libdir); |
@@ -125,6 +126,7 @@ _load(Image_Entry *ie, const char *file, const char *key, int *error, Eina_Bool | |||
125 | img_loader = alloca(cmd_len + 1); | 126 | img_loader = alloca(cmd_len + 1); |
126 | strcpy(img_loader, libdir); | 127 | strcpy(img_loader, libdir); |
127 | strcat(img_loader, loader); | 128 | strcat(img_loader, loader); |
129 | |||
128 | // params excluding file, key and loadopts | 130 | // params excluding file, key and loadopts |
129 | cmd_len += 1024; | 131 | cmd_len += 1024; |
130 | cmd_len += strlen(file) * 2; | 132 | cmd_len += strlen(file) * 2; |
@@ -188,6 +190,8 @@ _load(Image_Entry *ie, const char *file, const char *key, int *error, Eina_Bool | |||
188 | // will interpret shell stuff and path hunt that will then exec the | 190 | // will interpret shell stuff and path hunt that will then exec the |
189 | // program itself that will dynamically link that will again | 191 | // program itself that will dynamically link that will again |
190 | // parse the arguments and finally do something... | 192 | // parse the arguments and finally do something... |
193 | if (access(decoders[try_count], X_OK)) continue; | ||
194 | |||
191 | strcpy(cmd, decoders[try_count]); | 195 | strcpy(cmd, decoders[try_count]); |
192 | strcat(cmd, " "); | 196 | strcat(cmd, " "); |
193 | // filename first arg | 197 | // filename first arg |
diff --git a/libraries/evas/src/modules/loaders/gif/Makefile.in b/libraries/evas/src/modules/loaders/gif/Makefile.in index 7fcd6a7..f32fcf4 100644 --- a/libraries/evas/src/modules/loaders/gif/Makefile.in +++ b/libraries/evas/src/modules/loaders/gif/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/gif/evas_image_load_gif.c b/libraries/evas/src/modules/loaders/gif/evas_image_load_gif.c index 976df0d..9cd6f6e 100644 --- a/libraries/evas/src/modules/loaders/gif/evas_image_load_gif.c +++ b/libraries/evas/src/modules/loaders/gif/evas_image_load_gif.c | |||
@@ -50,7 +50,8 @@ static Evas_Image_Load_Func evas_image_load_gif_func = | |||
50 | EINA_TRUE, | 50 | EINA_TRUE, |
51 | evas_image_load_file_head_gif, | 51 | evas_image_load_file_head_gif, |
52 | evas_image_load_file_data_gif, | 52 | evas_image_load_file_data_gif, |
53 | evas_image_load_frame_duration_gif | 53 | evas_image_load_frame_duration_gif, |
54 | EINA_FALSE | ||
54 | }; | 55 | }; |
55 | #define byte2_to_int(a,b) (((b)<<8)|(a)) | 56 | #define byte2_to_int(a,b) (((b)<<8)|(a)) |
56 | 57 | ||
diff --git a/libraries/evas/src/modules/loaders/ico/Makefile.in b/libraries/evas/src/modules/loaders/ico/Makefile.in index 5c26adf..f65ace0 100644 --- a/libraries/evas/src/modules/loaders/ico/Makefile.in +++ b/libraries/evas/src/modules/loaders/ico/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/ico/evas_image_load_ico.c b/libraries/evas/src/modules/loaders/ico/evas_image_load_ico.c index 17a7f7e..6e31191 100644 --- a/libraries/evas/src/modules/loaders/ico/evas_image_load_ico.c +++ b/libraries/evas/src/modules/loaders/ico/evas_image_load_ico.c | |||
@@ -19,32 +19,57 @@ static Evas_Image_Load_Func evas_image_load_ico_func = | |||
19 | EINA_TRUE, | 19 | EINA_TRUE, |
20 | evas_image_load_file_head_ico, | 20 | evas_image_load_file_head_ico, |
21 | evas_image_load_file_data_ico, | 21 | evas_image_load_file_data_ico, |
22 | NULL | 22 | NULL, |
23 | EINA_FALSE | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | static int | 26 | static Eina_Bool |
26 | read_ushort(FILE *file, unsigned short *ret) | 27 | read_ushort(unsigned char *map, size_t length, size_t *position, unsigned short *ret) |
27 | { | 28 | { |
28 | unsigned char b[2]; | 29 | unsigned char b[2]; |
29 | if (fread(b, sizeof(unsigned char), 2, file) != 2) return 0; | 30 | |
31 | if (*position + 2 > length) return EINA_FALSE; | ||
32 | b[0] = map[(*position)++]; | ||
33 | b[1] = map[(*position)++]; | ||
30 | *ret = (b[1] << 8) | b[0]; | 34 | *ret = (b[1] << 8) | b[0]; |
31 | return 1; | 35 | return EINA_TRUE; |
32 | } | 36 | } |
33 | 37 | ||
34 | static int | 38 | static Eina_Bool |
35 | read_uint(FILE *file, unsigned int *ret) | 39 | read_uint(unsigned char *map, size_t length, size_t *position, unsigned int *ret) |
36 | { | 40 | { |
37 | unsigned char b[4]; | 41 | unsigned char b[4]; |
38 | if (fread(b, sizeof(unsigned char), 4, file) != 4) return 0; | 42 | unsigned int i; |
43 | |||
44 | if (*position + 4 > length) return EINA_FALSE; | ||
45 | for (i = 0; i < 4; i++) | ||
46 | b[i] = map[(*position)++]; | ||
39 | *ret = ARGB_JOIN(b[3], b[2], b[1], b[0]); | 47 | *ret = ARGB_JOIN(b[3], b[2], b[1], b[0]); |
40 | return 1; | 48 | return EINA_TRUE; |
49 | } | ||
50 | |||
51 | static Eina_Bool | ||
52 | read_uchar(unsigned char *map, size_t length, size_t *position, unsigned char *ret) | ||
53 | { | ||
54 | if (*position + 1 > length) return EINA_FALSE; | ||
55 | *ret = map[(*position)++]; | ||
56 | return EINA_TRUE; | ||
57 | } | ||
58 | |||
59 | static Eina_Bool | ||
60 | read_mem(unsigned char *map, size_t length, size_t *position, void *buffer, int size) | ||
61 | { | ||
62 | if (*position + size > length) return EINA_FALSE; | ||
63 | memcpy(buffer, map + *position, size); | ||
64 | *position += size; | ||
65 | return EINA_TRUE; | ||
41 | } | 66 | } |
42 | 67 | ||
43 | enum | 68 | enum |
44 | { | 69 | { |
45 | SMALLEST, | 70 | SMALLEST, |
46 | BIGGEST, | 71 | BIGGEST, |
47 | SMALLER, | 72 | SMALLER, |
48 | BIGGER | 73 | BIGGER |
49 | }; | 74 | }; |
50 | 75 | ||
@@ -57,9 +82,11 @@ enum | |||
57 | static Eina_Bool | 82 | static Eina_Bool |
58 | evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key, int *error) | 83 | evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key, int *error) |
59 | { | 84 | { |
85 | Eina_File *f; | ||
86 | void *map = NULL; | ||
87 | size_t position = 0; | ||
60 | unsigned short word; | 88 | unsigned short word; |
61 | unsigned char byte; | 89 | unsigned char byte; |
62 | FILE *f; | ||
63 | int wanted_w = 0, wanted_h = 0, w, h, cols, i, planes = 0, | 90 | int wanted_w = 0, wanted_h = 0, w, h, cols, i, planes = 0, |
64 | hot_x = 0, hot_y = 0, bpp = 0, pdelta, search = -1, have_choice = 0, | 91 | hot_x = 0, hot_y = 0, bpp = 0, pdelta, search = -1, have_choice = 0, |
65 | hasa = 1; | 92 | hasa = 1; |
@@ -74,7 +101,7 @@ evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key | |||
74 | unsigned int bmoffset, bmsize; | 101 | unsigned int bmoffset, bmsize; |
75 | } chosen = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | 102 | } chosen = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
76 | 103 | ||
77 | f = fopen(file, "rb"); | 104 | f = eina_file_open(file, EINA_FALSE); |
78 | if (!f) | 105 | if (!f) |
79 | { | 106 | { |
80 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 107 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
@@ -82,16 +109,17 @@ evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key | |||
82 | } | 109 | } |
83 | 110 | ||
84 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 111 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
85 | fseek(f, 0, SEEK_END); | 112 | fsize = eina_file_size_get(f); |
86 | fsize = ftell(f); | ||
87 | fseek(f, 0, SEEK_SET); | ||
88 | if (fsize < (6 + 16 + 40)) goto close_file; | 113 | if (fsize < (6 + 16 + 40)) goto close_file; |
89 | 114 | ||
115 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); | ||
116 | if (!map) goto close_file; | ||
117 | |||
90 | // key: | 118 | // key: |
91 | // NULL == highest res | 119 | // NULL == highest res |
92 | // biggest == highest res | 120 | // biggest == highest res |
93 | // smallest == lowest res | 121 | // smallest == lowest res |
94 | // | 122 | // |
95 | // smaller == next size SMALLER than load opts WxH (if possible) | 123 | // smaller == next size SMALLER than load opts WxH (if possible) |
96 | // bigger == next size BIGGER than load opts WxH (if possible) | 124 | // bigger == next size BIGGER than load opts WxH (if possible) |
97 | // more ? | 125 | // more ? |
@@ -103,10 +131,10 @@ evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key | |||
103 | wanted_h = ie->load_opts.h; | 131 | wanted_h = ie->load_opts.h; |
104 | search = SMALLER; | 132 | search = SMALLER; |
105 | } | 133 | } |
106 | 134 | ||
107 | if (!read_ushort(f, &reserved)) goto close_file; | 135 | if (!read_ushort(map, fsize, &position, &reserved)) goto close_file; |
108 | if (!read_ushort(f, &type)) goto close_file; | 136 | if (!read_ushort(map, fsize, &position, &type)) goto close_file; |
109 | if (!read_ushort(f, &count)) goto close_file; | 137 | if (!read_ushort(map, fsize, &position, &count)) goto close_file; |
110 | if (!((reserved == 0) && | 138 | if (!((reserved == 0) && |
111 | ((type == ICON) || (type == CURSOR)) && (count > 0))) | 139 | ((type == ICON) || (type == CURSOR)) && (count > 0))) |
112 | goto close_file; | 140 | goto close_file; |
@@ -141,24 +169,25 @@ evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key | |||
141 | } | 169 | } |
142 | for (i = 0; i < count; i++) | 170 | for (i = 0; i < count; i++) |
143 | { | 171 | { |
144 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 172 | unsigned char tw = 0, th = 0, tcols = 0; |
145 | w = byte; | 173 | if (!read_uchar(map, fsize, &position, &tw)) goto close_file; |
174 | w = tw; | ||
146 | if (w <= 0) w = 256; | 175 | if (w <= 0) w = 256; |
147 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 176 | if (!read_uchar(map, fsize, &position, &th)) goto close_file; |
148 | h = byte; | 177 | h = th; |
149 | if (h <= 0) h = 256; | 178 | if (h <= 0) h = 256; |
150 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 179 | if (!read_uchar(map, fsize, &position, &tcols)) goto close_file; |
151 | cols = byte; | 180 | cols = tcols; |
152 | if (cols <= 0) cols = 256; | 181 | if (cols <= 0) cols = 256; |
153 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 182 | if (!read_uchar(map, fsize, &position, &byte)) goto close_file; |
154 | if (!read_ushort(f, &word)) goto close_file; | 183 | if (!read_ushort(map, fsize, &position, &word)) goto close_file; |
155 | if (type == CURSOR) planes = word; | 184 | if (type == CURSOR) planes = word; |
156 | else hot_x = word; | 185 | else hot_x = word; |
157 | if (!read_ushort(f, &word)) goto close_file; | 186 | if (!read_ushort(map, fsize, &position, &word)) goto close_file; |
158 | if (type == CURSOR) bpp = word; | 187 | if (type == CURSOR) bpp = word; |
159 | else hot_y = word; | 188 | else hot_y = word; |
160 | if (!read_uint(f, &bmsize)) goto close_file; | 189 | if (!read_uint(map, fsize, &position, &bmsize)) goto close_file; |
161 | if (!read_uint(f, &bmoffset)) goto close_file; | 190 | if (!read_uint(map, fsize, &position, &bmoffset)) goto close_file; |
162 | if ((bmsize <= 0) || (bmoffset <= 0) || (bmoffset >= fsize)) goto close_file; | 191 | if ((bmsize <= 0) || (bmoffset <= 0) || (bmoffset >= fsize)) goto close_file; |
163 | if (search == BIGGEST) | 192 | if (search == BIGGEST) |
164 | { | 193 | { |
@@ -245,7 +274,7 @@ evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key | |||
245 | } | 274 | } |
246 | } | 275 | } |
247 | if (chosen.bmoffset == 0) goto close_file; | 276 | if (chosen.bmoffset == 0) goto close_file; |
248 | if (fseek(f, chosen.bmoffset, SEEK_SET) != 0) goto close_file; | 277 | position = chosen.bmoffset; |
249 | 278 | ||
250 | w = chosen.w; | 279 | w = chosen.w; |
251 | h = chosen.h; | 280 | h = chosen.h; |
@@ -263,23 +292,28 @@ evas_image_load_file_head_ico(Image_Entry *ie, const char *file, const char *key | |||
263 | ie->w = w; | 292 | ie->w = w; |
264 | ie->h = h; | 293 | ie->h = h; |
265 | if (hasa) ie->flags.alpha = 1; | 294 | if (hasa) ie->flags.alpha = 1; |
266 | 295 | ||
267 | fclose(f); | 296 | eina_file_map_free(f, map); |
297 | eina_file_close(f); | ||
298 | |||
268 | *error = EVAS_LOAD_ERROR_NONE; | 299 | *error = EVAS_LOAD_ERROR_NONE; |
269 | return EINA_TRUE; | 300 | return EINA_TRUE; |
270 | 301 | ||
271 | close_file: | 302 | close_file: |
272 | fclose(f); | 303 | if (map) eina_file_map_free(f, map); |
304 | eina_file_close(f); | ||
273 | return EINA_FALSE; | 305 | return EINA_FALSE; |
274 | } | 306 | } |
275 | 307 | ||
276 | static Eina_Bool | 308 | static Eina_Bool |
277 | evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key, int *error) | 309 | evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key, int *error) |
278 | { | 310 | { |
311 | Eina_File *f; | ||
312 | void *map = NULL; | ||
313 | size_t position = 0; | ||
279 | unsigned short word; | 314 | unsigned short word; |
280 | unsigned char byte; | 315 | unsigned char byte; |
281 | unsigned int dword; | 316 | unsigned int dword; |
282 | FILE *f; | ||
283 | int wanted_w = 0, wanted_h = 0, w, h, cols, i, planes = 0, | 317 | int wanted_w = 0, wanted_h = 0, w, h, cols, i, planes = 0, |
284 | hot_x = 0, hot_y = 0, bpp = 0, pdelta, search = -1, have_choice = 0, | 318 | hot_x = 0, hot_y = 0, bpp = 0, pdelta, search = -1, have_choice = 0, |
285 | stride, pstride, j, right_way_up = 0, diff_size = 0, cols2; | 319 | stride, pstride, j, right_way_up = 0, diff_size = 0, cols2; |
@@ -296,7 +330,7 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
296 | unsigned int bmoffset, bmsize; | 330 | unsigned int bmoffset, bmsize; |
297 | } chosen = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | 331 | } chosen = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
298 | 332 | ||
299 | f = fopen(file, "rb"); | 333 | f = eina_file_open(file, EINA_FALSE); |
300 | if (!f) | 334 | if (!f) |
301 | { | 335 | { |
302 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 336 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
@@ -304,11 +338,12 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
304 | } | 338 | } |
305 | 339 | ||
306 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 340 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
307 | fseek(f, 0, SEEK_END); | 341 | fsize = eina_file_size_get(f); |
308 | fsize = ftell(f); | ||
309 | fseek(f, 0, SEEK_SET); | ||
310 | if (fsize < (6 + 16 + 40)) goto close_file; | 342 | if (fsize < (6 + 16 + 40)) goto close_file; |
311 | 343 | ||
344 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); | ||
345 | if (!map) goto close_file; | ||
346 | |||
312 | // key: | 347 | // key: |
313 | // NULL == highest res | 348 | // NULL == highest res |
314 | // biggest == highest res | 349 | // biggest == highest res |
@@ -325,11 +360,11 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
325 | wanted_h = ie->load_opts.h; | 360 | wanted_h = ie->load_opts.h; |
326 | search = SMALLER; | 361 | search = SMALLER; |
327 | } | 362 | } |
328 | 363 | ||
329 | if (!read_ushort(f, &reserved)) goto close_file; | 364 | if (!read_ushort(map, fsize, &position, &reserved)) goto close_file; |
330 | if (!read_ushort(f, &type)) goto close_file; | 365 | if (!read_ushort(map, fsize, &position, &type)) goto close_file; |
331 | if (!read_ushort(f, &count)) goto close_file; | 366 | if (!read_ushort(map, fsize, &position, &count)) goto close_file; |
332 | if (!((reserved == 0) && | 367 | if (!((reserved == 0) && |
333 | ((type == ICON) || (type == CURSOR)) && (count > 0))) | 368 | ((type == ICON) || (type == CURSOR)) && (count > 0))) |
334 | goto close_file; | 369 | goto close_file; |
335 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 370 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
@@ -363,24 +398,25 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
363 | } | 398 | } |
364 | for (i = 0; i < count; i++) | 399 | for (i = 0; i < count; i++) |
365 | { | 400 | { |
366 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 401 | unsigned char tw = 0, th = 0, tcols = 0; |
367 | w = byte; | 402 | if (!read_uchar(map, fsize, &position, &tw)) goto close_file; |
403 | w = tw; | ||
368 | if (w <= 0) w = 256; | 404 | if (w <= 0) w = 256; |
369 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 405 | if (!read_uchar(map, fsize, &position, &th)) goto close_file; |
370 | h = byte; | 406 | h = th; |
371 | if (h <= 0) h = 256; | 407 | if (h <= 0) h = 256; |
372 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 408 | if (!read_uchar(map, fsize, &position, &tcols)) goto close_file; |
373 | cols = byte; | 409 | cols = tcols; |
374 | if (cols <= 0) cols = 256; | 410 | if (cols <= 0) cols = 256; |
375 | if (fread(&byte, 1, 1, f) != 1) goto close_file; | 411 | if (!read_uchar(map, fsize, &position, &byte)) goto close_file; |
376 | if (!read_ushort(f, &word)) goto close_file; | 412 | if (!read_ushort(map, fsize, &position, &word)) goto close_file; |
377 | if (type == 1) planes = word; | 413 | if (type == 1) planes = word; |
378 | else hot_x = word; | 414 | else hot_x = word; |
379 | if (!read_ushort(f, &word)) goto close_file; | 415 | if (!read_ushort(map, fsize, &position, &word)) goto close_file; |
380 | if (type == 1) bpp = word; | 416 | if (type == 1) bpp = word; |
381 | else hot_y = word; | 417 | else hot_y = word; |
382 | if (!read_uint(f, &bmsize)) goto close_file; | 418 | if (!read_uint(map, fsize, &position, &bmsize)) goto close_file; |
383 | if (!read_uint(f, &bmoffset)) goto close_file; | 419 | if (!read_uint(map, fsize, &position, &bmoffset)) goto close_file; |
384 | if ((bmsize <= 0) || (bmoffset <= 0) || (bmoffset >= fsize)) goto close_file; | 420 | if ((bmsize <= 0) || (bmoffset <= 0) || (bmoffset >= fsize)) goto close_file; |
385 | if (search == BIGGEST) | 421 | if (search == BIGGEST) |
386 | { | 422 | { |
@@ -467,7 +503,7 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
467 | } | 503 | } |
468 | } | 504 | } |
469 | if (chosen.bmoffset == 0) goto close_file; | 505 | if (chosen.bmoffset == 0) goto close_file; |
470 | if (fseek(f, chosen.bmoffset, SEEK_SET) != 0) goto close_file; | 506 | position = chosen.bmoffset; |
471 | 507 | ||
472 | w = chosen.w; | 508 | w = chosen.w; |
473 | h = chosen.h; | 509 | h = chosen.h; |
@@ -477,8 +513,8 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
477 | if (((int)ie->w != w) || ((int)ie->h != h)) goto close_file; | 513 | if (((int)ie->w != w) || ((int)ie->h != h)) goto close_file; |
478 | 514 | ||
479 | // read bmp header time... let's do some checking | 515 | // read bmp header time... let's do some checking |
480 | if (!read_uint(f, &dword)) goto close_file; // headersize - dont care | 516 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // headersize - dont care |
481 | if (!read_uint(f, &dword)) goto close_file; // width | 517 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // width |
482 | if (dword > 0) | 518 | if (dword > 0) |
483 | { | 519 | { |
484 | if ((int)dword != w) | 520 | if ((int)dword != w) |
@@ -487,7 +523,7 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
487 | diff_size = 1; | 523 | diff_size = 1; |
488 | } | 524 | } |
489 | } | 525 | } |
490 | if (!read_uint(f, &dword)) goto close_file; // height | 526 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // height |
491 | if (dword > 0) | 527 | if (dword > 0) |
492 | { | 528 | { |
493 | if ((int)dword != (h * 2)) | 529 | if ((int)dword != (h * 2)) |
@@ -503,19 +539,19 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
503 | " May be expanded or cropped.", | 539 | " May be expanded or cropped.", |
504 | file, ie->w, ie->h, w, h); | 540 | file, ie->w, ie->h, w, h); |
505 | } | 541 | } |
506 | if (!read_ushort(f, &word)) goto close_file; // planes | 542 | if (!read_ushort(map, fsize, &position, &word)) goto close_file; // planes |
507 | planes2 = word; | 543 | planes2 = word; |
508 | if (!read_ushort(f, &word)) goto close_file; // bitcount | 544 | if (!read_ushort(map, fsize, &position, &word)) goto close_file; // bitcount |
509 | bitcount = word; | 545 | bitcount = word; |
510 | if (!read_uint(f, &dword)) goto close_file; // compression | 546 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // compression |
511 | compression = dword; | 547 | compression = dword; |
512 | if (!read_uint(f, &dword)) goto close_file; // imagesize | 548 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // imagesize |
513 | imagesize = dword; | 549 | imagesize = dword; |
514 | if (!read_uint(f, &dword)) goto close_file; // z pixels per m | 550 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // z pixels per m |
515 | if (!read_uint(f, &dword)) goto close_file; // y pizels per m | 551 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // y pizels per m |
516 | if (!read_uint(f, &dword)) goto close_file; // colors used | 552 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // colors used |
517 | colorsused = dword; | 553 | colorsused = dword; |
518 | if (!read_uint(f, &dword)) goto close_file; // colors important | 554 | if (!read_uint(map, fsize, &position, &dword)) goto close_file; // colors important |
519 | colorsimportant = dword; | 555 | colorsimportant = dword; |
520 | 556 | ||
521 | evas_cache_image_surface_alloc(ie, ie->w, ie->h); | 557 | evas_cache_image_surface_alloc(ie, ie->w, ie->h); |
@@ -545,11 +581,11 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
545 | for (i = 0; i < cols; i++) | 581 | for (i = 0; i < cols; i++) |
546 | { | 582 | { |
547 | unsigned char a, r, g, b; | 583 | unsigned char a, r, g, b; |
548 | 584 | ||
549 | if (fread(&b, 1, 1, f) != 1) goto close_file; | 585 | if (!read_uchar(map, fsize, &position, &b)) goto close_file; |
550 | if (fread(&g, 1, 1, f) != 1) goto close_file; | 586 | if (!read_uchar(map, fsize, &position, &g)) goto close_file; |
551 | if (fread(&r, 1, 1, f) != 1) goto close_file; | 587 | if (!read_uchar(map, fsize, &position, &r)) goto close_file; |
552 | if (fread(&a, 1, 1, f) != 1) goto close_file; | 588 | if (!read_uchar(map, fsize, &position, &a)) goto close_file; |
553 | a = 0xff; | 589 | a = 0xff; |
554 | pal[i] = ARGB_JOIN(a, r, g, b); | 590 | pal[i] = ARGB_JOIN(a, r, g, b); |
555 | } | 591 | } |
@@ -563,7 +599,7 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
563 | { | 599 | { |
564 | pix = surface + (i * ie->w); | 600 | pix = surface + (i * ie->w); |
565 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); | 601 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); |
566 | if (fread(pixbuf, pstride, 1, f) != 1) goto close_file; | 602 | if (!read_mem(map, fsize, &position, pixbuf, pstride)) goto close_file; |
567 | p = pixbuf; | 603 | p = pixbuf; |
568 | if (i >= (int)ie->h) continue; | 604 | if (i >= (int)ie->h) continue; |
569 | for (j = 0; j < w; j++) | 605 | for (j = 0; j < w; j++) |
@@ -613,7 +649,7 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
613 | { | 649 | { |
614 | pix = surface + (i * ie->w); | 650 | pix = surface + (i * ie->w); |
615 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); | 651 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); |
616 | if (fread(pixbuf, pstride, 1, f) != 1) goto close_file; | 652 | if (!read_mem(map, fsize, &position, pixbuf, pstride)) goto close_file; |
617 | p = pixbuf; | 653 | p = pixbuf; |
618 | if (i >= (int)ie->h) continue; | 654 | if (i >= (int)ie->h) continue; |
619 | for (j = 0; j < w; j++) | 655 | for (j = 0; j < w; j++) |
@@ -639,7 +675,7 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
639 | { | 675 | { |
640 | pix = surface + (i * ie->w); | 676 | pix = surface + (i * ie->w); |
641 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); | 677 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); |
642 | if (fread(pixbuf, pstride, 1, f) != 1) goto close_file; | 678 | if (!read_mem(map, fsize, &position, pixbuf, pstride)) goto close_file; |
643 | p = pixbuf; | 679 | p = pixbuf; |
644 | if (i >= (int)ie->h) continue; | 680 | if (i >= (int)ie->h) continue; |
645 | for (j = 0; j < w; j++) | 681 | for (j = 0; j < w; j++) |
@@ -658,13 +694,13 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
658 | { | 694 | { |
659 | pix = surface + (i * ie->w); | 695 | pix = surface + (i * ie->w); |
660 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); | 696 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); |
661 | if (fread(pixbuf, pstride, 1, f) != 1) goto close_file; | 697 | if (!read_mem(map, fsize, &position, pixbuf, pstride)) goto close_file; |
662 | p = pixbuf; | 698 | p = pixbuf; |
663 | if (i >= (int)ie->h) continue; | 699 | if (i >= (int)ie->h) continue; |
664 | for (j = 0; j < w; j++) | 700 | for (j = 0; j < w; j++) |
665 | { | 701 | { |
666 | unsigned char a, r, g, b; | 702 | unsigned char a, r, g, b; |
667 | 703 | ||
668 | if (j >= (int)ie->w) break; | 704 | if (j >= (int)ie->w) break; |
669 | b = p[0]; | 705 | b = p[0]; |
670 | g = p[1]; | 706 | g = p[1]; |
@@ -683,13 +719,13 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
683 | { | 719 | { |
684 | pix = surface + (i * ie->w); | 720 | pix = surface + (i * ie->w); |
685 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); | 721 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); |
686 | if (fread(pixbuf, pstride, 1, f) != 1) goto close_file; | 722 | if (!read_mem(map, fsize, &position, pixbuf, pstride)) goto close_file; |
687 | p = pixbuf; | 723 | p = pixbuf; |
688 | if (i >= (int)ie->h) continue; | 724 | if (i >= (int)ie->h) continue; |
689 | for (j = 0; j < w; j++) | 725 | for (j = 0; j < w; j++) |
690 | { | 726 | { |
691 | unsigned char a, r, g, b; | 727 | unsigned char a, r, g, b; |
692 | 728 | ||
693 | if (j >= (int)ie->w) break; | 729 | if (j >= (int)ie->w) break; |
694 | b = p[0]; | 730 | b = p[0]; |
695 | g = p[1]; | 731 | g = p[1]; |
@@ -704,13 +740,13 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
704 | } | 740 | } |
705 | if (!none_zero_alpha) | 741 | if (!none_zero_alpha) |
706 | { | 742 | { |
707 | if (fread(maskbuf, stride * 4 * h, 1, f) != 1) goto close_file; | 743 | if (!read_mem(map, fsize, &position, maskbuf, stride * 4 * h)) goto close_file; |
708 | // apply mask | 744 | // apply mask |
709 | pix = surface; | 745 | pix = surface; |
710 | for (i = 0; i < h; i++) | 746 | for (i = 0; i < h; i++) |
711 | { | 747 | { |
712 | unsigned char *m; | 748 | unsigned char *m; |
713 | 749 | ||
714 | pix = surface + (i * ie->w); | 750 | pix = surface + (i * ie->w); |
715 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); | 751 | if (!right_way_up) pix = surface + ((ie->h - 1 - i) * ie->w); |
716 | m = maskbuf + (stride * i * 4); | 752 | m = maskbuf + (stride * i * 4); |
@@ -727,15 +763,17 @@ evas_image_load_file_data_ico(Image_Entry *ie, const char *file, const char *key | |||
727 | } | 763 | } |
728 | } | 764 | } |
729 | } | 765 | } |
730 | 766 | ||
731 | fclose(f); | 767 | eina_file_map_free(f, map); |
732 | 768 | eina_file_close(f); | |
769 | |||
733 | evas_common_image_premul(ie); | 770 | evas_common_image_premul(ie); |
734 | *error = EVAS_LOAD_ERROR_NONE; | 771 | *error = EVAS_LOAD_ERROR_NONE; |
735 | return EINA_TRUE; | 772 | return EINA_TRUE; |
736 | 773 | ||
737 | close_file: | 774 | close_file: |
738 | fclose(f); | 775 | if (map) eina_file_map_free(f, map); |
776 | eina_file_close(f); | ||
739 | return EINA_FALSE; | 777 | return EINA_FALSE; |
740 | } | 778 | } |
741 | 779 | ||
diff --git a/libraries/evas/src/modules/loaders/jpeg/Makefile.in b/libraries/evas/src/modules/loaders/jpeg/Makefile.in index ce4b194..7c0ca18 100644 --- a/libraries/evas/src/modules/loaders/jpeg/Makefile.in +++ b/libraries/evas/src/modules/loaders/jpeg/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c b/libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c index 0dbabab..797c76d 100644 --- a/libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c +++ b/libraries/evas/src/modules/loaders/jpeg/evas_image_load_jpeg.c | |||
@@ -46,7 +46,8 @@ static Evas_Image_Load_Func evas_image_load_jpeg_func = | |||
46 | EINA_TRUE, | 46 | EINA_TRUE, |
47 | evas_image_load_file_head_jpeg, | 47 | evas_image_load_file_head_jpeg, |
48 | evas_image_load_file_data_jpeg, | 48 | evas_image_load_file_data_jpeg, |
49 | NULL | 49 | NULL, |
50 | EINA_TRUE | ||
50 | }; | 51 | }; |
51 | 52 | ||
52 | 53 | ||
diff --git a/libraries/evas/src/modules/loaders/pmaps/Makefile.in b/libraries/evas/src/modules/loaders/pmaps/Makefile.in index de7b779..745e79b 100644 --- a/libraries/evas/src/modules/loaders/pmaps/Makefile.in +++ b/libraries/evas/src/modules/loaders/pmaps/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/pmaps/evas_image_load_pmaps.c b/libraries/evas/src/modules/loaders/pmaps/evas_image_load_pmaps.c index 9ba8f81..393e407 100644 --- a/libraries/evas/src/modules/loaders/pmaps/evas_image_load_pmaps.c +++ b/libraries/evas/src/modules/loaders/pmaps/evas_image_load_pmaps.c | |||
@@ -19,7 +19,8 @@ Evas_Image_Load_Func evas_image_load_pmaps_func = { | |||
19 | EINA_TRUE, | 19 | EINA_TRUE, |
20 | evas_image_load_file_head_pmaps, | 20 | evas_image_load_file_head_pmaps, |
21 | evas_image_load_file_data_pmaps, | 21 | evas_image_load_file_data_pmaps, |
22 | NULL | 22 | NULL, |
23 | EINA_FALSE | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | /* The buffer to load pmaps images */ | 26 | /* The buffer to load pmaps images */ |
@@ -27,7 +28,9 @@ typedef struct Pmaps_Buffer Pmaps_Buffer; | |||
27 | 28 | ||
28 | struct Pmaps_Buffer | 29 | struct Pmaps_Buffer |
29 | { | 30 | { |
30 | FILE *file; | 31 | Eina_File *file; |
32 | void *map; | ||
33 | size_t position; | ||
31 | 34 | ||
32 | /* the buffer */ | 35 | /* the buffer */ |
33 | DATA8 buffer[FILE_BUFFER_SIZE]; | 36 | DATA8 buffer[FILE_BUFFER_SIZE]; |
@@ -160,13 +163,23 @@ pmaps_buffer_open(Pmaps_Buffer *b, const char *filename, int *error) | |||
160 | { | 163 | { |
161 | size_t len; | 164 | size_t len; |
162 | 165 | ||
163 | b->file = fopen(filename, "rb"); | 166 | b->file = eina_file_open(filename, EINA_FALSE); |
164 | if (!b->file) | 167 | if (!b->file) |
165 | { | 168 | { |
166 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 169 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
167 | return EINA_FALSE; | 170 | return EINA_FALSE; |
168 | } | 171 | } |
169 | 172 | ||
173 | b->map = eina_file_map_all(b->file, EINA_FILE_SEQUENTIAL); | ||
174 | if (!b->map) | ||
175 | { | ||
176 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | ||
177 | eina_file_close(b->file); | ||
178 | b->file = NULL; | ||
179 | return EINA_FALSE; | ||
180 | } | ||
181 | |||
182 | b->position = 0; | ||
170 | *b->buffer = 0; | 183 | *b->buffer = 0; |
171 | *b->unread = 0; | 184 | *b->unread = 0; |
172 | b->last_buffer = 0; | 185 | b->last_buffer = 0; |
@@ -177,7 +190,9 @@ pmaps_buffer_open(Pmaps_Buffer *b, const char *filename, int *error) | |||
177 | if (len < 3) | 190 | if (len < 3) |
178 | { | 191 | { |
179 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 192 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
180 | fclose(b->file); | 193 | eina_file_map_free(b->file, b->map); |
194 | eina_file_close(b->file); | ||
195 | b->map = NULL; | ||
181 | b->file = NULL; | 196 | b->file = NULL; |
182 | return EINA_FALSE; | 197 | return EINA_FALSE; |
183 | } | 198 | } |
@@ -197,7 +212,12 @@ static void | |||
197 | pmaps_buffer_close(Pmaps_Buffer *b) | 212 | pmaps_buffer_close(Pmaps_Buffer *b) |
198 | { | 213 | { |
199 | if (b->file) | 214 | if (b->file) |
200 | fclose(b->file); | 215 | { |
216 | if (b->map) eina_file_map_free(b->file, b->map); | ||
217 | b->map = NULL; | ||
218 | eina_file_close(b->file); | ||
219 | b->file = NULL; | ||
220 | } | ||
201 | } | 221 | } |
202 | 222 | ||
203 | static Eina_Bool | 223 | static Eina_Bool |
@@ -295,6 +315,7 @@ static size_t | |||
295 | pmaps_buffer_plain_update(Pmaps_Buffer *b) | 315 | pmaps_buffer_plain_update(Pmaps_Buffer *b) |
296 | { | 316 | { |
297 | size_t r; | 317 | size_t r; |
318 | size_t max; | ||
298 | 319 | ||
299 | /* if we already are in the last buffer we can not update it */ | 320 | /* if we already are in the last buffer we can not update it */ |
300 | if (b->last_buffer) | 321 | if (b->last_buffer) |
@@ -304,9 +325,14 @@ pmaps_buffer_plain_update(Pmaps_Buffer *b) | |||
304 | * stuff */ | 325 | * stuff */ |
305 | if (b->unread_len) | 326 | if (b->unread_len) |
306 | memcpy(b->buffer, b->unread, b->unread_len); | 327 | memcpy(b->buffer, b->unread, b->unread_len); |
307 | 328 | ||
308 | r = fread(&b->buffer[b->unread_len], 1, | 329 | max = FILE_BUFFER_SIZE - b->unread_len - 1; |
309 | FILE_BUFFER_SIZE - b->unread_len - 1, b->file) + b->unread_len; | 330 | if (b->position + max > eina_file_size_get(b->file)) |
331 | max = eina_file_size_get(b->file) - b->position; | ||
332 | |||
333 | memcpy(&b->buffer[b->unread_len], b->map + b->position, max); | ||
334 | b->position += max; | ||
335 | r = max + b->unread_len; | ||
310 | 336 | ||
311 | /* we haven't read anything nor have we bytes in the unread buffer */ | 337 | /* we haven't read anything nor have we bytes in the unread buffer */ |
312 | if (r == 0) | 338 | if (r == 0) |
@@ -324,7 +350,7 @@ pmaps_buffer_plain_update(Pmaps_Buffer *b) | |||
324 | } | 350 | } |
325 | 351 | ||
326 | b->buffer[r] = 0; | 352 | b->buffer[r] = 0; |
327 | 353 | ||
328 | b->unread[0] = '\0'; | 354 | b->unread[0] = '\0'; |
329 | b->unread_len = 0; | 355 | b->unread_len = 0; |
330 | 356 | ||
@@ -339,6 +365,7 @@ static size_t | |||
339 | pmaps_buffer_raw_update(Pmaps_Buffer *b) | 365 | pmaps_buffer_raw_update(Pmaps_Buffer *b) |
340 | { | 366 | { |
341 | size_t r; | 367 | size_t r; |
368 | size_t max; | ||
342 | 369 | ||
343 | if (b->last_buffer) | 370 | if (b->last_buffer) |
344 | return 0; | 371 | return 0; |
@@ -346,8 +373,13 @@ pmaps_buffer_raw_update(Pmaps_Buffer *b) | |||
346 | if (b->unread_len) | 373 | if (b->unread_len) |
347 | memcpy(b->buffer, b->unread, b->unread_len); | 374 | memcpy(b->buffer, b->unread, b->unread_len); |
348 | 375 | ||
349 | r = fread(&b->buffer[b->unread_len], 1, FILE_BUFFER_SIZE - b->unread_len, | 376 | max = FILE_BUFFER_SIZE - b->unread_len; |
350 | b->file) + b->unread_len; | 377 | if (b->position + max > eina_file_size_get(b->file)) |
378 | max = eina_file_size_get(b->file) - b->position; | ||
379 | |||
380 | memcpy(&b->buffer[b->unread_len], b->map + b->position, max); | ||
381 | b->position += max; | ||
382 | r = max + b->unread_len; | ||
351 | 383 | ||
352 | if (r < FILE_BUFFER_SIZE) | 384 | if (r < FILE_BUFFER_SIZE) |
353 | { | 385 | { |
diff --git a/libraries/evas/src/modules/loaders/png/Makefile.in b/libraries/evas/src/modules/loaders/png/Makefile.in index 0717299..3bd4919 100644 --- a/libraries/evas/src/modules/loaders/png/Makefile.in +++ b/libraries/evas/src/modules/loaders/png/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/png/evas_image_load_png.c b/libraries/evas/src/modules/loaders/png/evas_image_load_png.c index a1480ae..3007a57 100644 --- a/libraries/evas/src/modules/loaders/png/evas_image_load_png.c +++ b/libraries/evas/src/modules/loaders/png/evas_image_load_png.c | |||
@@ -35,7 +35,8 @@ static Evas_Image_Load_Func evas_image_load_png_func = | |||
35 | EINA_TRUE, | 35 | EINA_TRUE, |
36 | evas_image_load_file_head_png, | 36 | evas_image_load_file_head_png, |
37 | evas_image_load_file_data_png, | 37 | evas_image_load_file_data_png, |
38 | NULL | 38 | NULL, |
39 | EINA_FALSE | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | static Eina_Bool | 42 | static Eina_Bool |
diff --git a/libraries/evas/src/modules/loaders/psd/Makefile.in b/libraries/evas/src/modules/loaders/psd/Makefile.in index 98d340a..3dc9c38 100644 --- a/libraries/evas/src/modules/loaders/psd/Makefile.in +++ b/libraries/evas/src/modules/loaders/psd/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c b/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c index 5a85e17..27f5f24 100644 --- a/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c +++ b/libraries/evas/src/modules/loaders/psd/evas_image_load_psd.c | |||
@@ -61,48 +61,57 @@ enum { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | static Eina_Bool get_compressed_channels_length(PSD_Header *Head, | 63 | static Eina_Bool get_compressed_channels_length(PSD_Header *Head, |
64 | FILE *file, | 64 | const unsigned char *map, size_t length, size_t *position, |
65 | unsigned short *rle_table, | 65 | unsigned short *rle_table, |
66 | unsigned int *chanlen); | 66 | unsigned int *chanlen); |
67 | 67 | ||
68 | static int | 68 | static int |
69 | read_ushort(FILE *file, unsigned short *ret) | 69 | read_ushort(const unsigned char *map, size_t length, size_t *position, unsigned short *ret) |
70 | { | 70 | { |
71 | unsigned char b[2]; | 71 | if (*position + 2 > length) return 0; |
72 | if (fread(b, sizeof(unsigned char), 2, file) != 2) return 0; | ||
73 | // FIXME: need to check order | 72 | // FIXME: need to check order |
74 | *ret = (b[0] << 8) | b[1]; | 73 | *ret = (map[(*position) + 0] << 8) | map[(*position) + 1]; |
74 | *position += 2; | ||
75 | return 1; | 75 | return 1; |
76 | } | 76 | } |
77 | 77 | ||
78 | static int | 78 | static int |
79 | read_uint(FILE *file, unsigned int *ret) | 79 | read_uint(const unsigned char *map, size_t length, size_t *position, unsigned int *ret) |
80 | { | 80 | { |
81 | unsigned char b[4]; | 81 | if (*position + 4 > length) return 0; |
82 | if (fread(b, sizeof(unsigned char), 4, file) != 4) return 0; | ||
83 | // FIXME: need to check order | 82 | // FIXME: need to check order |
84 | *ret = ARGB_JOIN(b[0], b[1], b[2], b[3]); | 83 | *ret = ARGB_JOIN(map[(*position) + 0], map[(*position) + 1], map[(*position) + 2], map[(*position) + 3]); |
84 | *position += 4; | ||
85 | return 1; | ||
86 | } | ||
87 | |||
88 | static int | ||
89 | read_block(const unsigned char *map, size_t length, size_t *position, void *target, size_t size) | ||
90 | { | ||
91 | if (*position + size > length) return 0; | ||
92 | memcpy(target, map + *position, size); | ||
93 | *position += size; | ||
85 | return 1; | 94 | return 1; |
86 | } | 95 | } |
87 | 96 | ||
88 | // Internal function used to get the Psd header from the current file. | 97 | // Internal function used to get the Psd header from the current file. |
89 | Eina_Bool | 98 | Eina_Bool |
90 | psd_get_header(PSD_Header *header, FILE * file) | 99 | psd_get_header(PSD_Header *header, const unsigned char *map, size_t length, size_t *position) |
91 | { | 100 | { |
92 | unsigned short tmp; | 101 | unsigned short tmp; |
93 | 102 | ||
94 | #define CHECK_RET(Call, Value) \ | 103 | #define CHECK_RET(Call) \ |
95 | if (Call != Value) return EINA_FALSE; | 104 | if (!Call) return EINA_FALSE; |
96 | 105 | ||
97 | CHECK_RET(fread(header->signature, sizeof (unsigned char), 4, file), 4); | 106 | CHECK_RET(read_block(map, length, position, header->signature, 4)); |
98 | CHECK_RET(read_ushort(file, &header->version), 1); | 107 | CHECK_RET(read_ushort(map, length, position, &header->version)); |
99 | CHECK_RET(fread(header->reserved, sizeof (unsigned char), 6, file), 6); | 108 | CHECK_RET(read_block(map, length, position, header->reserved, 6)); |
100 | CHECK_RET(read_ushort(file, &header->channels), 1); | 109 | CHECK_RET(read_ushort(map, length, position, &header->channels)); |
101 | CHECK_RET(read_uint(file, &header->height), 1); | 110 | CHECK_RET(read_uint(map, length, position, &header->height)); |
102 | CHECK_RET(read_uint(file, &header->width), 1); | 111 | CHECK_RET(read_uint(map, length, position, &header->width)); |
103 | CHECK_RET(read_ushort(file, &header->depth), 1); | 112 | CHECK_RET(read_ushort(map, length, position, &header->depth)); |
104 | 113 | ||
105 | CHECK_RET(read_ushort(file, &tmp), 1); | 114 | CHECK_RET(read_ushort(map, length, position, &tmp)); |
106 | header->mode = tmp; | 115 | header->mode = tmp; |
107 | 116 | ||
108 | #undef CHECK_RET | 117 | #undef CHECK_RET |
@@ -144,20 +153,35 @@ static Eina_Bool | |||
144 | evas_image_load_file_head_psd(Image_Entry *ie, const char *FileName, | 153 | evas_image_load_file_head_psd(Image_Entry *ie, const char *FileName, |
145 | const char *key __UNUSED__, int *error) | 154 | const char *key __UNUSED__, int *error) |
146 | { | 155 | { |
147 | FILE *f; | 156 | Eina_File *f; |
157 | void *map; | ||
158 | size_t length; | ||
159 | size_t position; | ||
148 | PSD_Header header; | 160 | PSD_Header header; |
149 | Eina_Bool correct; | 161 | Eina_Bool correct; |
150 | 162 | ||
151 | *error = EVAS_LOAD_ERROR_NONE; | 163 | *error = EVAS_LOAD_ERROR_NONE; |
152 | 164 | ||
153 | f = fopen(FileName, "rb"); | 165 | f = eina_file_open(FileName, 0); |
154 | if (f == NULL) | 166 | if (f == NULL) |
155 | { | 167 | { |
156 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 168 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
157 | return EINA_FALSE; | 169 | return EINA_FALSE; |
158 | } | 170 | } |
159 | correct = psd_get_header(&header, f); | 171 | |
160 | fclose(f); | 172 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); |
173 | length = eina_file_size_get(f); | ||
174 | position = 0; | ||
175 | if (!map || length < 1) | ||
176 | { | ||
177 | eina_file_close(f); | ||
178 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | ||
179 | return EINA_FALSE; | ||
180 | } | ||
181 | correct = psd_get_header(&header, map, length, &position); | ||
182 | |||
183 | eina_file_map_free(f, map); | ||
184 | eina_file_close(f); | ||
161 | 185 | ||
162 | if (!correct || !is_psd(&header)) | 186 | if (!correct || !is_psd(&header)) |
163 | { | 187 | { |
@@ -174,7 +198,7 @@ evas_image_load_file_head_psd(Image_Entry *ie, const char *FileName, | |||
174 | } | 198 | } |
175 | 199 | ||
176 | static unsigned int | 200 | static unsigned int |
177 | read_compressed_channel(FILE* file, | 201 | read_compressed_channel(const unsigned char *map, size_t length, size_t *position, |
178 | const unsigned int channel_length __UNUSED__, | 202 | const unsigned int channel_length __UNUSED__, |
179 | unsigned int size, | 203 | unsigned int size, |
180 | unsigned char* channel) | 204 | unsigned char* channel) |
@@ -183,19 +207,18 @@ read_compressed_channel(FILE* file, | |||
183 | unsigned int i; | 207 | unsigned int i; |
184 | char headbyte, c; | 208 | char headbyte, c; |
185 | 209 | ||
186 | #define CHECK_RET(Call, Value) \ | 210 | #define CHECK_RET(Call) \ |
187 | if (Call != Value) return READ_COMPRESSED_ERROR_FILE_READ_ERROR; | 211 | if (!Call) return READ_COMPRESSED_ERROR_FILE_READ_ERROR; \ |
188 | 212 | ||
189 | for (i = 0; i < size; ) | 213 | for (i = 0; i < size; ) |
190 | { | 214 | { |
191 | CHECK_RET(fread(&headbyte, 1, 1, file), 1); | 215 | CHECK_RET(read_block(map, length, position, &headbyte, 1)); |
192 | 216 | ||
193 | if (headbyte >= 0) | 217 | if (headbyte >= 0) |
194 | { | 218 | { |
195 | if (i + headbyte > size) | 219 | if (i + headbyte > size) |
196 | return READ_COMPRESSED_ERROR_FILE_CORRUPT; | 220 | return READ_COMPRESSED_ERROR_FILE_CORRUPT; |
197 | 221 | CHECK_RET(read_block(map, length, position, channel + i, headbyte + 1)); | |
198 | CHECK_RET(fread(channel + i, headbyte + 1, 1, file), 1); | ||
199 | 222 | ||
200 | i += headbyte + 1; | 223 | i += headbyte + 1; |
201 | } | 224 | } |
@@ -203,14 +226,14 @@ read_compressed_channel(FILE* file, | |||
203 | { | 226 | { |
204 | int run; | 227 | int run; |
205 | 228 | ||
206 | CHECK_RET(fread(&c, 1, 1, file), 1); | 229 | CHECK_RET(read_block(map, length, position, &c, 1)); |
207 | 230 | ||
208 | run = c; | 231 | run = c; |
209 | /* if (run == -1) */ | 232 | /* if (run == -1) */ |
210 | /* return READ_COMPRESSED_ERROR_FILE_READ_ERROR; */ | 233 | /* return READ_COMPRESSED_ERROR_FILE_READ_ERROR; */ |
211 | 234 | ||
212 | if (i + (-headbyte + 1) > size) | 235 | if (i + (-headbyte + 1) > size) |
213 | return READ_COMPRESSED_ERROR_FILE_CORRUPT; | 236 | return READ_COMPRESSED_ERROR_FILE_CORRUPT; |
214 | 237 | ||
215 | memset(channel + i, run, -headbyte + 1); | 238 | memset(channel + i, run, -headbyte + 1); |
216 | i += -headbyte + 1; | 239 | i += -headbyte + 1; |
@@ -226,7 +249,7 @@ read_compressed_channel(FILE* file, | |||
226 | Eina_Bool | 249 | Eina_Bool |
227 | psd_get_data(Image_Entry *ie __UNUSED__, | 250 | psd_get_data(Image_Entry *ie __UNUSED__, |
228 | PSD_Header *head, | 251 | PSD_Header *head, |
229 | FILE *f, | 252 | const unsigned char *map, size_t length, size_t *position, |
230 | unsigned char *buffer, Eina_Bool compressed, | 253 | unsigned char *buffer, Eina_Bool compressed, |
231 | int *error) | 254 | int *error) |
232 | { | 255 | { |
@@ -268,13 +291,12 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
268 | { | 291 | { |
269 | free(data); | 292 | free(data); |
270 | free(channel); | 293 | free(channel); |
271 | fprintf(stderr, "unsupported file format.\n"); | ||
272 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 294 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
273 | return EINA_FALSE; | 295 | return EINA_FALSE; |
274 | } | 296 | } |
275 | 297 | ||
276 | #define CHECK_RET(Call, Value) \ | 298 | #define CHECK_RET(Call) \ |
277 | if (Call != Value) \ | 299 | if (!Call) \ |
278 | { \ | 300 | { \ |
279 | free(data); \ | 301 | free(data); \ |
280 | free(channel); \ | 302 | free(channel); \ |
@@ -289,7 +311,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
289 | { | 311 | { |
290 | unsigned char *tmp = channel; | 312 | unsigned char *tmp = channel; |
291 | 313 | ||
292 | CHECK_RET(fread(tmp, pixels_count, 1, f), 1); | 314 | CHECK_RET(read_block(map, length, position, tmp, pixels_count)); |
293 | 315 | ||
294 | for (y = 0; y < head->height * bps; y += bps) | 316 | for (y = 0; y < head->height * bps; y += bps) |
295 | { | 317 | { |
@@ -306,7 +328,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
306 | { | 328 | { |
307 | unsigned char *tmp = channel; | 329 | unsigned char *tmp = channel; |
308 | 330 | ||
309 | CHECK_RET(fread(channel, pixels_count, 1, f), 1); | 331 | CHECK_RET(read_block(map, length, position, channel, pixels_count)); |
310 | 332 | ||
311 | for (y = 0; y < head->height * bps; y += bps) | 333 | for (y = 0; y < head->height * bps; y += bps) |
312 | { | 334 | { |
@@ -333,7 +355,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
333 | { | 355 | { |
334 | unsigned short *shortptr = (unsigned short*) channel; | 356 | unsigned short *shortptr = (unsigned short*) channel; |
335 | 357 | ||
336 | CHECK_RET(fread(channel, pixels_count * 2, 1, f), 1); | 358 | CHECK_RET(read_block(map, length, position, channel, pixels_count * 2)); |
337 | 359 | ||
338 | for (y = 0; y < head->height * bps2; y += bps2) | 360 | for (y = 0; y < head->height * bps2; y += bps2) |
339 | { | 361 | { |
@@ -350,7 +372,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
350 | { | 372 | { |
351 | unsigned short *shortptr = (unsigned short*) channel; | 373 | unsigned short *shortptr = (unsigned short*) channel; |
352 | 374 | ||
353 | CHECK_RET(fread(channel, pixels_count * 2, 1, f), 1); | 375 | CHECK_RET(read_block(map, length, position, channel, pixels_count * 2)); |
354 | 376 | ||
355 | for (y = 0; y < head->height * bps2; y += bps2) | 377 | for (y = 0; y < head->height * bps2; y += bps2) |
356 | { | 378 | { |
@@ -373,7 +395,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
373 | 395 | ||
374 | rle_table = alloca(head->height * head->channel_num * sizeof (unsigned short)); | 396 | rle_table = alloca(head->height * head->channel_num * sizeof (unsigned short)); |
375 | chanlen = alloca(head->channel_num * sizeof (unsigned int)); | 397 | chanlen = alloca(head->channel_num * sizeof (unsigned int)); |
376 | if (!get_compressed_channels_length(head, f, rle_table, chanlen)) | 398 | if (!get_compressed_channels_length(head, map, length, position, rle_table, chanlen)) |
377 | goto file_read_error; | 399 | goto file_read_error; |
378 | 400 | ||
379 | for (c = 0; c < numchan; c++) | 401 | for (c = 0; c < numchan; c++) |
@@ -381,7 +403,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
381 | unsigned char *tmp = channel; | 403 | unsigned char *tmp = channel; |
382 | int err; | 404 | int err; |
383 | 405 | ||
384 | err = read_compressed_channel(f, | 406 | err = read_compressed_channel(map, length, position, |
385 | chanlen[c], | 407 | chanlen[c], |
386 | pixels_count, | 408 | pixels_count, |
387 | channel); | 409 | channel); |
@@ -416,7 +438,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
416 | unsigned char *tmp = channel; | 438 | unsigned char *tmp = channel; |
417 | int err; | 439 | int err; |
418 | 440 | ||
419 | err = read_compressed_channel(f, | 441 | err = read_compressed_channel(map, length, position, |
420 | chanlen[c], | 442 | chanlen[c], |
421 | pixels_count, | 443 | pixels_count, |
422 | channel); | 444 | channel); |
@@ -482,7 +504,7 @@ psd_get_data(Image_Entry *ie __UNUSED__, | |||
482 | Eina_Bool | 504 | Eina_Bool |
483 | get_single_channel(Image_Entry *ie __UNUSED__, | 505 | get_single_channel(Image_Entry *ie __UNUSED__, |
484 | PSD_Header *head, | 506 | PSD_Header *head, |
485 | FILE *f, | 507 | const unsigned char *map, size_t length, size_t *position, |
486 | unsigned char *buffer, | 508 | unsigned char *buffer, |
487 | Eina_Bool compressed) | 509 | Eina_Bool compressed) |
488 | { | 510 | { |
@@ -496,29 +518,29 @@ get_single_channel(Image_Entry *ie __UNUSED__, | |||
496 | bpc = (head->depth / 8); | 518 | bpc = (head->depth / 8); |
497 | pixels_count = head->width * head->height; | 519 | pixels_count = head->width * head->height; |
498 | 520 | ||
499 | #define CHECK_RET(Call, Value) \ | 521 | #define CHECK_RET(Call) \ |
500 | if (Call != Value) return EINA_FALSE; | 522 | if (!Call) return EINA_FALSE; |
501 | 523 | ||
502 | if (!compressed) | 524 | if (!compressed) |
503 | { | 525 | { |
504 | if (bpc == 1) | 526 | if (bpc == 1) |
505 | { | 527 | { |
506 | CHECK_RET(fread(buffer, pixels_count, 1, f), 1); | 528 | CHECK_RET(read_block(map, length, position, buffer, pixels_count)); |
507 | } | 529 | } |
508 | else | 530 | else |
509 | { // Bpc == 2 | 531 | { // Bpc == 2 |
510 | CHECK_RET(fread(buffer, pixels_count * 2, 1, f), 1); | 532 | CHECK_RET(read_block(map, length, position, buffer, pixels_count * 2)); |
511 | } | 533 | } |
512 | } | 534 | } |
513 | else | 535 | else |
514 | { | 536 | { |
515 | for (i = 0; i < (unsigned int)pixels_count; ) | 537 | for (i = 0; i < (unsigned int)pixels_count; ) |
516 | { | 538 | { |
517 | CHECK_RET(fread(&headbyte, 1, 1, f), 1); | 539 | CHECK_RET(read_block(map, length, position, &headbyte, 1)); |
518 | 540 | ||
519 | if (headbyte >= 0) | 541 | if (headbyte >= 0) |
520 | { // && HeadByte <= 127 | 542 | { // && HeadByte <= 127 |
521 | CHECK_RET(fread(buffer + i, headbyte + 1, 1, f), 1); | 543 | CHECK_RET(read_block(map, length, position, buffer + i, headbyte + 1)); |
522 | 544 | ||
523 | i += headbyte + 1; | 545 | i += headbyte + 1; |
524 | } | 546 | } |
@@ -526,7 +548,7 @@ get_single_channel(Image_Entry *ie __UNUSED__, | |||
526 | { | 548 | { |
527 | int run; | 549 | int run; |
528 | 550 | ||
529 | CHECK_RET(fread(&c, 1, 1, f), 1); | 551 | CHECK_RET(read_block(map, length, position, &c, 1)); |
530 | 552 | ||
531 | run = c; | 553 | run = c; |
532 | if (run == -1) return EINA_FALSE; | 554 | if (run == -1) return EINA_FALSE; |
@@ -543,7 +565,7 @@ get_single_channel(Image_Entry *ie __UNUSED__, | |||
543 | } | 565 | } |
544 | 566 | ||
545 | Eina_Bool | 567 | Eina_Bool |
546 | read_psd_grey(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | 568 | read_psd_grey(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) |
547 | { | 569 | { |
548 | unsigned int color_mode, resource_size, misc_info; | 570 | unsigned int color_mode, resource_size, misc_info; |
549 | unsigned short compressed; | 571 | unsigned short compressed; |
@@ -552,22 +574,21 @@ read_psd_grey(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | |||
552 | 574 | ||
553 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 575 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
554 | 576 | ||
555 | #define CHECK_RET(Call, Value) \ | 577 | #define CHECK_RET(Call) \ |
556 | if (Call != Value) return EINA_FALSE; | 578 | if (!Call) return EINA_FALSE; |
557 | 579 | ||
558 | CHECK_RET(read_uint(f, &color_mode), 1); | 580 | CHECK_RET(read_uint(map, length, position, &color_mode)); |
559 | // Skip over the 'color mode data section' | 581 | // Skip over the 'color mode data section' |
560 | CHECK_RET(fseek(f, color_mode, SEEK_CUR), 0); | 582 | *position += color_mode; |
561 | 583 | ||
562 | CHECK_RET(read_uint(f, &resource_size), 1); | 584 | CHECK_RET(read_uint(map, length, position, &resource_size)); |
563 | // Read the 'image resources section' | 585 | // Read the 'image resources section' |
586 | *position += resource_size; | ||
564 | 587 | ||
565 | CHECK_RET(fseek(f, resource_size, SEEK_CUR), 0); | 588 | CHECK_RET(read_uint(map, length, position, &misc_info)); |
589 | *position += misc_info; | ||
566 | 590 | ||
567 | CHECK_RET(read_uint(f, &misc_info), 1); | 591 | CHECK_RET(read_ushort(map, length, position, &compressed)); |
568 | CHECK_RET(fseek(f, misc_info, SEEK_CUR), 0); | ||
569 | |||
570 | CHECK_RET(read_ushort(f, &compressed), 1); | ||
571 | 592 | ||
572 | ie->w = head->width; | 593 | ie->w = head->width; |
573 | ie->h = head->height; | 594 | ie->h = head->height; |
@@ -599,7 +620,7 @@ read_psd_grey(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | |||
599 | goto cleanup_error; | 620 | goto cleanup_error; |
600 | } | 621 | } |
601 | 622 | ||
602 | if (!psd_get_data(ie, head, f, surface, compressed, error)) | 623 | if (!psd_get_data(ie, head, map, length, position, surface, compressed, error)) |
603 | goto cleanup_error; | 624 | goto cleanup_error; |
604 | 625 | ||
605 | return EINA_TRUE; | 626 | return EINA_TRUE; |
@@ -612,7 +633,7 @@ read_psd_grey(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | |||
612 | 633 | ||
613 | 634 | ||
614 | Eina_Bool | 635 | Eina_Bool |
615 | read_psd_indexed(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | 636 | read_psd_indexed(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) |
616 | { | 637 | { |
617 | unsigned int color_mode, resource_size, misc_info; | 638 | unsigned int color_mode, resource_size, misc_info; |
618 | unsigned short compressed; | 639 | unsigned short compressed; |
@@ -620,11 +641,11 @@ read_psd_indexed(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | |||
620 | 641 | ||
621 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 642 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
622 | 643 | ||
623 | #define CHECK_RET(Call, Value) \ | 644 | #define CHECK_RET(Call) \ |
624 | if (Call != Value) return EINA_FALSE; | 645 | if (!(Call)) return EINA_FALSE; |
625 | 646 | ||
626 | CHECK_RET(read_uint(f, &color_mode), 1); | 647 | CHECK_RET(read_uint(map, length, position, &color_mode)); |
627 | CHECK_RET((color_mode % 3), 0); | 648 | CHECK_RET(!(color_mode % 3)); |
628 | /* | 649 | /* |
629 | Palette = (unsigned char*)malloc(Colormode); | 650 | Palette = (unsigned char*)malloc(Colormode); |
630 | if (Palette == NULL) | 651 | if (Palette == NULL) |
@@ -633,16 +654,16 @@ read_psd_indexed(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | |||
633 | goto cleanup_error; | 654 | goto cleanup_error; |
634 | */ | 655 | */ |
635 | // Skip over the 'color mode data section' | 656 | // Skip over the 'color mode data section' |
636 | CHECK_RET(fseek(f, color_mode, SEEK_CUR), 0); | 657 | *position += color_mode; |
637 | 658 | ||
638 | // Read the 'image resources section' | 659 | // Read the 'image resources section' |
639 | CHECK_RET(read_uint(f, &resource_size), 1); | 660 | CHECK_RET(read_uint(map, length, position, &resource_size)); |
640 | CHECK_RET(fseek(f, resource_size, SEEK_CUR), 0); | 661 | *position += resource_size; |
641 | 662 | ||
642 | CHECK_RET(read_uint(f, &misc_info), 1); | 663 | CHECK_RET(read_uint(map, length, position, &misc_info)); |
643 | CHECK_RET(fseek(f, misc_info, SEEK_CUR), 0); | 664 | *position += misc_info; |
644 | 665 | ||
645 | CHECK_RET(read_ushort(f, &compressed), 1); | 666 | CHECK_RET(read_ushort(map, length, position, &compressed)); |
646 | 667 | ||
647 | if (head->channels != 1 || head->depth != 8) | 668 | if (head->channels != 1 || head->depth != 8) |
648 | { | 669 | { |
@@ -664,7 +685,7 @@ read_psd_indexed(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | |||
664 | return EINA_FALSE; | 685 | return EINA_FALSE; |
665 | } | 686 | } |
666 | 687 | ||
667 | if (!psd_get_data(ie, head, f, surface, compressed, error)) | 688 | if (!psd_get_data(ie, head, map, length, position, surface, compressed, error)) |
668 | return EINA_FALSE; | 689 | return EINA_FALSE; |
669 | return EINA_TRUE; | 690 | return EINA_TRUE; |
670 | 691 | ||
@@ -672,28 +693,28 @@ read_psd_indexed(Image_Entry *ie, PSD_Header *head, FILE * f, int *error) | |||
672 | } | 693 | } |
673 | 694 | ||
674 | Eina_Bool | 695 | Eina_Bool |
675 | read_psd_rgb(Image_Entry *ie, PSD_Header *head, FILE *f, int *error) | 696 | read_psd_rgb(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) |
676 | { | 697 | { |
677 | unsigned int color_mode, resource_size, misc_info; | 698 | unsigned int color_mode, resource_size, misc_info; |
678 | unsigned short compressed; | 699 | unsigned short compressed; |
679 | unsigned int type; | 700 | unsigned int type; |
680 | void *surface; | 701 | void *surface; |
681 | 702 | ||
682 | #define CHECK_RET(Call, Value) \ | 703 | #define CHECK_RET(Call) \ |
683 | if (Call != Value) return EINA_FALSE; | 704 | if (!Call) return EINA_FALSE; |
684 | 705 | ||
685 | CHECK_RET(read_uint(f, &color_mode), 1); | 706 | CHECK_RET(read_uint(map, length, position, &color_mode)); |
686 | // Skip over the 'color mode data section' | 707 | // Skip over the 'color mode data section' |
687 | CHECK_RET(fseek(f, color_mode, SEEK_CUR), 0); | 708 | *position += color_mode; |
688 | 709 | ||
689 | // Read the 'image resources section' | 710 | // Read the 'image resources section' |
690 | CHECK_RET(read_uint(f, &resource_size), 1); | 711 | CHECK_RET(read_uint(map, length, position, &resource_size)); |
691 | CHECK_RET(fseek(f, resource_size, SEEK_CUR), 0); | 712 | *position += resource_size; |
692 | 713 | ||
693 | CHECK_RET(read_uint(f, &misc_info), 1); | 714 | CHECK_RET(read_uint(map, length, position, &misc_info)); |
694 | CHECK_RET(fseek(f, misc_info, SEEK_CUR), 0); | 715 | *position += misc_info; |
695 | 716 | ||
696 | CHECK_RET(read_ushort(f, &compressed), 1); | 717 | CHECK_RET(read_ushort(map, length, position, &compressed)); |
697 | 718 | ||
698 | head->channel_num = head->channels; | 719 | head->channel_num = head->channels; |
699 | 720 | ||
@@ -722,7 +743,7 @@ read_psd_rgb(Image_Entry *ie, PSD_Header *head, FILE *f, int *error) | |||
722 | goto cleanup_error; | 743 | goto cleanup_error; |
723 | } | 744 | } |
724 | 745 | ||
725 | if (!psd_get_data(ie, head, f, surface, compressed, error)) | 746 | if (!psd_get_data(ie, head, map, length, position, surface, compressed, error)) |
726 | goto cleanup_error; | 747 | goto cleanup_error; |
727 | 748 | ||
728 | evas_common_image_premul(ie); | 749 | evas_common_image_premul(ie); |
@@ -735,7 +756,7 @@ read_psd_rgb(Image_Entry *ie, PSD_Header *head, FILE *f, int *error) | |||
735 | } | 756 | } |
736 | 757 | ||
737 | Eina_Bool | 758 | Eina_Bool |
738 | read_psd_cmyk(Image_Entry *ie, PSD_Header *head, FILE *f, int *error) | 759 | read_psd_cmyk(Image_Entry *ie, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) |
739 | { | 760 | { |
740 | unsigned int color_mode, resource_size, misc_info, size, i, j, data_size; | 761 | unsigned int color_mode, resource_size, misc_info, size, i, j, data_size; |
741 | unsigned short compressed; | 762 | unsigned short compressed; |
@@ -745,21 +766,21 @@ read_psd_cmyk(Image_Entry *ie, PSD_Header *head, FILE *f, int *error) | |||
745 | 766 | ||
746 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 767 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
747 | 768 | ||
748 | #define CHECK_RET(Call, Value) \ | 769 | #define CHECK_RET(Call) \ |
749 | if (Call != Value) return EINA_FALSE; | 770 | if (!Call) return EINA_FALSE; |
750 | 771 | ||
751 | CHECK_RET(read_uint(f, &color_mode), 1); | 772 | CHECK_RET(read_uint(map, length, position, &color_mode)); |
752 | // Skip over the 'color mode data section' | 773 | // Skip over the 'color mode data section' |
753 | CHECK_RET(fseek(f, color_mode, SEEK_CUR), 0); | 774 | *position += color_mode; |
754 | 775 | ||
755 | CHECK_RET(read_uint(f, &resource_size), 1); | 776 | CHECK_RET(read_uint(map, length, position, &resource_size)); |
756 | // Read the 'image resources section' | 777 | // Read the 'image resources section' |
757 | CHECK_RET(fseek(f, resource_size, SEEK_CUR), 0); | 778 | *position += resource_size; |
758 | 779 | ||
759 | CHECK_RET(read_uint(f, &misc_info), 1); | 780 | CHECK_RET(read_uint(map, length, position, &misc_info)); |
760 | CHECK_RET(fseek(f, misc_info, SEEK_CUR), 0); | 781 | *position += misc_info; |
761 | 782 | ||
762 | CHECK_RET(read_ushort(f, &compressed), 1); | 783 | CHECK_RET(read_ushort(map, length, position, &compressed)); |
763 | 784 | ||
764 | switch (head->channels) | 785 | switch (head->channels) |
765 | { | 786 | { |
@@ -804,14 +825,14 @@ read_psd_cmyk(Image_Entry *ie, PSD_Header *head, FILE *f, int *error) | |||
804 | goto cleanup_error; | 825 | goto cleanup_error; |
805 | } | 826 | } |
806 | 827 | ||
807 | if (!psd_get_data(ie, head, f, surface, compressed, error)) | 828 | if (!psd_get_data(ie, head, map, length, position, surface, compressed, error)) |
808 | goto cleanup_error; | 829 | goto cleanup_error; |
809 | 830 | ||
810 | size = type * ie->w * ie->h; | 831 | size = type * ie->w * ie->h; |
811 | kchannel = malloc(size); | 832 | kchannel = malloc(size); |
812 | if (kchannel == NULL) | 833 | if (kchannel == NULL) |
813 | goto cleanup_error; | 834 | goto cleanup_error; |
814 | if (!get_single_channel(ie, head, f, kchannel, compressed)) | 835 | if (!get_single_channel(ie, head, map, length, position, kchannel, compressed)) |
815 | goto cleanup_error; | 836 | goto cleanup_error; |
816 | 837 | ||
817 | data_size = head->channels * type * ie->w * ie->h; | 838 | data_size = head->channels * type * ie->w * ie->h; |
@@ -861,20 +882,34 @@ evas_image_load_file_data_psd(Image_Entry *ie, | |||
861 | const char *key __UNUSED__, | 882 | const char *key __UNUSED__, |
862 | int *error) | 883 | int *error) |
863 | { | 884 | { |
864 | FILE *f; | 885 | Eina_File *f; |
886 | void *map; | ||
887 | size_t length; | ||
888 | size_t position; | ||
865 | PSD_Header header; | 889 | PSD_Header header; |
866 | Eina_Bool bpsd = EINA_FALSE; | 890 | Eina_Bool bpsd = EINA_FALSE; |
867 | 891 | ||
868 | f = fopen(file, "rb"); | 892 | f = eina_file_open(file, 0); |
869 | if (f == NULL) | 893 | if (f == NULL) |
870 | { | 894 | { |
871 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 895 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
872 | return bpsd; | 896 | return bpsd; |
873 | } | 897 | } |
874 | 898 | ||
875 | if (!psd_get_header(&header, f) || !is_psd(&header)) | 899 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); |
900 | length = eina_file_size_get(f); | ||
901 | position = 0; | ||
902 | if (!map || length < 1) | ||
903 | { | ||
904 | eina_file_close(f); | ||
905 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | ||
906 | return EINA_FALSE; | ||
907 | } | ||
908 | |||
909 | if (!psd_get_header(&header, map, length, &position) || !is_psd(&header)) | ||
876 | { | 910 | { |
877 | fclose(f); | 911 | eina_file_map_free(f, map); |
912 | eina_file_close(f); | ||
878 | *error = EVAS_LOAD_ERROR_GENERIC; | 913 | *error = EVAS_LOAD_ERROR_GENERIC; |
879 | return EINA_FALSE; | 914 | return EINA_FALSE; |
880 | } | 915 | } |
@@ -887,39 +922,39 @@ evas_image_load_file_data_psd(Image_Entry *ie, | |||
887 | switch (header.mode) | 922 | switch (header.mode) |
888 | { | 923 | { |
889 | case PSD_GREYSCALE: // Greyscale | 924 | case PSD_GREYSCALE: // Greyscale |
890 | bpsd = read_psd_grey(ie, &header, f, error); | 925 | bpsd = read_psd_grey(ie, &header, map, length, &position, error); |
891 | break; | 926 | break; |
892 | case PSD_INDEXED: // Indexed | 927 | case PSD_INDEXED: // Indexed |
893 | bpsd = read_psd_indexed(ie, &header, f, error); | 928 | bpsd = read_psd_indexed(ie, &header, map, length, &position, error); |
894 | break; | 929 | break; |
895 | case PSD_RGB: // RGB | 930 | case PSD_RGB: // RGB |
896 | bpsd = read_psd_rgb(ie, &header, f, error); | 931 | bpsd = read_psd_rgb(ie, &header, map, length, &position, error); |
897 | break; | 932 | break; |
898 | case PSD_CMYK: // CMYK | 933 | case PSD_CMYK: // CMYK |
899 | bpsd = read_psd_cmyk(ie, &header, f, error); | 934 | bpsd = read_psd_cmyk(ie, &header, map, length, &position, error); |
900 | break; | 935 | break; |
901 | default : | 936 | default : |
902 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 937 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
903 | bpsd = EINA_FALSE; | 938 | bpsd = EINA_FALSE; |
904 | } | 939 | } |
905 | fclose(f); | 940 | |
941 | eina_file_map_free(f, map); | ||
942 | eina_file_close(f); | ||
906 | 943 | ||
907 | return bpsd; | 944 | return bpsd; |
908 | } | 945 | } |
909 | 946 | ||
910 | static Eina_Bool | 947 | static Eina_Bool |
911 | get_compressed_channels_length(PSD_Header *head, | 948 | get_compressed_channels_length(PSD_Header *head, |
912 | FILE * file, | 949 | const unsigned char *map, size_t length, size_t *position, |
913 | unsigned short *rle_table, | 950 | unsigned short *rle_table, |
914 | unsigned int *chanlen) | 951 | unsigned int *chanlen) |
915 | { | 952 | { |
916 | unsigned int j; | 953 | unsigned int j; |
917 | unsigned int c; | 954 | unsigned int c; |
918 | 955 | ||
919 | if (fread(rle_table, | 956 | if (!read_block(map, length, position, rle_table, |
920 | sizeof(unsigned short), | 957 | sizeof (unsigned short) * head->height * head->channel_num)) |
921 | head->height * head->channel_num, | ||
922 | file) != head->height * head->channel_num) | ||
923 | return EINA_FALSE; | 958 | return EINA_FALSE; |
924 | 959 | ||
925 | memset(chanlen, 0, head->channel_num * sizeof(unsigned int)); | 960 | memset(chanlen, 0, head->channel_num * sizeof(unsigned int)); |
@@ -941,7 +976,8 @@ static const Evas_Image_Load_Func evas_image_load_psd_func = { | |||
941 | EINA_TRUE, | 976 | EINA_TRUE, |
942 | evas_image_load_file_head_psd, | 977 | evas_image_load_file_head_psd, |
943 | evas_image_load_file_data_psd, | 978 | evas_image_load_file_data_psd, |
944 | NULL | 979 | NULL, |
980 | EINA_FALSE | ||
945 | }; | 981 | }; |
946 | 982 | ||
947 | static int | 983 | static int |
diff --git a/libraries/evas/src/modules/loaders/svg/Makefile.in b/libraries/evas/src/modules/loaders/svg/Makefile.in index f81a3c3..b742842 100644 --- a/libraries/evas/src/modules/loaders/svg/Makefile.in +++ b/libraries/evas/src/modules/loaders/svg/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/svg/evas_image_load_svg.c b/libraries/evas/src/modules/loaders/svg/evas_image_load_svg.c index f1c8452..dc0fc8d 100644 --- a/libraries/evas/src/modules/loaders/svg/evas_image_load_svg.c +++ b/libraries/evas/src/modules/loaders/svg/evas_image_load_svg.c | |||
@@ -13,7 +13,8 @@ Evas_Image_Load_Func evas_image_load_svg_func = | |||
13 | EINA_FALSE, | 13 | EINA_FALSE, |
14 | evas_image_load_file_head_svg, | 14 | evas_image_load_file_head_svg, |
15 | evas_image_load_file_data_svg, | 15 | evas_image_load_file_data_svg, |
16 | NULL | 16 | NULL, |
17 | EINA_FALSE | ||
17 | }; | 18 | }; |
18 | 19 | ||
19 | static int rsvg_initialized = 0; | 20 | static int rsvg_initialized = 0; |
diff --git a/libraries/evas/src/modules/loaders/tga/Makefile.in b/libraries/evas/src/modules/loaders/tga/Makefile.in index 645c77a..4d822d1 100644 --- a/libraries/evas/src/modules/loaders/tga/Makefile.in +++ b/libraries/evas/src/modules/loaders/tga/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c b/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c index 61b99f6..9b4073c 100644 --- a/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c +++ b/libraries/evas/src/modules/loaders/tga/evas_image_load_tga.c | |||
@@ -65,7 +65,8 @@ static Evas_Image_Load_Func evas_image_load_tga_func = | |||
65 | EINA_TRUE, | 65 | EINA_TRUE, |
66 | evas_image_load_file_head_tga, | 66 | evas_image_load_file_head_tga, |
67 | evas_image_load_file_data_tga, | 67 | evas_image_load_file_data_tga, |
68 | NULL | 68 | NULL, |
69 | EINA_FALSE | ||
69 | }; | 70 | }; |
70 | 71 | ||
71 | static Eina_Bool | 72 | static Eina_Bool |
diff --git a/libraries/evas/src/modules/loaders/tiff/Makefile.in b/libraries/evas/src/modules/loaders/tiff/Makefile.in index a2deea7..2b102a1 100644 --- a/libraries/evas/src/modules/loaders/tiff/Makefile.in +++ b/libraries/evas/src/modules/loaders/tiff/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/tiff/evas_image_load_tiff.c b/libraries/evas/src/modules/loaders/tiff/evas_image_load_tiff.c index b9bea91..e17d5a6 100644 --- a/libraries/evas/src/modules/loaders/tiff/evas_image_load_tiff.c +++ b/libraries/evas/src/modules/loaders/tiff/evas_image_load_tiff.c | |||
@@ -34,7 +34,8 @@ static Evas_Image_Load_Func evas_image_load_tiff_func = | |||
34 | EINA_TRUE, | 34 | EINA_TRUE, |
35 | evas_image_load_file_head_tiff, | 35 | evas_image_load_file_head_tiff, |
36 | evas_image_load_file_data_tiff, | 36 | evas_image_load_file_data_tiff, |
37 | NULL | 37 | NULL, |
38 | EINA_FALSE | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | typedef struct TIFFRGBAImage_Extra TIFFRGBAImage_Extra; | 41 | typedef struct TIFFRGBAImage_Extra TIFFRGBAImage_Extra; |
diff --git a/libraries/evas/src/modules/loaders/wbmp/Makefile.in b/libraries/evas/src/modules/loaders/wbmp/Makefile.in index 41a3bb9..5c01e1c 100644 --- a/libraries/evas/src/modules/loaders/wbmp/Makefile.in +++ b/libraries/evas/src/modules/loaders/wbmp/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/wbmp/evas_image_load_wbmp.c b/libraries/evas/src/modules/loaders/wbmp/evas_image_load_wbmp.c index fa6fab2..54e28d5 100644 --- a/libraries/evas/src/modules/loaders/wbmp/evas_image_load_wbmp.c +++ b/libraries/evas/src/modules/loaders/wbmp/evas_image_load_wbmp.c | |||
@@ -19,21 +19,22 @@ static Evas_Image_Load_Func evas_image_load_wbmp_func = | |||
19 | EINA_TRUE, | 19 | EINA_TRUE, |
20 | evas_image_load_file_head_wbmp, | 20 | evas_image_load_file_head_wbmp, |
21 | evas_image_load_file_data_wbmp, | 21 | evas_image_load_file_data_wbmp, |
22 | NULL | 22 | NULL, |
23 | EINA_FALSE | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | 26 | ||
26 | static int | 27 | static int |
27 | read_mb(unsigned int *data, FILE *f) | 28 | read_mb(unsigned int *data, void *map, size_t length, size_t *position) |
28 | { | 29 | { |
29 | int ac = 0, ct; | 30 | int ac = 0, ct; |
30 | unsigned char buf; | 31 | unsigned char buf; |
31 | 32 | ||
32 | for (ct = 0;;) | 33 | for (ct = 0;;) |
33 | { | 34 | { |
34 | if ((ct++) == 5) return -1; | 35 | if ((ct++) == 5) return -1; |
35 | if ((fread(&buf, 1, 1, f)) < 1) | 36 | if (*position > length) return -1; |
36 | return -1; | 37 | buf = ((unsigned char *) map)[(*position)++]; |
37 | ac = (ac << 7) | (buf & 0x7f); | 38 | ac = (ac << 7) | (buf & 0x7f); |
38 | if ((buf & 0x80) == 0) break; | 39 | if ((buf & 0x80) == 0) break; |
39 | } | 40 | } |
@@ -44,70 +45,105 @@ read_mb(unsigned int *data, FILE *f) | |||
44 | static Eina_Bool | 45 | static Eina_Bool |
45 | evas_image_load_file_head_wbmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) | 46 | evas_image_load_file_head_wbmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) |
46 | { | 47 | { |
47 | FILE *f; | 48 | Eina_File *f; |
49 | void *map = NULL; | ||
50 | size_t position = 0; | ||
51 | size_t length; | ||
48 | unsigned int type, w, h; | 52 | unsigned int type, w, h; |
49 | unsigned char fixed_header; | 53 | |
50 | struct stat statbuf; | ||
51 | |||
52 | *error = EVAS_LOAD_ERROR_GENERIC; | 54 | *error = EVAS_LOAD_ERROR_GENERIC; |
53 | f = fopen(file, "rb"); | 55 | f = eina_file_open(file, 0); |
54 | if (!f) | 56 | if (!f) |
55 | { | 57 | { |
56 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 58 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
57 | return EINA_FALSE; | 59 | return EINA_FALSE; |
58 | } | 60 | } |
59 | 61 | ||
60 | if (stat(file, &statbuf) == -1) goto bail; | 62 | length = eina_file_size_get(f); |
61 | if (read_mb(&type, f) < 0) goto bail; | 63 | if (length <= 4) goto bail; |
62 | 64 | ||
65 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); | ||
66 | if (!map) goto bail; | ||
67 | |||
68 | if (read_mb(&type, map, length, &position) < 0) goto bail; | ||
69 | |||
63 | if (type != 0) | 70 | if (type != 0) |
64 | { | 71 | { |
65 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 72 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
66 | goto bail; | 73 | goto bail; |
67 | } | 74 | } |
68 | 75 | ||
69 | if (fread(&fixed_header, 1, 1, f) != 1) goto bail; | 76 | position++; /* skipping one byte */ |
70 | if (read_mb(&w, f) < 0) goto bail; | 77 | if (read_mb(&w, map, length, &position) < 0) goto bail; |
71 | if (read_mb(&h, f) < 0) goto bail; | 78 | if (read_mb(&h, map, length, &position) < 0) goto bail; |
72 | if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) || | 79 | if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) || |
73 | IMG_TOO_BIG(w, h)) | 80 | IMG_TOO_BIG(w, h)) |
74 | { | 81 | { |
75 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 82 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
76 | goto bail; | 83 | goto bail; |
77 | } | 84 | } |
78 | 85 | ||
79 | fclose(f); | 86 | eina_file_map_free(f, map); |
87 | eina_file_close(f); | ||
80 | ie->w = w; | 88 | ie->w = w; |
81 | ie->h = h; | 89 | ie->h = h; |
82 | 90 | ||
83 | *error = EVAS_LOAD_ERROR_NONE; | 91 | *error = EVAS_LOAD_ERROR_NONE; |
84 | return EINA_TRUE; | 92 | return EINA_TRUE; |
85 | bail: | 93 | bail: |
86 | fclose(f); | 94 | if (map) eina_file_map_free(f, map); |
95 | eina_file_close(f); | ||
87 | return EINA_FALSE; | 96 | return EINA_FALSE; |
88 | } | 97 | } |
89 | 98 | ||
90 | static Eina_Bool | 99 | static Eina_Bool |
91 | evas_image_load_file_data_wbmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) | 100 | evas_image_load_file_data_wbmp(Image_Entry *ie, const char *file, const char *key __UNUSED__, int *error) |
92 | { | 101 | { |
93 | FILE *f; | 102 | Eina_File *f; |
94 | unsigned int dummy, line_length; | 103 | void *map = NULL; |
104 | size_t position = 0; | ||
105 | size_t length; | ||
106 | unsigned int type, w, h; | ||
107 | unsigned int line_length; | ||
95 | unsigned char *line = NULL; | 108 | unsigned char *line = NULL; |
96 | int cur = 0, x, y; | 109 | int cur = 0, x, y; |
97 | DATA32 *dst_data; | 110 | DATA32 *dst_data; |
98 | 111 | ||
99 | *error = EVAS_LOAD_ERROR_GENERIC; | 112 | *error = EVAS_LOAD_ERROR_GENERIC; |
100 | f = fopen(file, "rb"); | 113 | f = eina_file_open(file, EINA_FALSE); |
101 | if (!f) | 114 | if (!f) |
102 | { | 115 | { |
103 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 116 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
104 | return EINA_FALSE; | 117 | return EINA_FALSE; |
105 | } | 118 | } |
106 | if (read_mb(&dummy, f) < 0) goto bail; | 119 | |
107 | if (fread(&dummy, 1, 1, f) != 1) goto bail; | 120 | length = eina_file_size_get(f); |
108 | if (read_mb(&dummy, f) < 0) goto bail; | 121 | if (length <= 4) goto bail; |
109 | if (read_mb(&dummy, f) < 0) goto bail; | 122 | |
110 | 123 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); | |
124 | if (!map) goto bail; | ||
125 | |||
126 | if (read_mb(&type, map, length, &position) < 0) goto bail; | ||
127 | position++; /* skipping one byte */ | ||
128 | if (read_mb(&w, map, length, &position) < 0) goto bail; | ||
129 | if (read_mb(&h, map, length, &position) < 0) goto bail; | ||
130 | |||
131 | if (type != 0) | ||
132 | { | ||
133 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | ||
134 | goto bail; | ||
135 | } | ||
136 | |||
137 | if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) || | ||
138 | IMG_TOO_BIG(w, h)) | ||
139 | { | ||
140 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | ||
141 | goto bail; | ||
142 | } | ||
143 | |||
144 | ie->w = w; | ||
145 | ie->h = h; | ||
146 | |||
111 | evas_cache_image_surface_alloc(ie, ie->w, ie->h); | 147 | evas_cache_image_surface_alloc(ie, ie->w, ie->h); |
112 | dst_data = evas_cache_image_pixels(ie); | 148 | dst_data = evas_cache_image_pixels(ie); |
113 | if (!dst_data) | 149 | if (!dst_data) |
@@ -115,13 +151,14 @@ evas_image_load_file_data_wbmp(Image_Entry *ie, const char *file, const char *ke | |||
115 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 151 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
116 | goto bail; | 152 | goto bail; |
117 | } | 153 | } |
118 | 154 | ||
119 | line_length = (ie->w + 7) >> 3; | 155 | line_length = (ie->w + 7) >> 3; |
120 | line = alloca(line_length); | 156 | |
121 | |||
122 | for (y = 0; y < (int)ie->h; y++) | 157 | for (y = 0; y < (int)ie->h; y++) |
123 | { | 158 | { |
124 | if (fread(line, 1, line_length, f) != line_length) goto bail; | 159 | if (position + line_length > length) goto bail; |
160 | line = ((unsigned char*) map) + position; | ||
161 | position += line_length; | ||
125 | for (x = 0; x < (int)ie->w; x++) | 162 | for (x = 0; x < (int)ie->w; x++) |
126 | { | 163 | { |
127 | int idx = x >> 3; | 164 | int idx = x >> 3; |
@@ -131,11 +168,13 @@ evas_image_load_file_data_wbmp(Image_Entry *ie, const char *file, const char *ke | |||
131 | cur++; | 168 | cur++; |
132 | } | 169 | } |
133 | } | 170 | } |
134 | fclose(f); | 171 | eina_file_map_free(f, map); |
172 | eina_file_close(f); | ||
135 | *error = EVAS_LOAD_ERROR_NONE; | 173 | *error = EVAS_LOAD_ERROR_NONE; |
136 | return EINA_TRUE; | 174 | return EINA_TRUE; |
137 | bail: | 175 | bail: |
138 | fclose(f); | 176 | if (map) eina_file_map_free(f, map); |
177 | eina_file_close(f); | ||
139 | return EINA_FALSE; | 178 | return EINA_FALSE; |
140 | } | 179 | } |
141 | 180 | ||
diff --git a/libraries/evas/src/modules/loaders/xpm/Makefile.in b/libraries/evas/src/modules/loaders/xpm/Makefile.in index eba8f60..6383d9e 100644 --- a/libraries/evas/src/modules/loaders/xpm/Makefile.in +++ b/libraries/evas/src/modules/loaders/xpm/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/loaders/xpm/evas_image_load_xpm.c b/libraries/evas/src/modules/loaders/xpm/evas_image_load_xpm.c index 3a04f84..c764f6d 100644 --- a/libraries/evas/src/modules/loaders/xpm/evas_image_load_xpm.c +++ b/libraries/evas/src/modules/loaders/xpm/evas_image_load_xpm.c | |||
@@ -24,16 +24,20 @@ static Evas_Image_Load_Func evas_image_load_xpm_func = | |||
24 | EINA_FALSE, | 24 | EINA_FALSE, |
25 | evas_image_load_file_head_xpm, | 25 | evas_image_load_file_head_xpm, |
26 | evas_image_load_file_data_xpm, | 26 | evas_image_load_file_data_xpm, |
27 | NULL | 27 | NULL, |
28 | EINA_FALSE | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | // TODO: REWRITE THIS WITH THREAD SAFE VERSION NOT USING THIS HANDLE!!!! | 31 | static Eina_File *rgb_txt; |
31 | static FILE *rgb_txt = NULL; | 32 | static void *rgb_txt_map; |
32 | 33 | ||
33 | static void | 34 | static void |
34 | xpm_parse_color(char *color, int *r, int *g, int *b) | 35 | xpm_parse_color(char *color, int *r, int *g, int *b) |
35 | { | 36 | { |
36 | char buf[4096]; | 37 | char *tmp; |
38 | char *max; | ||
39 | char *endline; | ||
40 | char buf[4096]; | ||
37 | 41 | ||
38 | /* is a #ff00ff like color */ | 42 | /* is a #ff00ff like color */ |
39 | if (color[0] == '#') | 43 | if (color[0] == '#') |
@@ -75,20 +79,23 @@ xpm_parse_color(char *color, int *r, int *g, int *b) | |||
75 | return; | 79 | return; |
76 | } | 80 | } |
77 | /* look in rgb txt database */ | 81 | /* look in rgb txt database */ |
78 | if (!rgb_txt) rgb_txt = fopen("/usr/lib/X11/rgb.txt", "r"); | ||
79 | if (!rgb_txt) rgb_txt = fopen("/usr/X11/lib/X11/rgb.txt", "r"); | ||
80 | if (!rgb_txt) rgb_txt = fopen("/usr/X11R6/lib/X11/rgb.txt", "r"); | ||
81 | if (!rgb_txt) rgb_txt = fopen("/usr/openwin/lib/X11/rgb.txt", "r"); | ||
82 | if (!rgb_txt) return; | 82 | if (!rgb_txt) return; |
83 | fseek(rgb_txt, 0, SEEK_SET); | 83 | tmp = rgb_txt_map; |
84 | while (fgets(buf, sizeof(buf), rgb_txt)) | 84 | max = tmp + eina_file_size_get(rgb_txt); |
85 | |||
86 | while (tmp < max) | ||
85 | { | 87 | { |
86 | buf[sizeof(buf) - 1] = 0; | 88 | endline = memchr(tmp, '\n', max - tmp); |
87 | if (buf[0] != '!') | 89 | if (!endline) endline = max; |
90 | if ((*tmp != '!') && ((endline - tmp) < (int) (sizeof(buf) - 1))) | ||
88 | { | 91 | { |
89 | int rr, gg, bb; | 92 | int rr, gg, bb; |
90 | char name[4096]; | 93 | char name[4096]; |
91 | 94 | ||
95 | /* FIXME: not really efficient */ | ||
96 | memcpy(buf, tmp, endline - tmp); | ||
97 | buf[endline - tmp + 1] = '\0'; | ||
98 | |||
92 | if (sscanf(buf, "%i %i %i %[^\n]", &rr, &gg, &bb, name) == 4) | 99 | if (sscanf(buf, "%i %i %i %[^\n]", &rr, &gg, &bb, name) == 4) |
93 | { | 100 | { |
94 | if (!strcasecmp(name, color)) | 101 | if (!strcasecmp(name, color)) |
@@ -100,33 +107,30 @@ xpm_parse_color(char *color, int *r, int *g, int *b) | |||
100 | } | 107 | } |
101 | } | 108 | } |
102 | } | 109 | } |
110 | tmp = endline + 1; | ||
103 | } | 111 | } |
104 | } | 112 | } |
105 | 113 | ||
106 | static void | ||
107 | xpm_parse_done(void) | ||
108 | { | ||
109 | if (rgb_txt) fclose(rgb_txt); | ||
110 | rgb_txt = NULL; | ||
111 | } | ||
112 | |||
113 | |||
114 | /** FIXME: clean this up and make more efficient **/ | 114 | /** FIXME: clean this up and make more efficient **/ |
115 | static Eina_Bool | 115 | static Eina_Bool |
116 | evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UNUSED__, int load_data, int *error) | 116 | evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UNUSED__, int load_data, int *error) |
117 | { | 117 | { |
118 | DATA32 *ptr, *end; | 118 | DATA32 *ptr, *end; |
119 | FILE *f; | 119 | Eina_File *f; |
120 | const char *map; | ||
121 | size_t length; | ||
122 | size_t position; | ||
120 | 123 | ||
121 | int pc, c, i, j, k, w, h, ncolors, cpp, comment, transp, | 124 | int pc, c, i, j, k, w, h, ncolors, cpp, comment, transp, |
122 | quote, context, len, done, r, g, b, backslash, lu1, lu2; | 125 | quote, context, len, done, r, g, b, backslash, lu1, lu2; |
123 | char *line, s[256], tok[128], col[256], *tl; | 126 | char *line = NULL; |
127 | char s[256], tok[128], col[256], *tl; | ||
124 | int lsz = 256; | 128 | int lsz = 256; |
125 | struct _cmap { | 129 | struct _cmap { |
126 | char str[6]; | 130 | char str[6]; |
127 | unsigned char transp; | 131 | unsigned char transp; |
128 | short r, g, b; | 132 | short r, g, b; |
129 | } *cmap; | 133 | } *cmap = NULL; |
130 | 134 | ||
131 | short lookup[128 - 32][128 - 32]; | 135 | short lookup[128 - 32][128 - 32]; |
132 | int count, pixels; | 136 | int count, pixels; |
@@ -138,30 +142,39 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN | |||
138 | /* if immediate_load is 1, then dont delay image laoding as below, or */ | 142 | /* if immediate_load is 1, then dont delay image laoding as below, or */ |
139 | /* already data in this image - dont load it again */ | 143 | /* already data in this image - dont load it again */ |
140 | 144 | ||
141 | f = fopen(file, "rb"); | 145 | f = eina_file_open(file, 0); |
142 | if (!f) | 146 | if (!f) |
143 | { | 147 | { |
144 | xpm_parse_done(); | 148 | ERR("XPM ERROR: file failed to open"); |
145 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; | 149 | *error = EVAS_LOAD_ERROR_DOES_NOT_EXIST; |
146 | return EINA_FALSE; | 150 | return EINA_FALSE; |
147 | } | 151 | } |
148 | if (fread(s, 9, 1, f) != 1) | 152 | length = eina_file_size_get(f); |
153 | position = 0; | ||
154 | if (length < 9) | ||
149 | { | 155 | { |
150 | fclose(f); | 156 | ERR("XPM ERROR: file size, %i, is to small", length); |
151 | xpm_parse_done(); | 157 | eina_file_close(f); |
152 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 158 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
153 | return EINA_FALSE; | 159 | return EINA_FALSE; |
154 | } | 160 | } |
155 | rewind(f); | 161 | |
156 | s[9] = 0; | 162 | map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); |
157 | if (strcmp("/* XPM */", s)) | 163 | if (!map) |
158 | { | 164 | { |
159 | fclose(f); | 165 | ERR("XPM ERROR: file failed to mmap"); |
160 | xpm_parse_done(); | 166 | eina_file_close(f); |
161 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 167 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
162 | return EINA_FALSE; | 168 | return EINA_FALSE; |
163 | } | 169 | } |
164 | 170 | ||
171 | if (strncmp("/* XPM */", map, 9)) | ||
172 | { | ||
173 | ERR("XPM ERROR: header not found"); | ||
174 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | ||
175 | goto on_error; | ||
176 | } | ||
177 | |||
165 | i = 0; | 178 | i = 0; |
166 | j = 0; | 179 | j = 0; |
167 | cmap = NULL; | 180 | cmap = NULL; |
@@ -178,10 +191,8 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN | |||
178 | line = malloc(lsz); | 191 | line = malloc(lsz); |
179 | if (!line) | 192 | if (!line) |
180 | { | 193 | { |
181 | fclose(f); | ||
182 | xpm_parse_done(); | ||
183 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 194 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
184 | return EINA_FALSE; | 195 | goto on_error; |
185 | } | 196 | } |
186 | 197 | ||
187 | backslash = 0; | 198 | backslash = 0; |
@@ -189,8 +200,8 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN | |||
189 | while (!done) | 200 | while (!done) |
190 | { | 201 | { |
191 | pc = c; | 202 | pc = c; |
192 | c = fgetc(f); | 203 | if (position == length) break ; |
193 | if (c == EOF) break; | 204 | c = (char) map[position++]; |
194 | if (!quote) | 205 | if (!quote) |
195 | { | 206 | { |
196 | if ((pc == '/') && (c == '*')) | 207 | if ((pc == '/') && (c == '*')) |
@@ -215,56 +226,38 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN | |||
215 | if (sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp) != 4) | 226 | if (sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp) != 4) |
216 | { | 227 | { |
217 | ERR("XPM ERROR: XPM file malformed header"); | 228 | ERR("XPM ERROR: XPM file malformed header"); |
218 | free(line); | ||
219 | fclose(f); | ||
220 | xpm_parse_done(); | ||
221 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; | 229 | *error = EVAS_LOAD_ERROR_CORRUPT_FILE; |
222 | return EINA_FALSE; | 230 | goto on_error; |
223 | } | 231 | } |
224 | if ((ncolors > 32766) || (ncolors < 1)) | 232 | if ((ncolors > 32766) || (ncolors < 1)) |
225 | { | 233 | { |
226 | ERR("XPM ERROR: XPM files with colors > 32766 or < 1 not supported"); | 234 | ERR("XPM ERROR: XPM files with colors > 32766 or < 1 not supported"); |
227 | free(line); | ||
228 | fclose(f); | ||
229 | xpm_parse_done(); | ||
230 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 235 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
231 | return EINA_FALSE; | 236 | goto on_error; |
232 | } | 237 | } |
233 | if ((cpp > 5) || (cpp < 1)) | 238 | if ((cpp > 5) || (cpp < 1)) |
234 | { | 239 | { |
235 | ERR("XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported"); | 240 | ERR("XPM ERROR: XPM files with characters per pixel > 5 or < 1not supported"); |
236 | free(line); | ||
237 | fclose(f); | ||
238 | xpm_parse_done(); | ||
239 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; | 241 | *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; |
240 | return EINA_FALSE; | 242 | goto on_error; |
241 | } | 243 | } |
242 | if ((w > IMG_MAX_SIZE) || (w < 1)) | 244 | if ((w > IMG_MAX_SIZE) || (w < 1)) |
243 | { | 245 | { |
244 | ERR("XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file"); | 246 | ERR("XPM ERROR: Image width > IMG_MAX_SIZE or < 1 pixels for file"); |
245 | free(line); | ||
246 | fclose(f); | ||
247 | xpm_parse_done(); | ||
248 | *error = EVAS_LOAD_ERROR_GENERIC; | 247 | *error = EVAS_LOAD_ERROR_GENERIC; |
249 | return EINA_FALSE; | 248 | goto on_error; |
250 | } | 249 | } |
251 | if ((h > IMG_MAX_SIZE) || (h < 1)) | 250 | if ((h > IMG_MAX_SIZE) || (h < 1)) |
252 | { | 251 | { |
253 | ERR("XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file"); | 252 | ERR("XPM ERROR: Image height > IMG_MAX_SIZE or < 1 pixels for file"); |
254 | free(line); | ||
255 | fclose(f); | ||
256 | xpm_parse_done(); | ||
257 | *error = EVAS_LOAD_ERROR_GENERIC; | 253 | *error = EVAS_LOAD_ERROR_GENERIC; |
258 | return EINA_FALSE; | 254 | goto on_error; |
259 | } | 255 | } |
260 | if (IMG_TOO_BIG(w, h)) | 256 | if (IMG_TOO_BIG(w, h)) |
261 | { | 257 | { |
262 | ERR("XPM ERROR: Image just too big to ever allocate"); | 258 | ERR("XPM ERROR: Image just too big to ever allocate"); |
263 | free(line); | ||
264 | fclose(f); | ||
265 | xpm_parse_done(); | ||
266 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 259 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
267 | return EINA_FALSE; | 260 | goto on_error; |
268 | } | 261 | } |
269 | 262 | ||
270 | if (!cmap) | 263 | if (!cmap) |
@@ -272,11 +265,8 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN | |||
272 | cmap = malloc(sizeof(struct _cmap) * ncolors); | 265 | cmap = malloc(sizeof(struct _cmap) * ncolors); |
273 | if (!cmap) | 266 | if (!cmap) |
274 | { | 267 | { |
275 | free(line); | ||
276 | fclose(f); | ||
277 | xpm_parse_done(); | ||
278 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 268 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
279 | return EINA_FALSE; | 269 | goto on_error; |
280 | } | 270 | } |
281 | } | 271 | } |
282 | ie->w = w; | 272 | ie->w = w; |
@@ -398,24 +388,16 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN | |||
398 | ptr = evas_cache_image_pixels(ie); | 388 | ptr = evas_cache_image_pixels(ie); |
399 | if (!ptr) | 389 | if (!ptr) |
400 | { | 390 | { |
401 | free(cmap); | ||
402 | free(line); | ||
403 | fclose(f); | ||
404 | xpm_parse_done(); | ||
405 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; | 391 | *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED; |
406 | return EINA_FALSE; | 392 | goto on_error; |
407 | } | 393 | } |
408 | pixels = w * h; | 394 | pixels = w * h; |
409 | end = ptr + pixels; | 395 | end = ptr + pixels; |
410 | } | 396 | } |
411 | else | 397 | else |
412 | { | 398 | { |
413 | free(cmap); | ||
414 | free(line); | ||
415 | fclose(f); | ||
416 | xpm_parse_done(); | ||
417 | *error = EVAS_LOAD_ERROR_NONE; | 399 | *error = EVAS_LOAD_ERROR_NONE; |
418 | return EINA_TRUE; | 400 | goto on_success; |
419 | } | 401 | } |
420 | } | 402 | } |
421 | else | 403 | else |
@@ -631,13 +613,21 @@ evas_image_load_file_xpm(Image_Entry *ie, const char *file, const char *key __UN | |||
631 | break; | 613 | break; |
632 | } | 614 | } |
633 | 615 | ||
616 | on_success: | ||
634 | free(cmap); | 617 | free(cmap); |
635 | free(line); | 618 | free(line); |
636 | fclose(f); | ||
637 | 619 | ||
638 | xpm_parse_done(); | 620 | eina_file_map_free(f, (void*) map); |
621 | eina_file_close(f); | ||
622 | |||
639 | *error = EVAS_LOAD_ERROR_NONE; | 623 | *error = EVAS_LOAD_ERROR_NONE; |
640 | return EINA_TRUE; | 624 | return EINA_TRUE; |
625 | |||
626 | on_error: | ||
627 | free(line); | ||
628 | eina_file_map_free(f, (void*) map); | ||
629 | eina_file_close(f); | ||
630 | return EINA_FALSE; | ||
641 | } | 631 | } |
642 | 632 | ||
643 | static Eina_Bool | 633 | static Eina_Bool |
@@ -663,6 +653,14 @@ module_open(Evas_Module *em) | |||
663 | EINA_LOG_ERR("Can not create a module log domain."); | 653 | EINA_LOG_ERR("Can not create a module log domain."); |
664 | return 0; | 654 | return 0; |
665 | } | 655 | } |
656 | |||
657 | /* Shouldn't we make that PATH configurable ? */ | ||
658 | rgb_txt = eina_file_open("/usr/lib/X11/rgb.txt", 0); | ||
659 | if (!rgb_txt) rgb_txt = eina_file_open("/usr/X11/lib/X11/rgb.txt", 0); | ||
660 | if (!rgb_txt) rgb_txt = eina_file_open("/usr/X11R6/lib/X11/rgb.txt", 0); | ||
661 | if (!rgb_txt) rgb_txt = eina_file_open("/usr/openwin/lib/X11/rgb.txt", 0); | ||
662 | if (rgb_txt) | ||
663 | rgb_txt_map = eina_file_map_all(rgb_txt, EINA_FILE_SEQUENTIAL); | ||
666 | em->functions = (void *)(&evas_image_load_xpm_func); | 664 | em->functions = (void *)(&evas_image_load_xpm_func); |
667 | return 1; | 665 | return 1; |
668 | } | 666 | } |
@@ -670,6 +668,12 @@ module_open(Evas_Module *em) | |||
670 | static void | 668 | static void |
671 | module_close(Evas_Module *em __UNUSED__) | 669 | module_close(Evas_Module *em __UNUSED__) |
672 | { | 670 | { |
671 | if (rgb_txt) | ||
672 | { | ||
673 | eina_file_map_free(rgb_txt, rgb_txt_map); | ||
674 | eina_file_close(rgb_txt); | ||
675 | rgb_txt = NULL; | ||
676 | } | ||
673 | eina_log_domain_unregister(_evas_loader_xpm_log_dom); | 677 | eina_log_domain_unregister(_evas_loader_xpm_log_dom); |
674 | } | 678 | } |
675 | 679 | ||
diff --git a/libraries/evas/src/modules/savers/Makefile.in b/libraries/evas/src/modules/savers/Makefile.in index 6d64b4c..28236d9 100644 --- a/libraries/evas/src/modules/savers/Makefile.in +++ b/libraries/evas/src/modules/savers/Makefile.in | |||
@@ -211,8 +211,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
211 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 211 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
212 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 212 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
213 | PKG_CONFIG = @PKG_CONFIG@ | 213 | PKG_CONFIG = @PKG_CONFIG@ |
214 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
215 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
216 | PNG_CFLAGS = @PNG_CFLAGS@ | 214 | PNG_CFLAGS = @PNG_CFLAGS@ |
217 | PNG_LIBS = @PNG_LIBS@ | 215 | PNG_LIBS = @PNG_LIBS@ |
218 | RANLIB = @RANLIB@ | 216 | RANLIB = @RANLIB@ |
@@ -229,6 +227,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
229 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 227 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
230 | VERSION = @VERSION@ | 228 | VERSION = @VERSION@ |
231 | VMAJ = @VMAJ@ | 229 | VMAJ = @VMAJ@ |
230 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
231 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
232 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 232 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
233 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 233 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
234 | XCB_CFLAGS = @XCB_CFLAGS@ | 234 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -310,6 +310,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
310 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 310 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
311 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 311 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
312 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 312 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
313 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
314 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
315 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
316 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
313 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 317 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
314 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 318 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
315 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 319 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/savers/edb/Makefile.in b/libraries/evas/src/modules/savers/edb/Makefile.in index e319b56..2ed29ec 100644 --- a/libraries/evas/src/modules/savers/edb/Makefile.in +++ b/libraries/evas/src/modules/savers/edb/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/savers/eet/Makefile.in b/libraries/evas/src/modules/savers/eet/Makefile.in index c80e946..6564c18 100644 --- a/libraries/evas/src/modules/savers/eet/Makefile.in +++ b/libraries/evas/src/modules/savers/eet/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/savers/jpeg/Makefile.in b/libraries/evas/src/modules/savers/jpeg/Makefile.in index 3c1bd8b..e57c4f9 100644 --- a/libraries/evas/src/modules/savers/jpeg/Makefile.in +++ b/libraries/evas/src/modules/savers/jpeg/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/savers/png/Makefile.in b/libraries/evas/src/modules/savers/png/Makefile.in index 3b905a5..da04ff2 100644 --- a/libraries/evas/src/modules/savers/png/Makefile.in +++ b/libraries/evas/src/modules/savers/png/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/modules/savers/tiff/Makefile.in b/libraries/evas/src/modules/savers/tiff/Makefile.in index 27acddd..8f4411f 100644 --- a/libraries/evas/src/modules/savers/tiff/Makefile.in +++ b/libraries/evas/src/modules/savers/tiff/Makefile.in | |||
@@ -231,8 +231,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 231 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
232 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 232 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
233 | PKG_CONFIG = @PKG_CONFIG@ | 233 | PKG_CONFIG = @PKG_CONFIG@ |
234 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
235 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
236 | PNG_CFLAGS = @PNG_CFLAGS@ | 234 | PNG_CFLAGS = @PNG_CFLAGS@ |
237 | PNG_LIBS = @PNG_LIBS@ | 235 | PNG_LIBS = @PNG_LIBS@ |
238 | RANLIB = @RANLIB@ | 236 | RANLIB = @RANLIB@ |
@@ -249,6 +247,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
249 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 247 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
250 | VERSION = @VERSION@ | 248 | VERSION = @VERSION@ |
251 | VMAJ = @VMAJ@ | 249 | VMAJ = @VMAJ@ |
250 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
251 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
252 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 252 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 253 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
254 | XCB_CFLAGS = @XCB_CFLAGS@ | 254 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -330,6 +330,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 330 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 331 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 332 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
333 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
334 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
335 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
336 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
333 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 337 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
334 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 338 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
335 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 339 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |