Commit 29b455c9 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

replaced a bitshift with a binary and. Should be unnoticeably faster ;)

2004-09-16  Sven Neumann  <sven@gimp.org>

	* app/core/gimpscanconvert.c (VALUE_TO_PIXEL): replaced a bitshift
	with a binary and. Should be unnoticeably faster ;)
parent fc01210b
2004-09-16 Sven Neumann <sven@gimp.org>
* app/core/gimpscanconvert.c (VALUE_TO_PIXEL): replaced a bitshift
with a binary and. Should be unnoticeably faster ;)
2004-09-16 Michael Natterer <mitch@gimp.org>
* app/pdb/procedural_db.c: removed #if 0'ed code, took assignments
......
......@@ -554,15 +554,18 @@ gimp_scan_convert_render_callback (gpointer user_data,
ArtSVPRenderAAStep *steps,
gint n_steps)
{
gint k, run_x0, run_x1;
gint cur_value = start_value;
GimpScanConvert *sc = (GimpScanConvert *) user_data;
GimpScanConvert *sc = user_data;
gint cur_value = start_value;
gint k, run_x0, run_x1;
#define VALUE_TO_PIXEL(x) (sc->antialias ? (x) >> 16 : ((x) >> 23 ? 255 : 0))
#define VALUE_TO_PIXEL(x) (sc->antialias ? \
((x) >> 16) : \
(((x) & (1 << 23) ? 255 : 0)))
if (n_steps > 0)
{
run_x1 = steps[0].x;
if (run_x1 > sc->x0)
memset (sc->buf,
VALUE_TO_PIXEL (cur_value),
......@@ -571,8 +574,10 @@ gimp_scan_convert_render_callback (gpointer user_data,
for (k = 0; k < n_steps - 1; k++)
{
cur_value += steps[k].delta;
run_x0 = run_x1;
run_x1 = steps[k + 1].x;
if (run_x1 > run_x0)
memset (sc->buf + run_x0 - sc->x0,
VALUE_TO_PIXEL (cur_value),
......@@ -580,6 +585,7 @@ gimp_scan_convert_render_callback (gpointer user_data,
}
cur_value += steps[k].delta;
if (sc->x1 > run_x1)
memset (sc->buf + run_x1 - sc->x0,
VALUE_TO_PIXEL (cur_value),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment