}
}
-// if (csize >= a)
-// k = comp * l;
-// else /* csize < a */
-// k = (a / csize) * ceil( (csize * comp * l) / a);
-//
-// return k * height;
-
- return csize * comp;
+ if (csize >= a)
+ k = comp * l;
+ else /* csize < a */
+ k = (a / csize) * ceil( (csize * comp * l) / a);
+
+ return k * height * csize;
}
#define GLPIXELSTOREI_VARIABLE_DECLARE \
if (_cache_glBindBuffer_pixel_unpack_buffer_idx == 0) \
{ \
/* 2. check memory size */ \
- int size = get_size(format, type, width + (border *2), height + (border *2)); \
- int copy_size = (width + (border * 2)) * (height + (border * 2)) * size; \
- if (size < 0 || copy_size < 0 || (unsigned int)copy_size > _mp_texture_memory_size) \
+ int copy_size = get_size(format, type, width + (border *2), height + (border *2)); \
+ if (copy_size < 0 || (unsigned int)copy_size > _mp_texture_memory_size) \
{ \
thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
goto finish; \
if (_cache_glBindBuffer_pixel_unpack_buffer_idx == 0) \
{ \
/* 2. check memory size */ \
- int size = get_size(format, type, width, height); \
- int copy_size = width * height * size; \
- if (size < 0 || copy_size < 0 || (unsigned int)copy_size > _mp_texture_memory_size) \
+ int copy_size = get_size(format, type, width, height); \
+ if (copy_size < 0 || (unsigned int)copy_size > _mp_texture_memory_size) \
{ \
thread_mode = EVAS_GL_THREAD_MODE_FINISH; \
goto finish; \