aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c')
-rw-r--r--libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c b/libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c
new file mode 100644
index 0000000..1903314
--- /dev/null
+++ b/libraries/evas/src/modules/engines/gl_common/evas_gl_rectangle.c
@@ -0,0 +1,53 @@
1#include "evas_gl_private.h"
2
3void
4evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
5{
6 Cutout_Rects *rects;
7 Cutout_Rect *r;
8 int c, cx, cy, cw, ch, cr, cg, cb, ca, i;
9
10 if ((w <= 0) || (h <= 0)) return;
11 if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, gc->w, gc->h))) return;
12 /* save out clip info */
13 c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h;
14
15 ca = (gc->dc->col.col >> 24) & 0xff;
16 if ((gc->dc->render_op != EVAS_RENDER_COPY) && (ca <= 0)) return;
17 cr = (gc->dc->col.col >> 16) & 0xff;
18 cg = (gc->dc->col.col >> 8 ) & 0xff;
19 cb = (gc->dc->col.col ) & 0xff;
20 evas_common_draw_context_clip_clip(gc->dc, 0, 0, gc->w, gc->h);
21 /* no cutouts - cut right to the chase */
22 if ((gc->dc) && (gc->dc->clip.use))
23 {
24 RECTS_CLIP_TO_RECT(x, y, w, h,
25 gc->dc->clip.x, gc->dc->clip.y,
26 gc->dc->clip.w, gc->dc->clip.h);
27 }
28
29 if (!gc->dc->cutout.rects)
30 {
31 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca);
32 }
33 else
34 {
35 evas_common_draw_context_clip_clip(gc->dc, x, y, w, h);
36 /* our clip is 0 size.. abort */
37 if ((gc->dc->clip.w > 0) && (gc->dc->clip.h > 0))
38 {
39 rects = evas_common_draw_context_apply_cutouts(gc->dc);
40 for (i = 0; i < rects->active; ++i)
41 {
42 r = rects->rects + i;
43 if ((r->w > 0) && (r->h > 0))
44 {
45 evas_gl_common_context_rectangle_push(gc, r->x, r->y, r->w, r->h, cr, cg, cb, ca);
46 }
47 }
48 evas_common_draw_context_apply_clear_cutouts(rects);
49 }
50 }
51 /* restore clip info */
52 gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
53}