| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 5 #ifndef UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
| 6 #define UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 6 #define UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // being referenced from the callback, the only robust way here is to create | 30 // being referenced from the callback, the only robust way here is to create |
| 31 // the callback from a weak pointer to your object. | 31 // the callback from a weak pointer to your object. |
| 32 void SetFrameAvailableCallback(const base::Closure& callback); | 32 void SetFrameAvailableCallback(const base::Closure& callback); |
| 33 | 33 |
| 34 // Set the listener callback, but allow it to be invoked on any thread. The | 34 // Set the listener callback, but allow it to be invoked on any thread. The |
| 35 // same caveats apply as SetFrameAvailableCallback, plus whatever other issues | 35 // same caveats apply as SetFrameAvailableCallback, plus whatever other issues |
| 36 // show up due to multithreading (e.g., don't bind the Closure to a method | 36 // show up due to multithreading (e.g., don't bind the Closure to a method |
| 37 // via a weak ref). | 37 // via a weak ref). |
| 38 void SetFrameAvailableCallbackOnAnyThread(const base::Closure& callback); | 38 void SetFrameAvailableCallbackOnAnyThread(const base::Closure& callback); |
| 39 | 39 |
| 40 // Set the listener callback on a thread that is run on a thread that is |
| 41 // dedicated to frame available callbacks. This thread will be shared with |
| 42 // other frame available callbacks. This is used for WebView, when the |
| 43 // callback normally comes in on the main thread, but the main thread is |
| 44 // busy doing composition. |
| 45 // This requires API level 21 or later. |
| 46 void SetFrameAvailableCallbackOnSeparateThread(const base::Closure& callback); |
| 47 |
| 40 // Update the texture image to the most recent frame from the image stream. | 48 // Update the texture image to the most recent frame from the image stream. |
| 41 void UpdateTexImage(); | 49 void UpdateTexImage(); |
| 42 | 50 |
| 43 // Retrieve the 4x4 texture coordinate transform matrix associated with the | 51 // Retrieve the 4x4 texture coordinate transform matrix associated with the |
| 44 // texture image set by the most recent call to updateTexImage. | 52 // texture image set by the most recent call to updateTexImage. |
| 45 void GetTransformMatrix(float mtx[16]); | 53 void GetTransformMatrix(float mtx[16]); |
| 46 | 54 |
| 47 // Attach the SurfaceTexture to the texture currently bound to | 55 // Attach the SurfaceTexture to the texture currently bound to |
| 48 // GL_TEXTURE_EXTERNAL_OES. | 56 // GL_TEXTURE_EXTERNAL_OES. |
| 49 void AttachToGLContext(); | 57 void AttachToGLContext(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 | 81 |
| 74 // Java SurfaceTexture instance. | 82 // Java SurfaceTexture instance. |
| 75 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; | 83 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; |
| 76 | 84 |
| 77 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); | 85 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); |
| 78 }; | 86 }; |
| 79 | 87 |
| 80 } // namespace gfx | 88 } // namespace gfx |
| 81 | 89 |
| 82 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 90 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
| OLD | NEW |