|
Posted at 4/26/2016 16:43:24
Only Author
3#
RE: Android Dev : surfaceview / thread / canvas
Hi,
thank you for your help.
I have try Android 5.1 and the result is worse ... i can back to 4.4 (mars 2016 the last one).
What i do is develop android application in witch i want to display a 360° panorama 'turning at a given velocity".
For that i have a SurfaceView, surfaceholder and a thread.
the thread run is like :
public void run() {
Canvas c;
while(run){
c=null;
try{
c=surfaceholder.lockCanvas(null);
synchronized( surfaceholder){
surf.draw(c);
}
}finally{
if (c!=null){
surfaceholder.unlockCanvasAndPost(c);
}
}
}
}in the draw function i have :
canvas.drawBitmap(bipmap, src , dst, null) ;
the bitmap hold the 360° panorama,
src is a rect that move everuy call to draw function and dst is a fixed rect on all screen.
On a RK3188+Mali400 it runs perfectly with a very nice smooth motion (time between to call to
draw is stable and is 16ms).
On firefly the time between to calls are between 25 and 35 ms without stability creating saccades
movement.
If i remove he DrawBitmap call and replace by a simple canvas draw call the time between to calls
came back to 16ms ... so i suspect the drawbitmap call is the problem (memory access ?)...
|
|