From c963d75dfdeec11f82e79e727062fbf89afa2c04 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Apr 2012 09:19:23 +1000 Subject: Update EFL to latest beta. --- .../evas/src/modules/loaders/jpeg/Makefile.am | 5 +- .../evas/src/modules/loaders/jpeg/Makefile.in | 12 ++- .../modules/loaders/jpeg/evas_image_load_jpeg.c | 85 ++++++++++++---------- 3 files changed, 53 insertions(+), 49 deletions(-) (limited to 'libraries/evas/src/modules/loaders/jpeg') diff --git a/libraries/evas/src/modules/loaders/jpeg/Makefile.am b/libraries/evas/src/modules/loaders/jpeg/Makefile.am index 2088ba8..a7a19ab 100644 --- a/libraries/evas/src/modules/loaders/jpeg/Makefile.am +++ b/libraries/evas/src/modules/loaders/jpeg/Makefile.am @@ -9,10 +9,7 @@ AM_CPPFLAGS = \ @PIXMAN_CFLAGS@ \ @EINA_CFLAGS@ \ @evas_image_loader_jpeg_cflags@ \ -@EVIL_CFLAGS@ \ -@WIN32_CPPFLAGS@ - -AM_CFLAGS = @WIN32_CFLAGS@ +@EVIL_CFLAGS@ if BUILD_LOADER_JPEG if !EVAS_STATIC_BUILD_JPEG diff --git a/libraries/evas/src/modules/loaders/jpeg/Makefile.in b/libraries/evas/src/modules/loaders/jpeg/Makefile.in index 7c0ca18..4945f85 100644 --- a/libraries/evas/src/modules/loaders/jpeg/Makefile.in +++ b/libraries/evas/src/modules/loaders/jpeg/Makefile.in @@ -181,6 +181,8 @@ EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ @@ -231,6 +233,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PNG_CFLAGS = @PNG_CFLAGS@ PNG_LIBS = @PNG_LIBS@ RANLIB = @RANLIB@ @@ -249,8 +253,6 @@ VERSION = @VERSION@ VMAJ = @VMAJ@ WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ -WIN32_CFLAGS = @WIN32_CFLAGS@ -WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ XCB_CFLAGS = @XCB_CFLAGS@ XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ XCB_GL_LIBS = @XCB_GL_LIBS@ @@ -324,8 +326,6 @@ evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ -evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ -evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ @@ -417,10 +417,8 @@ AM_CPPFLAGS = \ @PIXMAN_CFLAGS@ \ @EINA_CFLAGS@ \ @evas_image_loader_jpeg_cflags@ \ -@EVIL_CFLAGS@ \ -@WIN32_CPPFLAGS@ +@EVIL_CFLAGS@ -AM_CFLAGS = @WIN32_CFLAGS@ @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@pkgdir = $(libdir)/evas/modules/loaders/jpeg/$(MODULE_ARCH) @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@pkg_LTLIBRARIES = module.la @BUILD_LOADER_JPEG_TRUE@@EVAS_STATIC_BUILD_JPEG_FALSE@module_la_SOURCES = evas_image_load_jpeg.c 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 797c76d..73a7310 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 @@ -272,7 +272,7 @@ evas_image_load_file_head_jpeg_internal(Image_Entry *ie, *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT; return EINA_FALSE; } - jpeg_create_decompress(&cinfo); + jpeg_create_decompress(&cinfo); if (_evas_jpeg_membuf_src(&cinfo, map, length)) { @@ -508,11 +508,11 @@ evas_image_load_file_data_jpeg_internal(Image_Entry *ie, unsigned int x, y, l, i, scans; int region = 0; /* rotation setting */ - unsigned int tmp; + unsigned int ie_w = 0, ie_h = 0; unsigned int load_region_x = 0, load_region_y = 0; unsigned int load_region_w = 0, load_region_h = 0; - int degree = 0; - Eina_Bool change_wh = EINA_FALSE; + volatile int degree = 0; + volatile Eina_Bool change_wh = EINA_FALSE; Eina_Bool line_done = EINA_FALSE; if (ie->flags.rotated) @@ -582,9 +582,13 @@ evas_image_load_file_data_jpeg_internal(Image_Entry *ie, if (change_wh) { - tmp = ie->w; - ie->w = ie->h; - ie->h = tmp; + ie_w = ie->h; + ie_h = ie->w; + } + else + { + ie_w = ie->w; + ie_h = ie->h; } if ((ie->load_opts.region.w > 0) && (ie->load_opts.region.h > 0)) @@ -629,20 +633,31 @@ evas_image_load_file_data_jpeg_internal(Image_Entry *ie, cinfo.region_h = ie->load_opts.region.h; #endif } - if ((!region) && ((w != ie->w) || (h != ie->h))) + if ((!region) && ((w != ie_w) || (h != ie_h))) { - // race condition, the file could have change from when we call header - // this test will not solve the problem with region code. - jpeg_destroy_decompress(&cinfo); + // race condition, the file could have change from when we call header + // this test will not solve the problem with region code. + jpeg_destroy_decompress(&cinfo); _evas_jpeg_membuf_src_term(&cinfo); - *error = EVAS_LOAD_ERROR_GENERIC; - return EINA_FALSE; + *error = EVAS_LOAD_ERROR_GENERIC; + return EINA_FALSE; } if ((region) && - ((ie->w != ie->load_opts.region.w) || (ie->h != ie->load_opts.region.h))) + ((ie_w != ie->load_opts.region.w) || (ie_h != ie->load_opts.region.h))) { - ie->w = ie->load_opts.region.w; - ie->h = ie->load_opts.region.h; + ie_w = ie->load_opts.region.w; + ie_h = ie->load_opts.region.h; + if (change_wh) + { + ie->w = ie_h; + ie->h = ie_w; + } + else + { + ie->w = ie_w; + ie->h = ie_h; + } + } if (!(((cinfo.out_color_space == JCS_RGB) && @@ -971,31 +986,24 @@ done: if (ie->flags.rotated) { DATA32 *data1, *data2, *to, *from; - int x, y, w, h, hw; - - if (change_wh) - { - tmp = ie->w; - ie->w = ie->h; - ie->h = tmp; - } + int lx, ly, lw, lh, hw; - w = ie->w; - h = ie->h; - hw =w * h; + lw = ie->w; + lh = ie->h; + hw =lw * lh; data1 = evas_cache_image_pixels(ie); if (degree == 180) { - DATA32 tmp; + DATA32 tmpd; - data2 = data1 + (h * w) -1; - for (x = (w * h) / 2; --x >= 0;) + data2 = data1 + (lh * lw) -1; + for (lx = (lw * lh) / 2; --lx >= 0;) { - tmp = *data1; + tmpd = *data1; *data1 = *data2; - *data2 = tmp; + *data2 = tmpd; data1++; data2--; } @@ -1008,26 +1016,26 @@ done: if (degree == 90) { - to = data1 + w - 1; + to = data1 + lw - 1; hw = -hw - 1; } else if (degree == 270) { - to = data1 + hw - w; - w = -w; + to = data1 + hw - lw; + lw = -lw; hw = hw + 1; } if (to) { from = data2; - for (x = ie->w; --x >= 0;) + for (lx = ie->w; --lx >= 0;) { - for (y =ie->h; --y >= 0;) + for (ly =ie->h; --ly >= 0;) { *to = *from; from++; - to += w; + to += lw; } to += hw; } @@ -1046,6 +1054,7 @@ done: ie->load_opts.region.h = load_region_h; } } + if (line_done) { jpeg_destroy_decompress(&cinfo); -- cgit v1.1