diff options
author | sievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-16 01:43:11 +0000 |
---|---|---|
committer | sievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-16 01:43:11 +0000 |
commit | 3af832f9c543e7866d375ba326fe659b6f3df939 (patch) | |
tree | 186aa2702ef0a9b9a3747e5418c739795e6e2feb /ui/gl | |
parent | 53f69d34794123f3bf3bc88698b665bfcb78ab29 (diff) | |
download | chromium_src-3af832f9c543e7866d375ba326fe659b6f3df939.zip chromium_src-3af832f9c543e7866d375ba326fe659b6f3df939.tar.gz chromium_src-3af832f9c543e7866d375ba326fe659b6f3df939.tar.bz2 |
Android: Make surface texture transport cmdbuffer-compatible.
NOTRY=True
However, running WebView (which uses single-process mode) with the browser compositor still seems to not work with cmdbuffer clients. (For example, there are problems with having multiple service threads in the same process, i.e. from render and browser compositor). Not investigating further for now, since this codepath will be deprecated shortly in favor of merged threads (no browser compositor).
BUG=224665,166777
Review URL: https://chromiumcodereview.appspot.com/14256014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200411 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rw-r--r-- | ui/gl/android/surface_texture_bridge.cc | 6 | ||||
-rw-r--r-- | ui/gl/android/surface_texture_bridge.h | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/ui/gl/android/surface_texture_bridge.cc b/ui/gl/android/surface_texture_bridge.cc index cd9d9e5..19ce2a7 100644 --- a/ui/gl/android/surface_texture_bridge.cc +++ b/ui/gl/android/surface_texture_bridge.cc @@ -13,6 +13,7 @@ #include "jni/SurfaceTexture_jni.h" #include "ui/gl/android/scoped_java_surface.h" #include "ui/gl/android/surface_texture_listener.h" +#include "ui/gl/gl_bindings.h" using base::android::AttachCurrentThread; using base::android::CheckException; @@ -123,8 +124,11 @@ void SurfaceTextureBridge::SetDefaultBufferSize(int width, int height) { } } -void SurfaceTextureBridge::AttachToGLContext(int texture_id) { +void SurfaceTextureBridge::AttachToGLContext() { if (GlContextMethodsAvailable()) { + int texture_id; + glGetIntegerv(GL_TEXTURE_BINDING_EXTERNAL_OES, &texture_id); + DCHECK(texture_id); JNIEnv* env = AttachCurrentThread(); // Note: This method is only available on JB and greater. JNI_SurfaceTexture::Java_SurfaceTexture_attachToGLContext( diff --git a/ui/gl/android/surface_texture_bridge.h b/ui/gl/android/surface_texture_bridge.h index 9363483..f3f3bcf 100644 --- a/ui/gl/android/surface_texture_bridge.h +++ b/ui/gl/android/surface_texture_bridge.h @@ -40,9 +40,9 @@ class GL_EXPORT SurfaceTextureBridge // Set the default size of the image buffers. void SetDefaultBufferSize(int width, int height); - // Attach the SurfaceTexture to the given texture in the GL context that is - // current on the calling thread. - void AttachToGLContext(int texture_id); + // Attach the SurfaceTexture to the texture currently bound to + // GL_TEXTURE_EXTERNAL_OES. + void AttachToGLContext(); // Detaches the SurfaceTexture from the context that owns its current GL // texture. Must be called with that context current on the calling thread. |