diff options
Diffstat (limited to 'ui')
-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. |