summaryrefslogtreecommitdiff
path: root/android/src/org/rockbox/RockboxFramebuffer.java
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-10-29 23:12:08 +0000
committerThomas Martitz <kugel@rockbox.org>2010-10-29 23:12:08 +0000
commit6bb75228529382d59fda7bf455cf578766ed995e (patch)
tree90cf92c7c22ce31198c57568b00d240db513f7ab /android/src/org/rockbox/RockboxFramebuffer.java
parent669a327a2e6ee83795b0916e82e96ba4f2a44463 (diff)
Initialize (instantiate) RockboxFramebuffer from the C code like with the othe java objects.
Remove some @Override annotations to make the Java code build with certain javac versions. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28386 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android/src/org/rockbox/RockboxFramebuffer.java')
-rw-r--r--android/src/org/rockbox/RockboxFramebuffer.java21
1 files changed, 9 insertions, 12 deletions
diff --git a/android/src/org/rockbox/RockboxFramebuffer.java b/android/src/org/rockbox/RockboxFramebuffer.java
index 070ef5cbc9..e90eb86dbd 100644
--- a/android/src/org/rockbox/RockboxFramebuffer.java
+++ b/android/src/org/rockbox/RockboxFramebuffer.java
@@ -36,37 +36,34 @@ public class RockboxFramebuffer extends View
private Bitmap btm;
private ByteBuffer native_buf;
- public RockboxFramebuffer(Context c)
+ public RockboxFramebuffer(Context c, int lcd_width,
+ int lcd_height, ByteBuffer native_fb)
{
super(c);
- btm = null;
/* Needed so we can catch KeyEvents */
setFocusable(true);
setFocusableInTouchMode(true);
setClickable(true);
+ btm = Bitmap.createBitmap(lcd_width, lcd_height, Bitmap.Config.RGB_565);
+ native_buf = native_fb;
requestFocus();
}
public void onDraw(Canvas c)
{
- if (btm != null)
- c.drawBitmap(btm, 0.0f, 0.0f, null);
+ c.drawBitmap(btm, 0.0f, 0.0f, null);
}
- public void java_lcd_init(int lcd_width, int lcd_height, ByteBuffer native_fb)
- {
- btm = Bitmap.createBitmap(lcd_width, lcd_height, Bitmap.Config.RGB_565);
- native_buf = native_fb;
- }
-
- public void java_lcd_update()
+ @SuppressWarnings("unused")
+ private void java_lcd_update()
{
btm.copyPixelsFromBuffer(native_buf);
postInvalidate();
}
- public void java_lcd_update_rect(int x, int y, int w, int h)
+ @SuppressWarnings("unused")
+ private void java_lcd_update_rect(int x, int y, int w, int h)
{
/* can't copy a partial buffer */
btm.copyPixelsFromBuffer(native_buf);