3

Though I found a question about Sharing the GLES20 context..., I think my situation is a bit more broad.

I've got two GLSurfaceViews layered on each other in a FrameLayout. (One is Harism's CurlView from android_page_curl running as a library in my application. The other GLSurfaceView is my own.) Each GLSurfaceView is being run in its own thread.

I'm having inconsistent issues with displaying bitmaps on my GLSurfaceView. Sometimes the bitmap is drawn perfectly, and sometimes only parts of it are visible. I bet the two GLSurfaceViews are competing for access to the screen memory and trampling on each other.

To solve it, I was thinking I can just synchronize on an a singleton boolean in the application before calling onDrawFrame(), but after reading Threading lightly... I think I should be a bit more thoughtful.

On what object, and around what code should I synchronize to make the two overlayed GLSurfaceViews play nicely?

Community
  • 1
  • 1
Thunder Rabbit
  • 5,405
  • 8
  • 44
  • 82
  • Sorry I have no code samples at the moment. I'm writing from home without access to my work computer (I forgot to push to GitHub), and I'm trying to synchronize the posting of my question with when most SO users are awake. – Thunder Rabbit Jun 29 '11 at 15:37

1 Answers1

1

I ended up using a View over the GLSurfaceView, for reasons similar to those here

programmatically adding SurfaceView to a FrameLayout which is Z-ordered under ImageView

Community
  • 1
  • 1
Thunder Rabbit
  • 5,405
  • 8
  • 44
  • 82