diff options
Diffstat (limited to 'libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c')
-rw-r--r-- | libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c b/libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c deleted file mode 100644 index 4dee9a2..0000000 --- a/libraries/evas/src/modules/engines/wayland_shm/evas_outbuf.c +++ /dev/null | |||
@@ -1,101 +0,0 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_engine.h" | ||
3 | |||
4 | void | ||
5 | evas_outbuf_free(Outbuf *ob) | ||
6 | { | ||
7 | if (!ob) return; | ||
8 | if (ob->priv.buffer) evas_cache_image_drop(&ob->priv.buffer->cache_entry); | ||
9 | free(ob); | ||
10 | } | ||
11 | |||
12 | void | ||
13 | evas_outbuf_resize(Outbuf *ob, int w, int h) | ||
14 | { | ||
15 | if (!ob) return; | ||
16 | if ((ob->w == w) && (ob->h == h)) return; | ||
17 | ob->w = w; | ||
18 | ob->h = h; | ||
19 | if (ob->priv.buffer) evas_cache_image_drop(&ob->priv.buffer->cache_entry); | ||
20 | ob->priv.buffer = NULL; | ||
21 | } | ||
22 | |||
23 | Outbuf * | ||
24 | evas_outbuf_setup(int w, int h, int rot, Eina_Bool alpha, void *dest) | ||
25 | { | ||
26 | Outbuf *ob = NULL; | ||
27 | |||
28 | if (!(ob = calloc(1, sizeof(Outbuf)))) return NULL; | ||
29 | |||
30 | ob->w = w; | ||
31 | ob->h = h; | ||
32 | ob->rotation = rot; | ||
33 | ob->priv.dest = dest; | ||
34 | ob->priv.destination_alpha = alpha; | ||
35 | |||
36 | ob->priv.buffer = | ||
37 | (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(), | ||
38 | w, h, ob->priv.dest, | ||
39 | 1, EVAS_COLORSPACE_ARGB8888); | ||
40 | |||
41 | return ob; | ||
42 | } | ||
43 | |||
44 | RGBA_Image * | ||
45 | evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch) | ||
46 | { | ||
47 | if (ob->priv.buffer) | ||
48 | { | ||
49 | *cx = x; *cy = y; *cw = w; *ch = h; | ||
50 | return ob->priv.buffer; | ||
51 | } | ||
52 | else | ||
53 | { | ||
54 | RGBA_Image *im; | ||
55 | |||
56 | *cx = 0; *cy = 0; *cw = w; *ch = h; | ||
57 | im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get()); | ||
58 | if (im) | ||
59 | { | ||
60 | im->cache_entry.flags.alpha = ob->priv.destination_alpha; | ||
61 | im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h); | ||
62 | } | ||
63 | |||
64 | return im; | ||
65 | } | ||
66 | |||
67 | return NULL; | ||
68 | } | ||
69 | |||
70 | void | ||
71 | evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__, int y, int w, int h) | ||
72 | { | ||
73 | if (!ob->priv.dest) return; | ||
74 | if (!ob->priv.buffer) | ||
75 | { | ||
76 | Gfx_Func_Copy func; | ||
77 | |||
78 | func = evas_common_draw_func_copy_get(w, 0); | ||
79 | if (func) | ||
80 | { | ||
81 | DATA32 *dst, *src; | ||
82 | int yy = 0, bytes = 0; | ||
83 | |||
84 | bytes = ((w * sizeof(int)) * h); | ||
85 | for (yy = 0; yy < h; yy++) | ||
86 | { | ||
87 | src = update->image.data + (yy * update->cache_entry.w); | ||
88 | dst = (DATA32 *)((DATA8 *)(ob->priv.dest) + | ||
89 | ((y + yy) * bytes)); | ||
90 | func(src, dst, w); | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | |||
96 | void | ||
97 | evas_outbuf_free_region_for_update(Outbuf *ob, RGBA_Image *update) | ||
98 | { | ||
99 | if (!ob) return; | ||
100 | if (update != ob->priv.buffer) evas_cache_image_drop(&update->cache_entry); | ||
101 | } | ||