Mercurial > MadButterfly
comparison 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 |
comparison
equal
deleted
inserted
replaced
504:28b9f3e84e2b | 505:c468e397614d |
---|---|
27 backend = null; | 27 backend = null; |
28 | 28 |
29 mode = new PorterDuffXfermode(PorterDuff.Mode.SRC); | 29 mode = new PorterDuffXfermode(PorterDuff.Mode.SRC); |
30 copy_pnt = new Paint(); | 30 copy_pnt = new Paint(); |
31 copy_pnt.setXfermode(mode); | 31 copy_pnt.setXfermode(mode); |
32 w = 100; | |
33 h = 100; | |
32 } | 34 } |
33 | 35 |
34 public redraw_man get_rdman() { | 36 public redraw_man get_rdman() { |
35 if(rdman != null) | 37 if(rdman != null) |
36 return rdman; | 38 return rdman; |
49 } | 51 } |
50 | 52 |
51 protected void onSizeChanged(int w, int h, int oldw, int oldh) { | 53 protected void onSizeChanged(int w, int h, int oldw, int oldh) { |
52 this.w = w; | 54 this.w = w; |
53 this.h = h; | 55 this.h = h; |
56 | |
57 if(rdman == null) { | |
58 get_rdman(); | |
59 return; | |
60 } | |
61 | |
54 cr_bmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); | 62 cr_bmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); |
55 cr.setBitmap(cr_bmap); | 63 cr.setBitmap(cr_bmap); |
56 backend_bmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); | 64 backend_bmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); |
57 backend.setBitmap(backend_bmap); | 65 backend.setBitmap(backend_bmap); |
58 } | 66 } |
62 Canvas canvas; | 70 Canvas canvas; |
63 | 71 |
64 holder = getHolder(); | 72 holder = getHolder(); |
65 canvas = holder.lockCanvas(); | 73 canvas = holder.lockCanvas(); |
66 canvas.drawBitmap(backend_bmap, 0, 0, copy_pnt); | 74 canvas.drawBitmap(backend_bmap, 0, 0, copy_pnt); |
75 holder.unlockCanvasAndPost(canvas); | |
67 } | 76 } |
68 } | 77 } |