# HG changeset patch # User Thinker K.F. Li # Date 1259679327 -28800 # Node ID 6394a1e33b2f9dca6accc4d79e40fc635e9c358e # Parent d186d1e24458c30e0bb9006312f53a6088589994 Rewind/reset path and subpath. In previously, only path was reseted for a new path. But, subpath should also be reseted/rewinded for first relative moveto. diff -r d186d1e24458 -r 6394a1e33b2f src/graph_engine_skia.cpp --- a/src/graph_engine_skia.cpp Tue Dec 01 22:55:27 2009 +0800 +++ b/src/graph_engine_skia.cpp Tue Dec 01 22:55:27 2009 +0800 @@ -584,7 +584,8 @@ } void mbe_new_path(mbe_t *canvas) { - canvas->subpath->reset(); + canvas->subpath->rewind(); + canvas->path->rewind(); } void mbe_curve_to(mbe_t *canvas, co_aix x1, co_aix y1, @@ -650,7 +651,8 @@ _finish_paint(canvas); - path->reset(); + path->rewind(); + canvas->subpath->rewind(); } /*! \brief Create a mbe from a SkCanvas. @@ -771,7 +773,8 @@ void mbe_fill(mbe_t *canvas) { mbe_fill_preserve(canvas); - canvas->path->reset(); + canvas->path->rewind(); + canvas->subpath->rewind(); } void mbe_clip(mbe_t *canvas) { @@ -779,7 +782,8 @@ _update_path(canvas); canvas->canvas->clipPath(*canvas->path, SkRegion::kIntersect_Op); - canvas->path->reset(); + canvas->path->rewind(); + canvas->subpath->rewind(); } mbe_font_face_t * mbe_query_font_face(const char *family, @@ -794,24 +798,19 @@ void mbe_copy_source(mbe_t *src, mbe_t *dst) { SkPaint *paint = dst->paint; - SkShader *shader; - SkBitmap *bmap; + const SkBitmap *bmap; SkXfermode *mode; - _prepare_paint(dst, SkPaint::kFill_Style); + /* _prepare_paint(dst, SkPaint::kFill_Style); */ mode = SkPorterDuff::CreateXfermode(SkPorterDuff::kSrc_Mode); paint->setXfermode(mode); + bmap = &src->canvas->getDevice()->accessBitmap(false); + + dst->canvas->drawBitmap(*bmap, 0, 0, paint); + + paint->reset(); mode->unref(); - bmap = &src->canvas->getDevice()->accessBitmap(false); - shader = SkShader::CreateBitmapShader(*bmap, - SkShader::kClamp_TileMode , - SkShader::kClamp_TileMode); - paint->setShader(shader); - shader->unref(); - - dst->canvas->drawPaint(*paint); - - _finish_paint(canvas); + /* _finish_paint(dst); */ } void mbe_transform(mbe_t *mbe, co_aix matrix[6]) {