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"
20 ao_rect(const struct ao_bitmap *dst,
28 int16_t x2 = x + width;
29 int16_t y2 = y + height;
31 ao_clip(x, 0, dst->width);
32 ao_clip(x2, 0, dst->width);
33 ao_clip(y, 0, dst->height);
34 ao_clip(y2, 0, dst->height);
36 if (x < x2 && y < y2) {
37 ao_solid(ao_and(rop, fill),
39 dst->base + y * dst->stride,