changeset 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 8d70dbb70d38
children b8c83fd0c323
files include/mb_graph_engine_openvg.h src/graph_engine_openvg.c
diffstat 2 files changed, 31 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/include/mb_graph_engine_openvg.h	Wed Dec 01 21:46:49 2010 +0800
+++ b/include/mb_graph_engine_openvg.h	Wed Dec 01 23:00:36 2010 +0800
@@ -228,14 +228,19 @@
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
-extern mbe_surface_t *mbe_vg_win_surface_create(Display *display,
-						Drawable drawable,
-						Visual *visual,
-						int width, int height);
+extern mbe_surface_t *mbe_win_surface_create(Display *display,
+					     Drawable drawable,
+					     Visual *visual,
+					     int width, int height);
 #endif
 
 extern mbe_surface_t *mbe_image_surface_create(mb_img_fmt_t fmt,
 					       int w, int h);
+extern mbe_surface_t *
+mbe_image_surface_create_for_data(unsigned char *data,
+				  mb_img_fmt_t fmt,
+				  int width, int height,
+				  int stride);
 extern void mbe_surface_destroy(mbe_surface_t *surface);
 
 extern void mbe_copy_source(mbe_t *src_canvas, mbe_t *dst_canvas);
--- a/src/graph_engine_openvg.c	Wed Dec 01 21:46:49 2010 +0800
+++ b/src/graph_engine_openvg.c	Wed Dec 01 23:00:36 2010 +0800
@@ -8,6 +8,16 @@
 #define ASSERT(x)
 #endif
 
+#ifndef ERR
+#include <stdio.h>
+#include <stdlib.h>
+#define ERR(msg) do { fprintf(stderr, __FILE__ ":%d: %s", __LINE__, msg); abort(); } while(0)
+#endif
+#ifndef NOT_IMPLEMENT
+#define NOT_IMPLEMENT(func)			\
+    ERR(func " is not impmemented\n")
+#endif
+
 #define MB_2_VG_COLOR(r, g, b, a) ((((int)(0xf * r) & 0xf) << 24) |	\
 				   (((int)(0xf * g) & 0xf) << 16) |	\
 				   (((int)(0xf * b) & 0xf) << 16) |	\
@@ -148,6 +158,7 @@
  */
 static void
 _ge_vg_img_deactivate_for_surface(void *obj) {
+    NOT_IMPLEMENT("_ge_vg_img_deactivate_for_surface");
 }
 
 /*! \brief Activate a VGImage for a surface
@@ -538,8 +549,8 @@
  * This function is compiled only for GLX enabled.
  */
 mbe_surface_t *
-mbe_vg_win_surface_create(Display *display, Drawable drawable,
-			  Visual *visual, int width, int height) {
+mbe_win_surface_create(Display *display, Drawable drawable,
+		       Visual *visual, int width, int height) {
     EGLDisplay egl_disp;
     EGLSurface egl_surface;
     mbe_surface_t *surface;
@@ -628,6 +639,15 @@
     return mbe_surface;
 }
 
+mbe_surface_t *
+mbe_image_surface_create_for_data(unsigned char *data,
+				  mb_img_fmt_t fmt,
+				  int width, int height,
+				  int stride) {
+    NOT_IMPLEMENT("mbe_image_surface_create_for_data");
+    return NULL;
+}
+
 void
 mbe_surface_destroy(mbe_surface_t *surface) {
     EGLDisplay display;