Mercurial > MadButterfly
comparison src/graph_engine_openvg.c @ 1077:e224f496e6b8 openvg
Add missed functions for openvg
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Wed, 01 Dec 2010 23:00:36 +0800 |
parents | bd18951b51d5 |
children | 394d7d4c0673 |
comparison
equal
deleted
inserted
replaced
1076:8d70dbb70d38 | 1077:e224f496e6b8 |
---|---|
4 EGLNativeDisplayType _ge_openvg_disp_id = EGL_DEFAULT_DISPLAY; | 4 EGLNativeDisplayType _ge_openvg_disp_id = EGL_DEFAULT_DISPLAY; |
5 mbe_t *_ge_openvg_current_canvas = NULL; | 5 mbe_t *_ge_openvg_current_canvas = NULL; |
6 | 6 |
7 #ifndef ASSERT | 7 #ifndef ASSERT |
8 #define ASSERT(x) | 8 #define ASSERT(x) |
9 #endif | |
10 | |
11 #ifndef ERR | |
12 #include <stdio.h> | |
13 #include <stdlib.h> | |
14 #define ERR(msg) do { fprintf(stderr, __FILE__ ":%d: %s", __LINE__, msg); abort(); } while(0) | |
15 #endif | |
16 #ifndef NOT_IMPLEMENT | |
17 #define NOT_IMPLEMENT(func) \ | |
18 ERR(func " is not impmemented\n") | |
9 #endif | 19 #endif |
10 | 20 |
11 #define MB_2_VG_COLOR(r, g, b, a) ((((int)(0xf * r) & 0xf) << 24) | \ | 21 #define MB_2_VG_COLOR(r, g, b, a) ((((int)(0xf * r) & 0xf) << 24) | \ |
12 (((int)(0xf * g) & 0xf) << 16) | \ | 22 (((int)(0xf * g) & 0xf) << 16) | \ |
13 (((int)(0xf * b) & 0xf) << 16) | \ | 23 (((int)(0xf * b) & 0xf) << 16) | \ |
146 * pattern of a paint, once associated surface is not current | 156 * pattern of a paint, once associated surface is not current |
147 * rendering context. | 157 * rendering context. |
148 */ | 158 */ |
149 static void | 159 static void |
150 _ge_vg_img_deactivate_for_surface(void *obj) { | 160 _ge_vg_img_deactivate_for_surface(void *obj) { |
161 NOT_IMPLEMENT("_ge_vg_img_deactivate_for_surface"); | |
151 } | 162 } |
152 | 163 |
153 /*! \brief Activate a VGImage for a surface | 164 /*! \brief Activate a VGImage for a surface |
154 * | 165 * |
155 * \sa _ge_openvg_img | 166 * \sa _ge_openvg_img |
536 /*! \brief Create an EGL window surface for X11. | 547 /*! \brief Create an EGL window surface for X11. |
537 * | 548 * |
538 * This function is compiled only for GLX enabled. | 549 * This function is compiled only for GLX enabled. |
539 */ | 550 */ |
540 mbe_surface_t * | 551 mbe_surface_t * |
541 mbe_vg_win_surface_create(Display *display, Drawable drawable, | 552 mbe_win_surface_create(Display *display, Drawable drawable, |
542 Visual *visual, int width, int height) { | 553 Visual *visual, int width, int height) { |
543 EGLDisplay egl_disp; | 554 EGLDisplay egl_disp; |
544 EGLSurface egl_surface; | 555 EGLSurface egl_surface; |
545 mbe_surface_t *surface; | 556 mbe_surface_t *surface; |
546 EGLConfig config; | 557 EGLConfig config; |
547 EGLint attrib_list[2] = {EGL_NONE}; | 558 EGLint attrib_list[2] = {EGL_NONE}; |
624 mbe_surface->asso_img = ge_img; | 635 mbe_surface->asso_img = ge_img; |
625 mbe_surface->w = w; | 636 mbe_surface->w = w; |
626 mbe_surface->h = h; | 637 mbe_surface->h = h; |
627 | 638 |
628 return mbe_surface; | 639 return mbe_surface; |
640 } | |
641 | |
642 mbe_surface_t * | |
643 mbe_image_surface_create_for_data(unsigned char *data, | |
644 mb_img_fmt_t fmt, | |
645 int width, int height, | |
646 int stride) { | |
647 NOT_IMPLEMENT("mbe_image_surface_create_for_data"); | |
648 return NULL; | |
629 } | 649 } |
630 | 650 |
631 void | 651 void |
632 mbe_surface_destroy(mbe_surface_t *surface) { | 652 mbe_surface_destroy(mbe_surface_t *surface) { |
633 EGLDisplay display; | 653 EGLDisplay display; |