forked from len0rd/rockbox
Pass the framebuffer to the service in the constructor rather than later from native code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28411 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2d05d2f9da
commit
bf63f24168
2 changed files with 2 additions and 5 deletions
|
@ -40,7 +40,6 @@ public class RockboxFramebuffer extends View
|
||||||
int lcd_height, ByteBuffer native_fb)
|
int lcd_height, ByteBuffer native_fb)
|
||||||
{
|
{
|
||||||
super(c);
|
super(c);
|
||||||
|
|
||||||
/* Needed so we can catch KeyEvents */
|
/* Needed so we can catch KeyEvents */
|
||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
setFocusableInTouchMode(true);
|
setFocusableInTouchMode(true);
|
||||||
|
@ -48,6 +47,8 @@ public class RockboxFramebuffer extends View
|
||||||
btm = Bitmap.createBitmap(lcd_width, lcd_height, Bitmap.Config.RGB_565);
|
btm = Bitmap.createBitmap(lcd_width, lcd_height, Bitmap.Config.RGB_565);
|
||||||
native_buf = native_fb;
|
native_buf = native_fb;
|
||||||
requestFocus();
|
requestFocus();
|
||||||
|
/* the service needs to know the about us */
|
||||||
|
((RockboxService)c).set_fb(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDraw(Canvas c)
|
public void onDraw(Canvas c)
|
||||||
|
|
|
@ -77,10 +77,6 @@ void lcd_init_device(void)
|
||||||
RockboxFramebuffer_class,
|
RockboxFramebuffer_class,
|
||||||
"java_lcd_update_rect",
|
"java_lcd_update_rect",
|
||||||
"(IIII)V");
|
"(IIII)V");
|
||||||
|
|
||||||
jmethodID fbsetter = e->GetMethodID(env_ptr,RockboxService_class,
|
|
||||||
"set_fb", "(Lorg/rockbox/RockboxFramebuffer;)V");
|
|
||||||
e->CallVoidMethod(env_ptr, RockboxService_instance, fbsetter, RockboxFramebuffer_instance);
|
|
||||||
display_on = true;
|
display_on = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue