Kaydet (Commit) 754bd309 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

BitmapView can be a member class

Change-Id: I172cfc0bcad780e99469ac01c9ba7467befe53de
üst 1fd796f0
...@@ -287,31 +287,28 @@ public class Desktop ...@@ -287,31 +287,28 @@ public class Desktop
} }
Log.i(TAG, "onCreate - set content view\n"); Log.i(TAG, "onCreate - set content view\n");
setContentView(new BitmapView(this, this)); setContentView(new BitmapView());
} }
}
class BitmapView extends android.view.View class BitmapView extends android.view.View
{ {
Desktop mDesktop;
Bitmap mBitmap; Bitmap mBitmap;
public BitmapView(Context context, Desktop desktop) public BitmapView()
{ {
super(context); super(Desktop.this);
mDesktop = desktop;
mBitmap = Bitmap.createBitmap(1000, 600, Bitmap.Config.ARGB_8888); mBitmap = Bitmap.createBitmap(1000, 600, Bitmap.Config.ARGB_8888);
} }
@Override protected void onDraw(Canvas canvas) { @Override protected void onDraw(Canvas canvas) {
// canvas.drawColor(0xFF1ABCDD); // canvas.drawColor(0xFF1ABCDD);
mDesktop.renderVCL(mBitmap); renderVCL(mBitmap);
canvas.drawBitmap(mBitmap, 0, 0, null); canvas.drawBitmap(mBitmap, 0, 0, null);
// re-call ourselves a bit later ... // re-call ourselves a bit later ...
invalidate(); invalidate();
} }
} }
}
// vim:set shiftwidth=4 softtabstop=4 expandtab: // vim:set shiftwidth=4 softtabstop=4 expandtab:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment