mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
Removed optimize_for_speed flag
The optimize_for_speed was used to set the Alpha channel for jpeg. The alpha channel for jpeg should be used always. The current CPUs/GPUs can do it without problems and this is an old behaviour.
This commit is contained in:
committed by
Carlos R. Mafra
parent
f363292d3c
commit
d1f9b80171
@@ -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)
|
||||
|
||||
28
wrlib/jpeg.c
28
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) {
|
||||
|
||||
@@ -147,7 +147,6 @@ typedef struct RContext {
|
||||
|
||||
struct {
|
||||
unsigned int use_shared_pixmap:1;
|
||||
unsigned int optimize_for_speed:1;
|
||||
} flags;
|
||||
} RContext;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user