Chromium Code Reviews| Index: ui/gl/android/surface_texture.h |
| diff --git a/ui/gl/android/surface_texture.h b/ui/gl/android/surface_texture.h |
| index 62e375f796f45959e1ca0de2e37b7144c5e66ba3..0540a948974c5746fffc655209971bd005039b19 100644 |
| --- a/ui/gl/android/surface_texture.h |
| +++ b/ui/gl/android/surface_texture.h |
| @@ -21,7 +21,9 @@ namespace gfx { |
| class GL_EXPORT SurfaceTexture |
| : public base::RefCountedThreadSafe<SurfaceTexture>{ |
| public: |
| - explicit SurfaceTexture(int texture_id); |
| + static scoped_refptr<SurfaceTexture> Create(int texture_id); |
| + |
| + static scoped_refptr<SurfaceTexture> CreateSingleBuffered(int texture_id); |
| // Set the listener callback, which will be invoked on the same thread that |
| // is being called from here for registration. |
| @@ -33,6 +35,11 @@ class GL_EXPORT SurfaceTexture |
| // Update the texture image to the most recent frame from the image stream. |
| void UpdateTexImage(); |
| + // Release the texture content. This is needed, and supported only in single |
| + // buffered mode to allow the image content producer to take ownership |
| + // of the image buffer. |
|
bulach
2014/03/11 16:13:17
nit: I'd be even more explicit:
this is *only* sup
|
| + void ReleaseTexImage(); |
| + |
| // Retrieve the 4x4 texture coordinate transform matrix associated with the |
| // texture image set by the most recent call to updateTexImage. |
| void GetTransformMatrix(float mtx[16]); |
| @@ -57,8 +64,14 @@ class GL_EXPORT SurfaceTexture |
| return j_surface_texture_; |
| } |
| + static bool IsSingleBufferModeSupported(); |
|
bulach
2014/03/11 16:13:17
nit: hmm... do we need a non-static method too?
I
|
| + |
| static bool RegisterSurfaceTexture(JNIEnv* env); |
| + protected: |
| + explicit SurfaceTexture( |
| + const base::android::ScopedJavaLocalRef<jobject>& j_surface_texture); |
| + |
| private: |
| friend class base::RefCountedThreadSafe<SurfaceTexture>; |
| ~SurfaceTexture(); |