Mercurial > MadButterfly
comparison src/X_supp.c @ 471:e98ae1407ca2 Android_Skia
Remove mbe_set_source_surface() from graphic engine.
Since mbe_set_source() and mbe_pattern_create_for_surface() can
replace mbe_set_source_surface(), mbe_set_source_surface() is removed
to reduce number of functions in graphic engine layer.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 12 Nov 2009 21:31:14 +0800 |
parents | af4b506ad56f |
children | d687d3395264 |
comparison
equal
deleted
inserted
replaced
470:e54cd19cec28 | 471:e98ae1407ca2 |
---|---|
35 struct _X_MB_runtime { | 35 struct _X_MB_runtime { |
36 Display *display; | 36 Display *display; |
37 Window win; | 37 Window win; |
38 Visual *visual; | 38 Visual *visual; |
39 mbe_surface_t *surface, *backend_surface; | 39 mbe_surface_t *surface, *backend_surface; |
40 mbe_pattern_t *surface_ptn; | |
40 mbe_t *cr, *backend_cr; | 41 mbe_t *cr, *backend_cr; |
41 redraw_man_t *rdman; | 42 redraw_man_t *rdman; |
42 mb_tman_t *tman; | 43 mb_tman_t *tman; |
43 mb_img_ldr_t *img_ldr; | 44 mb_img_ldr_t *img_ldr; |
44 int w, h; | 45 int w, h; |
464 X_init_connection(display_name, w, h, &xmb_rt->display, | 465 X_init_connection(display_name, w, h, &xmb_rt->display, |
465 &xmb_rt->visual, &xmb_rt->win); | 466 &xmb_rt->visual, &xmb_rt->win); |
466 | 467 |
467 xmb_rt->surface = | 468 xmb_rt->surface = |
468 mbe_image_surface_create(MB_IFMT_ARGB32, w, h); | 469 mbe_image_surface_create(MB_IFMT_ARGB32, w, h); |
470 | |
471 xmb_rt->surface_ptn = | |
472 mbe_pattern_create_for_surface(xmb_rt->surface); | |
469 | 473 |
470 xmb_rt->backend_surface = | 474 xmb_rt->backend_surface = |
471 mbe_xlib_surface_create(xmb_rt->display, | 475 mbe_xlib_surface_create(xmb_rt->display, |
472 xmb_rt->win, | 476 xmb_rt->win, |
473 xmb_rt->visual, | 477 xmb_rt->visual, |
474 w, h); | 478 w, h); |
475 | 479 |
476 xmb_rt->cr = mbe_create(xmb_rt->surface); | 480 xmb_rt->cr = mbe_create(xmb_rt->surface); |
477 xmb_rt->backend_cr = mbe_create(xmb_rt->backend_surface); | 481 xmb_rt->backend_cr = mbe_create(xmb_rt->backend_surface); |
478 | 482 |
479 mbe_set_source_surface(xmb_rt->backend_cr, xmb_rt->surface, 0, 0); | 483 mbe_set_source(xmb_rt->backend_cr, xmb_rt->surface_ptn); |
480 | 484 |
481 xmb_rt->rdman = (redraw_man_t *)malloc(sizeof(redraw_man_t)); | 485 xmb_rt->rdman = (redraw_man_t *)malloc(sizeof(redraw_man_t)); |
482 redraw_man_init(xmb_rt->rdman, xmb_rt->cr, xmb_rt->backend_cr); | 486 redraw_man_init(xmb_rt->rdman, xmb_rt->cr, xmb_rt->backend_cr); |
483 // FIXME: This is a wired loopback reference. This is inly required when we need | 487 // FIXME: This is a wired loopback reference. This is inly required when we need |
484 // to get the xmb_rt->tman for the animation. We should relocate the tman | 488 // to get the xmb_rt->tman for the animation. We should relocate the tman |
520 if(xmb_rt->backend_cr) | 524 if(xmb_rt->backend_cr) |
521 mbe_destroy(xmb_rt->backend_cr); | 525 mbe_destroy(xmb_rt->backend_cr); |
522 | 526 |
523 if(xmb_rt->surface) | 527 if(xmb_rt->surface) |
524 mbe_surface_destroy(xmb_rt->surface); | 528 mbe_surface_destroy(xmb_rt->surface); |
529 if(xmb_rt->surface_ptn) | |
530 mbe_pattern_destroy(xmb_rt->surface_ptn); | |
525 if(xmb_rt->backend_surface) | 531 if(xmb_rt->backend_surface) |
526 mbe_surface_destroy(xmb_rt->backend_surface); | 532 mbe_surface_destroy(xmb_rt->backend_surface); |
527 | 533 |
528 if(xmb_rt->display) | 534 if(xmb_rt->display) |
529 XCloseDisplay(xmb_rt->display); | 535 XCloseDisplay(xmb_rt->display); |