|
|
@@ -1,5 +1,3 @@
|
|
|
-/* this file is only on purpose of store a structure which wrap NVGcontext into VGLcontext,
|
|
|
- and let every source file to include this file to retain this structure.*/
|
|
|
|
|
|
BEGIN_C_DECLS
|
|
|
#include "vg_lite.h"
|
|
|
@@ -8,47 +6,38 @@ BEGIN_C_DECLS
|
|
|
#define __func__ __FUNCTION__
|
|
|
|
|
|
/*vg lite gpu use vg_lite_color_t as default color format, which is in sequence of ABGR*/
|
|
|
-#define RGBA2ABGR(x) (((uint32_t)(x.a*255))<<24|((uint32_t)(x.b*255))<<16|((uint32_t)(x.g*255))<<8|((uint32_t)(x.r*255)))
|
|
|
-#define RGBA2ARGB(x) (((uint32_t)(x.a*255))<<24|((uint32_t)(x.r*255))<<16|((uint32_t)(x.g*255))<<8|((uint32_t)(x.b*255)))
|
|
|
-
|
|
|
-static char *error_type[] =
|
|
|
-{
|
|
|
- "VG_LITE_SUCCESS",
|
|
|
- "VG_LITE_INVALID_ARGUMENT",
|
|
|
- "VG_LITE_OUT_OF_MEMORY",
|
|
|
- "VG_LITE_NO_CONTEXT",
|
|
|
- "VG_LITE_TIMEOUT",
|
|
|
- "VG_LITE_OUT_OF_RESOURCES",
|
|
|
- "VG_LITE_GENERIC_IO",
|
|
|
- "VG_LITE_NOT_SUPPORT",
|
|
|
+#define RGBA2ABGR(x) (((uint32_t)(x.a * 255)) << 24 | ((uint32_t)(x.b * 255)) << 16 | ((uint32_t)(x.g * 255)) << 8 | ((uint32_t)(x.r * 255)))
|
|
|
+#define RGBA2ARGB(x) (((uint32_t)(x.a * 255)) << 24 | ((uint32_t)(x.r * 255)) << 16 | ((uint32_t)(x.g * 255)) << 8 | ((uint32_t)(x.b * 255)))
|
|
|
+
|
|
|
+static char* error_type[] = {
|
|
|
+ "VG_LITE_SUCCESS", "VG_LITE_INVALID_ARGUMENT", "VG_LITE_OUT_OF_MEMORY", "VG_LITE_NO_CONTEXT",
|
|
|
+ "VG_LITE_TIMEOUT", "VG_LITE_OUT_OF_RESOURCES", "VG_LITE_GENERIC_IO", "VG_LITE_NOT_SUPPORT",
|
|
|
};
|
|
|
|
|
|
-#define IS_ERROR(status) (status > 0)
|
|
|
-#define CHECK_ERROR(Function) \
|
|
|
- error = Function; \
|
|
|
- if (IS_ERROR(error)) \
|
|
|
- { \
|
|
|
- printf("[%s: %d] failed.error type is %s\n", __func__, __LINE__,error_type[error]);\
|
|
|
- }
|
|
|
+#define IS_ERROR(status) (status > 0)
|
|
|
+#define CHECK_ERROR(Function) \
|
|
|
+ error = Function; \
|
|
|
+ if (IS_ERROR(error)) { \
|
|
|
+ printf("[%s: %d] failed.error type is %s\n", __func__, __LINE__, error_type[error]); \
|
|
|
+ vglite_restart(); \
|
|
|
+ }
|
|
|
|
|
|
-typedef struct _VGLcontext{
|
|
|
- void* abc;
|
|
|
- }VGLcontext;
|
|
|
+void vglite_restart();
|
|
|
|
|
|
-vg_lite_buffer_t* vglite_offlinefb_wrapper( uint8_t* offline_fb);
|
|
|
+vg_lite_buffer_t* vglite_offlinefb_wrapper(uint8_t* offline_fb);
|
|
|
|
|
|
int vglite_global_orientation_caller(void);
|
|
|
|
|
|
-vg_lite_buffer_t *vglite_get_render_target();
|
|
|
+vg_lite_buffer_t* vglite_get_render_target();
|
|
|
|
|
|
-vg_lite_buffer_t *vglite_get_g2dfb(void);
|
|
|
+vg_lite_buffer_t* vglite_get_g2dfb(void);
|
|
|
|
|
|
-void *vglite_get_path_cache(void);
|
|
|
+void* vglite_get_path_cache(void);
|
|
|
|
|
|
-vg_lite_buffer_t *vglite_get_imgfb(uint8_t* address, uint32_t width, uint32_t height, uint32_t stride, vg_lite_buffer_format_t format);
|
|
|
+vg_lite_buffer_t* vglite_get_imgfb(uint8_t* address, uint32_t width, uint32_t height, uint32_t stride, vg_lite_buffer_format_t format);
|
|
|
|
|
|
-int vglite_set_image(vg_lite_buffer_t *buffer, uint8_t *imm_array, int32_t width, int32_t height, int32_t stride, vg_lite_buffer_format_t format);
|
|
|
+int vglite_set_image(vg_lite_buffer_t* buffer, uint8_t* imm_array, int32_t width, int32_t height, int32_t stride, vg_lite_buffer_format_t format);
|
|
|
|
|
|
-void vglite_buffer_wrapper(vg_lite_buffer_t *buffer, uint32_t address, int32_t width, int32_t height, int32_t stride, vg_lite_buffer_format_t format);
|
|
|
+void vglite_buffer_wrapper(vg_lite_buffer_t* buffer, uint32_t address, int32_t width, int32_t height, int32_t stride, vg_lite_buffer_format_t format);
|
|
|
|
|
|
END_C_DECLS
|