diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/evas/src/modules/engines/buffer | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to '')
6 files changed, 93 insertions, 29 deletions
diff --git a/libraries/evas/src/modules/engines/buffer/Evas_Engine_Buffer.h b/libraries/evas/src/modules/engines/buffer/Evas_Engine_Buffer.h index e6d11d1..a9cbbfb 100644 --- a/libraries/evas/src/modules/engines/buffer/Evas_Engine_Buffer.h +++ b/libraries/evas/src/modules/engines/buffer/Evas_Engine_Buffer.h | |||
@@ -29,7 +29,10 @@ struct _Evas_Engine_Info_Buffer | |||
29 | struct { | 29 | struct { |
30 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes); | 30 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes); |
31 | void (*free_update_region) (int x, int y, int w, int h, void *data); | 31 | void (*free_update_region) (int x, int y, int w, int h, void *data); |
32 | void * (*switch_buffer) (void *data, void *dest_buffer); | ||
32 | } func; | 33 | } func; |
34 | |||
35 | void *switch_data; | ||
33 | } info; | 36 | } info; |
34 | 37 | ||
35 | /* non-blocking or blocking mode */ | 38 | /* non-blocking or blocking mode */ |
diff --git a/libraries/evas/src/modules/engines/buffer/Makefile.am b/libraries/evas/src/modules/engines/buffer/Makefile.am index 19ac5a7..4090b6f 100644 --- a/libraries/evas/src/modules/engines/buffer/Makefile.am +++ b/libraries/evas/src/modules/engines/buffer/Makefile.am | |||
@@ -10,8 +10,6 @@ AM_CPPFLAGS = \ | |||
10 | @FREETYPE_CFLAGS@ \ | 10 | @FREETYPE_CFLAGS@ \ |
11 | @PIXMAN_CFLAGS@ | 11 | @PIXMAN_CFLAGS@ |
12 | 12 | ||
13 | AM_CFLAGS = @WIN32_CFLAGS@ | ||
14 | |||
15 | if BUILD_ENGINE_BUFFER | 13 | if BUILD_ENGINE_BUFFER |
16 | 14 | ||
17 | BUFFER_SOURCES = \ | 15 | BUFFER_SOURCES = \ |
diff --git a/libraries/evas/src/modules/engines/buffer/Makefile.in b/libraries/evas/src/modules/engines/buffer/Makefile.in index ec9c0b8..bd9818e 100644 --- a/libraries/evas/src/modules/engines/buffer/Makefile.in +++ b/libraries/evas/src/modules/engines/buffer/Makefile.in | |||
@@ -190,6 +190,8 @@ EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | |||
190 | EVIL_CFLAGS = @EVIL_CFLAGS@ | 190 | EVIL_CFLAGS = @EVIL_CFLAGS@ |
191 | EVIL_LIBS = @EVIL_LIBS@ | 191 | EVIL_LIBS = @EVIL_LIBS@ |
192 | EXEEXT = @EXEEXT@ | 192 | EXEEXT = @EXEEXT@ |
193 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
194 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
193 | FGREP = @FGREP@ | 195 | FGREP = @FGREP@ |
194 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | 196 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ |
195 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | 197 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ |
@@ -240,6 +242,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
240 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 242 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
241 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 243 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
242 | PKG_CONFIG = @PKG_CONFIG@ | 244 | PKG_CONFIG = @PKG_CONFIG@ |
245 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
246 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
243 | PNG_CFLAGS = @PNG_CFLAGS@ | 247 | PNG_CFLAGS = @PNG_CFLAGS@ |
244 | PNG_LIBS = @PNG_LIBS@ | 248 | PNG_LIBS = @PNG_LIBS@ |
245 | RANLIB = @RANLIB@ | 249 | RANLIB = @RANLIB@ |
@@ -258,8 +262,6 @@ VERSION = @VERSION@ | |||
258 | VMAJ = @VMAJ@ | 262 | VMAJ = @VMAJ@ |
259 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | 263 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ |
260 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | 264 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ |
261 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
262 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
263 | XCB_CFLAGS = @XCB_CFLAGS@ | 265 | XCB_CFLAGS = @XCB_CFLAGS@ |
264 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | 266 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ |
265 | XCB_GL_LIBS = @XCB_GL_LIBS@ | 267 | XCB_GL_LIBS = @XCB_GL_LIBS@ |
@@ -333,8 +335,6 @@ evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | |||
333 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | 335 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ |
334 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | 336 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ |
335 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | 337 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ |
336 | evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ | ||
337 | evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ | ||
338 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | 338 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ |
339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 339 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 340 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
@@ -427,7 +427,6 @@ AM_CPPFLAGS = \ | |||
427 | @FREETYPE_CFLAGS@ \ | 427 | @FREETYPE_CFLAGS@ \ |
428 | @PIXMAN_CFLAGS@ | 428 | @PIXMAN_CFLAGS@ |
429 | 429 | ||
430 | AM_CFLAGS = @WIN32_CFLAGS@ | ||
431 | @BUILD_ENGINE_BUFFER_TRUE@BUFFER_SOURCES = \ | 430 | @BUILD_ENGINE_BUFFER_TRUE@BUFFER_SOURCES = \ |
432 | @BUILD_ENGINE_BUFFER_TRUE@evas_engine.c \ | 431 | @BUILD_ENGINE_BUFFER_TRUE@evas_engine.c \ |
433 | @BUILD_ENGINE_BUFFER_TRUE@evas_outbuf.c | 432 | @BUILD_ENGINE_BUFFER_TRUE@evas_outbuf.c |
diff --git a/libraries/evas/src/modules/engines/buffer/evas_engine.c b/libraries/evas/src/modules/engines/buffer/evas_engine.c index e8dff7a..758ef10 100644 --- a/libraries/evas/src/modules/engines/buffer/evas_engine.c +++ b/libraries/evas/src/modules/engines/buffer/evas_engine.c | |||
@@ -25,11 +25,12 @@ struct _Render_Engine | |||
25 | Outbuf *ob; | 25 | Outbuf *ob; |
26 | Tilebuf_Rect *rects; | 26 | Tilebuf_Rect *rects; |
27 | Eina_Inlist *cur_rect; | 27 | Eina_Inlist *cur_rect; |
28 | Eina_Inarray previous_rects; | ||
28 | int end : 1; | 29 | int end : 1; |
29 | }; | 30 | }; |
30 | 31 | ||
31 | /* prototypes we will use here */ | 32 | /* prototypes we will use here */ |
32 | static void *_output_setup(int w, int h, void *dest_buffer, int dest_buffer_row_bytes, int depth_type, int use_color_key, int alpha_threshold, int color_key_r, int color_key_g, int color_key_b, void *(*new_update_region) (int x, int y, int w, int h, int *row_bytes), void (*free_update_region) (int x, int y, int w, int h, void *data)); | 33 | static void *_output_setup(int w, int h, void *dest_buffer, int dest_buffer_row_bytes, int depth_type, int use_color_key, int alpha_threshold, int color_key_r, int color_key_g, int color_key_b, void *(*new_update_region) (int x, int y, int w, int h, int *row_bytes), void (*free_update_region) (int x, int y, int w, int h, void *data), void *(*switch_buffer) (void *data, void *dest_buffer), void *switch_data); |
33 | 34 | ||
34 | static void *eng_info(Evas *e __UNUSED__); | 35 | static void *eng_info(Evas *e __UNUSED__); |
35 | static void eng_info_free(Evas *e __UNUSED__, void *info); | 36 | static void eng_info_free(Evas *e __UNUSED__, void *info); |
@@ -58,7 +59,9 @@ _output_setup(int w, | |||
58 | int color_key_g, | 59 | int color_key_g, |
59 | int color_key_b, | 60 | int color_key_b, |
60 | void *(*new_update_region) (int x, int y, int w, int h, int *row_bytes), | 61 | void *(*new_update_region) (int x, int y, int w, int h, int *row_bytes), |
61 | void (*free_update_region) (int x, int y, int w, int h, void *data) | 62 | void (*free_update_region) (int x, int y, int w, int h, void *data), |
63 | void *(*switch_buffer) (void *data, void *dest_buffer), | ||
64 | void *switch_data | ||
62 | ) | 65 | ) |
63 | { | 66 | { |
64 | Render_Engine *re; | 67 | Render_Engine *re; |
@@ -81,7 +84,7 @@ _output_setup(int w, | |||
81 | evas_common_tilebuf_init(); | 84 | evas_common_tilebuf_init(); |
82 | 85 | ||
83 | evas_buffer_outbuf_buf_init(); | 86 | evas_buffer_outbuf_buf_init(); |
84 | 87 | ||
85 | { | 88 | { |
86 | Outbuf_Depth dep; | 89 | Outbuf_Depth dep; |
87 | DATA32 color_key = 0; | 90 | DATA32 color_key = 0; |
@@ -110,10 +113,13 @@ _output_setup(int w, | |||
110 | color_key, | 113 | color_key, |
111 | alpha_threshold, | 114 | alpha_threshold, |
112 | new_update_region, | 115 | new_update_region, |
113 | free_update_region); | 116 | free_update_region, |
117 | switch_buffer, | ||
118 | switch_data); | ||
114 | } | 119 | } |
115 | re->tb = evas_common_tilebuf_new(w, h); | 120 | re->tb = evas_common_tilebuf_new(w, h); |
116 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); | 121 | evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE); |
122 | eina_inarray_setup(&re->previous_rects, sizeof (Eina_Rectangle), 8); | ||
117 | return re; | 123 | return re; |
118 | } | 124 | } |
119 | 125 | ||
@@ -155,7 +161,9 @@ eng_setup(Evas *e, void *in) | |||
155 | info->info.color_key_g, | 161 | info->info.color_key_g, |
156 | info->info.color_key_b, | 162 | info->info.color_key_b, |
157 | info->info.func.new_update_region, | 163 | info->info.func.new_update_region, |
158 | info->info.func.free_update_region); | 164 | info->info.func.free_update_region, |
165 | info->info.func.switch_buffer, | ||
166 | info->info.switch_data); | ||
159 | if (e->engine.data.output) | 167 | if (e->engine.data.output) |
160 | eng_output_free(e->engine.data.output); | 168 | eng_output_free(e->engine.data.output); |
161 | e->engine.data.output = re; | 169 | e->engine.data.output = re; |
@@ -195,6 +203,8 @@ eng_output_resize(void *data, int w, int h) | |||
195 | char use_color_key; | 203 | char use_color_key; |
196 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes); | 204 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes); |
197 | void (*free_update_region) (int x, int y, int w, int h, void *data); | 205 | void (*free_update_region) (int x, int y, int w, int h, void *data); |
206 | void * (*switch_buffer) (void *switch_data, void *dest); | ||
207 | void *switch_data; | ||
198 | 208 | ||
199 | depth = re->ob->depth; | 209 | depth = re->ob->depth; |
200 | dest = re->ob->dest; | 210 | dest = re->ob->dest; |
@@ -204,6 +214,8 @@ eng_output_resize(void *data, int w, int h) | |||
204 | use_color_key = re->ob->use_color_key; | 214 | use_color_key = re->ob->use_color_key; |
205 | new_update_region = re->ob->func.new_update_region; | 215 | new_update_region = re->ob->func.new_update_region; |
206 | free_update_region = re->ob->func.free_update_region; | 216 | free_update_region = re->ob->func.free_update_region; |
217 | switch_buffer = re->ob->func.switch_buffer; | ||
218 | switch_data = re->ob->switch_data; | ||
207 | evas_buffer_outbuf_buf_free(re->ob); | 219 | evas_buffer_outbuf_buf_free(re->ob); |
208 | re->ob = evas_buffer_outbuf_buf_setup_fb(w, | 220 | re->ob = evas_buffer_outbuf_buf_setup_fb(w, |
209 | h, | 221 | h, |
@@ -214,7 +226,9 @@ eng_output_resize(void *data, int w, int h) | |||
214 | color_key, | 226 | color_key, |
215 | alpha_level, | 227 | alpha_level, |
216 | new_update_region, | 228 | new_update_region, |
217 | free_update_region); | 229 | free_update_region, |
230 | switch_buffer, | ||
231 | switch_data); | ||
218 | } | 232 | } |
219 | evas_common_tilebuf_free(re->tb); | 233 | evas_common_tilebuf_free(re->tb); |
220 | re->tb = evas_common_tilebuf_new(w, h); | 234 | re->tb = evas_common_tilebuf_new(w, h); |
@@ -275,6 +289,37 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i | |||
275 | if (!re->rects) | 289 | if (!re->rects) |
276 | { | 290 | { |
277 | re->rects = evas_common_tilebuf_get_render_rects(re->tb); | 291 | re->rects = evas_common_tilebuf_get_render_rects(re->tb); |
292 | |||
293 | /* handle double buffering */ | ||
294 | if (re->ob->func.switch_buffer) | ||
295 | { | ||
296 | Eina_Rectangle *pushing; | ||
297 | |||
298 | if (re->ob->first_frame && !re->previous_rects.len) | ||
299 | { | ||
300 | evas_common_tilebuf_add_redraw(re->tb, 0, 0, re->ob->w, re->ob->h); | ||
301 | re->ob->first_frame = 0; | ||
302 | } | ||
303 | |||
304 | /* push previous frame */ | ||
305 | EINA_INARRAY_FOREACH(&re->previous_rects, pushing) | ||
306 | evas_common_tilebuf_add_redraw(re->tb, pushing->x, pushing->y, pushing->w, pushing->h); | ||
307 | eina_inarray_flush(&re->previous_rects); | ||
308 | |||
309 | /* save current list of damage */ | ||
310 | EINA_INLIST_FOREACH(re->rects, rect) | ||
311 | { | ||
312 | Eina_Rectangle local; | ||
313 | |||
314 | EINA_RECTANGLE_SET(&local, rect->x, rect->y, rect->w, rect->h); | ||
315 | eina_inarray_append(&re->previous_rects, &local); | ||
316 | } | ||
317 | |||
318 | /* and regenerate the damage list by tacking into account the damage over two frames */ | ||
319 | evas_common_tilebuf_free_render_rects(re->rects); | ||
320 | re->rects = evas_common_tilebuf_get_render_rects(re->tb); | ||
321 | } | ||
322 | |||
278 | re->cur_rect = EINA_INLIST_GET(re->rects); | 323 | re->cur_rect = EINA_INLIST_GET(re->rects); |
279 | } | 324 | } |
280 | if (!re->cur_rect) return NULL; | 325 | if (!re->cur_rect) return NULL; |
@@ -306,7 +351,7 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int | |||
306 | re = (Render_Engine *)data; | 351 | re = (Render_Engine *)data; |
307 | #ifdef BUILD_PIPE_RENDER | 352 | #ifdef BUILD_PIPE_RENDER |
308 | evas_common_pipe_map_begin(surface); | 353 | evas_common_pipe_map_begin(surface); |
309 | #endif | 354 | #endif |
310 | evas_buffer_outbuf_buf_push_updated_region(re->ob, surface, x, y, w, h); | 355 | evas_buffer_outbuf_buf_push_updated_region(re->ob, surface, x, y, w, h); |
311 | evas_buffer_outbuf_buf_free_region_for_update(re->ob, surface); | 356 | evas_buffer_outbuf_buf_free_region_for_update(re->ob, surface); |
312 | evas_common_cpu_end_opt(); | 357 | evas_common_cpu_end_opt(); |
@@ -315,17 +360,13 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int | |||
315 | static void | 360 | static void |
316 | eng_output_flush(void *data) | 361 | eng_output_flush(void *data) |
317 | { | 362 | { |
318 | Render_Engine *re; | 363 | Render_Engine *re = (Render_Engine *)data; |
319 | 364 | evas_buffer_outbuf_buf_switch_buffer(re->ob); | |
320 | re = (Render_Engine *)data; | ||
321 | } | 365 | } |
322 | 366 | ||
323 | static void | 367 | static void |
324 | eng_output_idle_flush(void *data) | 368 | eng_output_idle_flush(void *data __UNUSED__) |
325 | { | 369 | { |
326 | Render_Engine *re; | ||
327 | |||
328 | re = (Render_Engine *)data; | ||
329 | } | 370 | } |
330 | 371 | ||
331 | static Eina_Bool | 372 | static Eina_Bool |
diff --git a/libraries/evas/src/modules/engines/buffer/evas_engine.h b/libraries/evas/src/modules/engines/buffer/evas_engine.h index 21c988c..af82477 100644 --- a/libraries/evas/src/modules/engines/buffer/evas_engine.h +++ b/libraries/evas/src/modules/engines/buffer/evas_engine.h | |||
@@ -52,14 +52,17 @@ struct _Outbuf | |||
52 | 52 | ||
53 | void *dest; | 53 | void *dest; |
54 | unsigned int dest_row_bytes; | 54 | unsigned int dest_row_bytes; |
55 | void *switch_data; | ||
55 | 56 | ||
56 | int alpha_level; | 57 | int alpha_level; |
57 | DATA32 color_key; | 58 | DATA32 color_key; |
58 | char use_color_key : 1; | 59 | char use_color_key : 1; |
60 | char first_frame : 1; | ||
59 | 61 | ||
60 | struct { | 62 | struct { |
61 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes); | 63 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes); |
62 | void (*free_update_region) (int x, int y, int w, int h, void *data); | 64 | void (*free_update_region) (int x, int y, int w, int h, void *data); |
65 | void * (*switch_buffer) (void *data, void *dest_buffer); | ||
63 | } func; | 66 | } func; |
64 | 67 | ||
65 | struct { | 68 | struct { |
@@ -74,12 +77,15 @@ void evas_buffer_outbuf_buf_free (Outbuf *buf); | |||
74 | 77 | ||
75 | Outbuf *evas_buffer_outbuf_buf_setup_fb (int w, int h, Outbuf_Depth depth, void *dest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level, | 78 | Outbuf *evas_buffer_outbuf_buf_setup_fb (int w, int h, Outbuf_Depth depth, void *dest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level, |
76 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes), | 79 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes), |
77 | void (*free_update_region) (int x, int y, int w, int h, void *data)); | 80 | void (*free_update_region) (int x, int y, int w, int h, void *data), |
81 | void * (*switch_buffer)(void *switch_data, void *dest), | ||
82 | void *switch_data); | ||
78 | 83 | ||
79 | 84 | ||
80 | RGBA_Image *evas_buffer_outbuf_buf_new_region_for_update (Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); | 85 | RGBA_Image *evas_buffer_outbuf_buf_new_region_for_update (Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); |
81 | void evas_buffer_outbuf_buf_free_region_for_update (Outbuf *buf, RGBA_Image *update); | 86 | void evas_buffer_outbuf_buf_free_region_for_update (Outbuf *buf, RGBA_Image *update); |
82 | void evas_buffer_outbuf_buf_push_updated_region (Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h); | 87 | void evas_buffer_outbuf_buf_push_updated_region (Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h); |
88 | void evas_buffer_outbuf_buf_switch_buffer (Outbuf *buf); | ||
83 | 89 | ||
84 | #endif | 90 | #endif |
85 | 91 | ||
diff --git a/libraries/evas/src/modules/engines/buffer/evas_outbuf.c b/libraries/evas/src/modules/engines/buffer/evas_outbuf.c index 27f7a2c..0fa1842 100644 --- a/libraries/evas/src/modules/engines/buffer/evas_outbuf.c +++ b/libraries/evas/src/modules/engines/buffer/evas_outbuf.c | |||
@@ -19,11 +19,12 @@ evas_buffer_outbuf_buf_free(Outbuf *buf) | |||
19 | Outbuf * | 19 | Outbuf * |
20 | evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level, | 20 | evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, int dest_row_bytes, int use_color_key, DATA32 color_key, int alpha_level, |
21 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes), | 21 | void * (*new_update_region) (int x, int y, int w, int h, int *row_bytes), |
22 | void (*free_update_region) (int x, int y, int w, int h, void *data) | 22 | void (*free_update_region) (int x, int y, int w, int h, void *data), |
23 | void * (*switch_buffer) (void *data, void *dest_buffer), | ||
24 | void *switch_data | ||
23 | ) | 25 | ) |
24 | { | 26 | { |
25 | Outbuf *buf; | 27 | Outbuf *buf; |
26 | int bpp; | ||
27 | 28 | ||
28 | buf = calloc(1, sizeof(Outbuf)); | 29 | buf = calloc(1, sizeof(Outbuf)); |
29 | if (!buf) return NULL; | 30 | if (!buf) return NULL; |
@@ -38,14 +39,12 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in | |||
38 | buf->alpha_level = alpha_level; | 39 | buf->alpha_level = alpha_level; |
39 | buf->color_key = color_key; | 40 | buf->color_key = color_key; |
40 | buf->use_color_key = use_color_key; | 41 | buf->use_color_key = use_color_key; |
42 | buf->first_frame = 1; | ||
41 | 43 | ||
42 | buf->func.new_update_region = new_update_region; | 44 | buf->func.new_update_region = new_update_region; |
43 | buf->func.free_update_region = free_update_region; | 45 | buf->func.free_update_region = free_update_region; |
44 | 46 | buf->func.switch_buffer = switch_buffer; | |
45 | bpp = sizeof(DATA32); | 47 | buf->switch_data = switch_data; |
46 | if ((buf->depth == OUTBUF_DEPTH_RGB_24BPP_888_888) || | ||
47 | (buf->depth == OUTBUF_DEPTH_BGR_24BPP_888_888)) | ||
48 | bpp = 3; | ||
49 | 48 | ||
50 | if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) && | 49 | if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) && |
51 | (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) | 50 | (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) |
@@ -102,6 +101,24 @@ evas_buffer_outbuf_buf_free_region_for_update(Outbuf *buf, RGBA_Image *update) | |||
102 | } | 101 | } |
103 | 102 | ||
104 | void | 103 | void |
104 | evas_buffer_outbuf_buf_switch_buffer(Outbuf *buf) | ||
105 | { | ||
106 | if (buf->func.switch_buffer) | ||
107 | { | ||
108 | buf->dest = buf->func.switch_buffer(buf->switch_data, buf->dest); | ||
109 | if (buf->priv.back_buf) | ||
110 | { | ||
111 | evas_cache_image_drop(&buf->priv.back_buf->cache_entry); | ||
112 | buf->priv.back_buf = (RGBA_Image *) evas_cache_image_data(evas_common_image_cache_get(), | ||
113 | buf->w, buf->h, | ||
114 | buf->dest, | ||
115 | buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888 ? 1 : 0, | ||
116 | EVAS_COLORSPACE_ARGB8888); | ||
117 | } | ||
118 | } | ||
119 | } | ||
120 | |||
121 | void | ||
105 | evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h) | 122 | evas_buffer_outbuf_buf_push_updated_region(Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h) |
106 | { | 123 | { |
107 | /* copy update image to out buf & convert */ | 124 | /* copy update image to out buf & convert */ |