# HG changeset patch # User Thinker K.F. Li # Date 1258273269 -28800 # Node ID 9a867333018b8e79d73fad2ca3e79806e0f40644 # Parent b27a3460c7bd5c7d391fb44f989e0b6cc0d536b5 mbe_create() and mbe_destroy() pass the compilation. This is the first time that MadButterfly Skia backend can be built without error. diff -r b27a3460c7bd -r 9a867333018b src/graph_engine_skia.cpp --- a/src/graph_engine_skia.cpp Thu Nov 12 21:34:31 2009 +0800 +++ b/src/graph_engine_skia.cpp Sun Nov 15 16:21:09 2009 +0800 @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -15,7 +15,7 @@ struct _mb_font_face_t *face; co_aix fnt_mtx[6]; co_aix ctm[6]; -} +}; struct _mbe_font_face_t {}; struct _mbe_t { SkCanvas *canvas; @@ -98,12 +98,18 @@ mbe_t *mbe_create(mbe_surface_t *target) { mbe_t *mbe; + SkBitmap *bitmap = (SkBitmap *)target; - mbe = malloc(sizeof(_mbe_t)); + mbe = (mbe_t *)malloc(sizeof(mbe_t)); if(mbe == NULL) return NULL; - mbe->canvas = new SkCanvas(target); + mbe->canvas = new SkCanvas(*bitmap); + if(mbe->canvas == NULL) { + free(mbe); + return NULL; + } + mbe->shader = NULL; mbe->shader_owned = 0; @@ -111,9 +117,9 @@ } void mbe_destroy(mbe_t *canvas) { - delete cnavas->canvas; - if(cnavas->shader && cnavas->shader_owned) - delete cnavas->shader; + delete canvas->canvas; + if(canvas->shader && canvas->shader_owned) + delete canvas->shader; free(canvas); }