Mercurial > MadButterfly
diff Android/java/org/madbutterfly/MBView.java @ 505:c468e397614d Android_Skia
Fix issue of initialize rdman and add shape::stroke_width().
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 01 Dec 2009 22:55:26 +0800 |
parents | 2d7df44e6299 |
children |
line wrap: on
line diff
--- a/Android/java/org/madbutterfly/MBView.java Tue Dec 01 22:55:26 2009 +0800 +++ b/Android/java/org/madbutterfly/MBView.java Tue Dec 01 22:55:26 2009 +0800 @@ -29,6 +29,8 @@ mode = new PorterDuffXfermode(PorterDuff.Mode.SRC); copy_pnt = new Paint(); copy_pnt.setXfermode(mode); + w = 100; + h = 100; } public redraw_man get_rdman() { @@ -51,6 +53,12 @@ protected void onSizeChanged(int w, int h, int oldw, int oldh) { this.w = w; this.h = h; + + if(rdman == null) { + get_rdman(); + return; + } + cr_bmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); cr.setBitmap(cr_bmap); backend_bmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); @@ -64,5 +72,6 @@ holder = getHolder(); canvas = holder.lockCanvas(); canvas.drawBitmap(backend_bmap, 0, 0, copy_pnt); + holder.unlockCanvasAndPost(canvas); } }