0
@@ -178,12 +178,12 @@ unsigned char finalcount[8];
0
-
static cairo_surface_t *
0
shoes_surface_create_from_pixels(PIXEL *pixels, int width, int height)
0
cairo_surface_t *surface;
0
-
static const cairo_user_data_key_t key;
0
+
cairo_user_data_key_t key;
0
cairo_pixels = (guchar *)g_malloc(4 * width * height);
0
@@ -235,7 +235,7 @@ shoes_surface_create_from_pixels(PIXEL *pixels, int width, int height)
0
shoes_png_size(char *filename, int *width, int *height)
0
- unsigned char *sig = SHOE_ALLOC_N(
char, 32);
0
+ unsigned char *sig = SHOE_ALLOC_N(
unsigned char, 32);
0
cairo_surface_t *surface = NULL;
0
FILE *image = fopen(filename, "rb");
0
if (image == NULL) return NULL;
0
@@ -414,12 +414,12 @@ typedef struct shoes_jpeg_error_mgr *shoes_jpeg_err;
0
#define JPEG_INPUT_BUF_SIZE 4096
0
shoes_jpeg_term_source(j_decompress_ptr cinfo)
0
shoes_jpeg_init_source(j_decompress_ptr cinfo)
0
shoes_jpeg_file src = (shoes_jpeg_file) cinfo->src;
0
@@ -427,7 +427,7 @@ shoes_jpeg_init_source(j_decompress_ptr cinfo)
0
shoes_jpeg_fill_input_buffer(j_decompress_ptr cinfo)
0
shoes_jpeg_file src = (shoes_jpeg_file)cinfo->src;
0
@@ -451,7 +451,7 @@ shoes_jpeg_fill_input_buffer(j_decompress_ptr cinfo)
0
shoes_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
0
shoes_jpeg_file src = (shoes_jpeg_file)cinfo->src;
0
@@ -468,7 +468,7 @@ shoes_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
0
jpeg_file_src(j_decompress_ptr cinfo, FILE *infile)
0
@@ -496,7 +496,7 @@ jpeg_file_src(j_decompress_ptr cinfo, FILE *infile)
0
src->pub.next_input_byte = NULL; /* until buffer loaded */
0
shoes_jpeg_fatal(j_common_ptr cinfo)
0
shoes_jpeg_err jpgerr = (shoes_jpeg_err)cinfo->err;
0
@@ -596,13 +596,13 @@ done:
0
shoes_has_ext(char *fname, int len, const char *ext)
0
return strncmp(fname + (len - strlen(ext)), ext, strlen(ext)) == 0;
0
shoes_check_file_exists(VALUE path)
0
if (!RTEST(rb_funcall(rb_cFile, rb_intern("exists?"), 1, path)))
0
@@ -614,7 +614,7 @@ shoes_check_file_exists(VALUE path)
0
shoes_unsupported_image(VALUE path)
0
VALUE ext = rb_funcall(rb_cFile, rb_intern("extname"), 1, path);
0
@@ -624,7 +624,7 @@ shoes_unsupported_image(VALUE path)
0
RSTRING_PTR(path), RSTRING_PTR(ext));
0
shoes_failed_image(VALUE path)
0
VALUE ext = rb_funcall(rb_cFile, rb_intern("extname"), 1, path);
0
@@ -634,7 +634,7 @@ shoes_failed_image(VALUE path)
0
RSTRING_PTR(path), RSTRING_PTR(ext));
0
-
static cairo_surface_t *
0
shoes_surface_create_from_file(char *fname, char *dname, int *width, int *height)
0
int len = strlen(dname);
0
@@ -653,6 +653,24 @@ shoes_surface_create_from_file(char *fname, char *dname, int *width, int *height
0
+shoes_cache_lookup(char *imgpath, shoes_cached_image **image)
0
+ shoes_cache_entry *cached = NULL;
0
+ int ret = st_lookup(shoes_world->image_cache, (st_data_t)imgpath, (st_data_t *)&cached);
0
+ if (ret) *image = cached->image;
0
+shoes_cache_insert(unsigned char type, VALUE imgpath, shoes_cached_image *image)
0
+ shoes_cache_entry *cached = SHOE_ALLOC(shoes_cache_entry);
0
+ cached->image = image;
0
+ st_insert(shoes_world->image_cache, (st_data_t)strdup(RSTRING_PTR(imgpath)), (st_data_t)cached);
0
shoes_load_imagesize(VALUE imgpath, int *width, int *height)
0
@@ -718,7 +736,7 @@ shoes_download_image_handler(shoes_download_event *de, void *data)
0
int i, j, width, height;
0
- unsigned char *digest = SHOE_ALLOC_N(
char, 20), *buffer = SHOE_ALLOC_N(char, 16384);
0
+ unsigned char *digest = SHOE_ALLOC_N(
unsigned char, 20), *buffer = SHOE_ALLOC_N(unsigned char, 16384);
0
if (idat->status == 304)
0
@@ -733,6 +751,7 @@ shoes_download_image_handler(shoes_download_event *de, void *data)
0
if (shoes_cache_lookup(idat->uripath, &cached) && cached->surface == shoes_world->blank_image)
0
shoes_image_download_event *side = SHOE_ALLOC(shoes_image_download_event);
0
+ SHOE_MEMZERO(side, shoes_image_download_event, 1);
0
cached->height = height;
0
@@ -773,24 +792,6 @@ shoes_download_image_handler(shoes_download_event *de, void *data)
0
return SHOES_DOWNLOAD_CONTINUE;
0
-shoes_cache_lookup(char *imgpath, shoes_cached_image **image)
0
- shoes_cache_entry *cached = NULL;
0
- int ret = st_lookup(shoes_world->image_cache, (st_data_t)imgpath, (st_data_t *)&cached);
0
- if (ret) *image = cached->image;
0
-shoes_cache_insert(unsigned char type, VALUE imgpath, shoes_cached_image *image)
0
- shoes_cache_entry *cached = SHOE_ALLOC(shoes_cache_entry);
0
- cached->image = image;
0
- st_insert(shoes_world->image_cache, (st_data_t)strdup(RSTRING_PTR(imgpath)), (st_data_t)cached);
0
shoes_load_image(VALUE slot, VALUE imgpath)
Comments
No one has commented yet.