Merge "Fix sample bitmap-plasma to draw on whole screen"
This commit is contained in:
@@ -21,6 +21,8 @@ import android.content.Context;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
|
import android.view.Display;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
public class Plasma extends Activity
|
public class Plasma extends Activity
|
||||||
{
|
{
|
||||||
@@ -29,7 +31,8 @@ public class Plasma extends Activity
|
|||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(new PlasmaView(this));
|
Display display = getWindowManager().getDefaultDisplay();
|
||||||
|
setContentView(new PlasmaView(this, display.getWidth(), display.getHeight()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* load our native library */
|
/* load our native library */
|
||||||
@@ -45,13 +48,9 @@ class PlasmaView extends View {
|
|||||||
/* implementend by libplasma.so */
|
/* implementend by libplasma.so */
|
||||||
private static native void renderPlasma(Bitmap bitmap, long time_ms);
|
private static native void renderPlasma(Bitmap bitmap, long time_ms);
|
||||||
|
|
||||||
public PlasmaView(Context context) {
|
public PlasmaView(Context context, int width, int height) {
|
||||||
super(context);
|
super(context);
|
||||||
|
mBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
|
||||||
final int W = 200;
|
|
||||||
final int H = 200;
|
|
||||||
|
|
||||||
mBitmap = Bitmap.createBitmap(W, H, Bitmap.Config.RGB_565);
|
|
||||||
mStartTime = System.currentTimeMillis();
|
mStartTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user