2 * Copyright © 2016 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
17 #include "ao_draw_int.h"
19 #define bound(val,max) do { \
29 ao_rect(const struct ao_bitmap *dst,
37 int16_t x2 = x + width;
38 int16_t y2 = y + height;
41 bound(x2, dst->width);
42 bound(y, dst->height);
43 bound(y2, dst->height);
45 if (x < x2 && y < y2) {
46 ao_solid(ao_and(rop, fill),
48 dst->base + y * dst->stride,