I try to use SurfaceView to render something. And I pass the surface by AIDL, from Process A -> Process B -> Process A. After that I use this surface to render something. It's always successful the first time. But when I tried to reuse this surface, I got this error. For example:
- pass the surface from Process A -> Process B(save it) -> Process A -> use it to render something(OK)
- pass the surface(save before) from Process B -> Process A -> use it to render something(got error)
Could anyone tell me why?
PS: It works fine if I don't pass the surface to Process B and do everything in Process A.
In process A:
Canvas canvas = surface.lockCanvas(null);
draw something ...
surface.unlockCanvasAndPost(canvas);