diff --git a/wrlib/context.c b/wrlib/context.c index bc021834..3fdaafe4 100644 --- a/wrlib/context.c +++ b/wrlib/context.c @@ -502,14 +502,6 @@ static void gatherconfig(RContext * context, int screen_n) context->attribs->colors_per_channel = i; } } - - ptr = mygetenv("WRASTER_OPTIMIZE_FOR_SPEED", screen_n); - if (ptr) { - context->flags.optimize_for_speed = 1; - } else { - context->flags.optimize_for_speed = 0; - } - } static void getColormap(RContext * context, int screen_number) diff --git a/wrlib/jpeg.c b/wrlib/jpeg.c index 2339f516..08fa47db 100644 --- a/wrlib/jpeg.c +++ b/wrlib/jpeg.c @@ -149,10 +149,7 @@ RImage *RLoadJPEG(RContext * context, const char *file_name) cinfo.do_block_smoothing = FALSE; jpeg_calc_output_dimensions(&cinfo); - if (context->flags.optimize_for_speed) - image = RCreateImage(cinfo.image_width, cinfo.image_height, True); - else - image = RCreateImage(cinfo.image_width, cinfo.image_height, False); + image = RCreateImage(cinfo.image_width, cinfo.image_height, False); if (!image) { RErrorCode = RERR_NOMEMORY; @@ -163,24 +160,11 @@ RImage *RLoadJPEG(RContext * context, const char *file_name) ptr = image->data; if (cinfo.out_color_space == JCS_RGB) { - if (context->flags.optimize_for_speed) { - while (cinfo.output_scanline < cinfo.output_height) { - jpeg_read_scanlines(&cinfo, buffer, (JDIMENSION) 1); - bptr = buffer[0]; - for (i = 0; i < cinfo.image_width; i++) { - *ptr++ = *bptr++; - *ptr++ = *bptr++; - *ptr++ = *bptr++; - ptr++; /* skip alpha channel */ - } - } - } else { - while (cinfo.output_scanline < cinfo.output_height) { - jpeg_read_scanlines(&cinfo, buffer, (JDIMENSION) 1); - bptr = buffer[0]; - memcpy(ptr, bptr, cinfo.image_width * 3); - ptr += cinfo.image_width * 3; - } + while (cinfo.output_scanline < cinfo.output_height) { + jpeg_read_scanlines(&cinfo, buffer, (JDIMENSION) 1); + bptr = buffer[0]; + memcpy(ptr, bptr, cinfo.image_width * 3); + ptr += cinfo.image_width * 3; } } else { while (cinfo.output_scanline < cinfo.output_height) { diff --git a/wrlib/wraster.h b/wrlib/wraster.h index b5e360ea..ff2b2c31 100644 --- a/wrlib/wraster.h +++ b/wrlib/wraster.h @@ -147,7 +147,6 @@ typedef struct RContext { struct { unsigned int use_shared_pixmap:1; - unsigned int optimize_for_speed:1; } flags; } RContext;