0

I'm developing a concept-keyboard and I need to drop animated shadows on keys.

It is possible to use OpenGL ES while subclassing InputMethodService?

If I'd use a GLSurfaceView in onCreateInputView, will it conflict with the current visible activity if it uses OpenGL ES too?
Can be GLSurfaceView totally avoided by drawing offscreen?
Does Android support the use of multiple OpenGL ES contexts on different, but concurrent, activity?

I need Android 2.2 compatibility, so solutions like TextureView are not an option.

1 Answers1

1

Since nobody think this question deserve an answer or simply understood the possible issue, I did it myself.

I created a test activity which use a GlSurfaceView with some simple fragment shader and an EditText. Then I edited the SoftKeyboard sample from Android SDK to make it use a GlSurfaceView with another simple shader.

The test consists in launching the test activity and use the altered SoftKeyboard to type into the text box.

On Android 4.2 this works and both GlSurfaceView are rendered. On Android 2.3.3 this fails with this errors:

E/SurfaceFlinger(1556): createNormalSurfaceLocked() failed (Invalid argument)
W/WindowManager(1556): OutOfResourcesException creating surface
I/WindowManager(1556): Out of memory for surface! Looking for leaks...
W/WindowManager(1556): No leaked surfaces; killing applicatons!
W/ActivityManager(1556): Killing processes Free memory at adjustment 1

I was aware that the concurrency use of the video hardware (and its driver) may cause incompatibility but I'm not sure if this is due to the inability of early Android version to handle multiple OpenGL ES context or something else (memory amount, hardware, driver, ...)

One could investigate with NDK.

  • If you're happy with the results of your research so far, you can *accept* your answer with the green tick on the left. – Dan Hulme Mar 04 '14 at 14:33
  • I'd like to keep this as an open question. I'm quite busy right now but maybe I'll make some more test someday and definitely close. –  Mar 06 '14 at 11:21