mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +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;
|
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)
|
static void getColormap(RContext * context, int screen_number)
|
||||||
|
|||||||
16
wrlib/jpeg.c
16
wrlib/jpeg.c
@@ -149,9 +149,6 @@ RImage *RLoadJPEG(RContext * context, const char *file_name)
|
|||||||
cinfo.do_block_smoothing = FALSE;
|
cinfo.do_block_smoothing = FALSE;
|
||||||
jpeg_calc_output_dimensions(&cinfo);
|
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) {
|
if (!image) {
|
||||||
@@ -163,25 +160,12 @@ RImage *RLoadJPEG(RContext * context, const char *file_name)
|
|||||||
ptr = image->data;
|
ptr = image->data;
|
||||||
|
|
||||||
if (cinfo.out_color_space == JCS_RGB) {
|
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) {
|
while (cinfo.output_scanline < cinfo.output_height) {
|
||||||
jpeg_read_scanlines(&cinfo, buffer, (JDIMENSION) 1);
|
jpeg_read_scanlines(&cinfo, buffer, (JDIMENSION) 1);
|
||||||
bptr = buffer[0];
|
bptr = buffer[0];
|
||||||
memcpy(ptr, bptr, cinfo.image_width * 3);
|
memcpy(ptr, bptr, cinfo.image_width * 3);
|
||||||
ptr += cinfo.image_width * 3;
|
ptr += cinfo.image_width * 3;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
while (cinfo.output_scanline < cinfo.output_height) {
|
while (cinfo.output_scanline < cinfo.output_height) {
|
||||||
jpeg_read_scanlines(&cinfo, buffer, (JDIMENSION) 1);
|
jpeg_read_scanlines(&cinfo, buffer, (JDIMENSION) 1);
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ typedef struct RContext {
|
|||||||
|
|
||||||
struct {
|
struct {
|
||||||
unsigned int use_shared_pixmap:1;
|
unsigned int use_shared_pixmap:1;
|
||||||
unsigned int optimize_for_speed:1;
|
|
||||||
} flags;
|
} flags;
|
||||||
} RContext;
|
} RContext;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user