Optimization for pixel loop.
As per erco's comments on fltk.coredev, Mar 21 2021 in thread Subject: Re: 1.4 build failing on OSX for me
This commit is contained in:
parent
5fb6713485
commit
8a9e25cdac
@ -40,10 +40,11 @@ static void draw_image_cb(void *data, int x, int y, int w, uchar *buf) {
|
||||
|
||||
cb_data = (struct callback_data*)data;
|
||||
int last = x+w;
|
||||
const size_t aD = abs(cb_data->D);
|
||||
curdata = cb_data->data + x*cb_data->D + y*cb_data->LD;
|
||||
for (; x<last; x++) {
|
||||
memcpy(buf, curdata, abs(cb_data->D));
|
||||
buf += abs(cb_data->D);
|
||||
memcpy(buf, curdata, aD);
|
||||
buf += aD;
|
||||
curdata += cb_data->D;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user