Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: ui/gl/android/surface_texture.h

Issue 191933002: This is initial API support required for enabling SurfaceTexture backed zero-copy for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sdk version check and comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4068f852b94b1d95dca791308cf083e0e199a5a8 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 SurfaceTexture* Create(int texture_id);
reveman 2014/03/10 16:16:58 this should return a scoped_refptr<SurfaceTexture>
+
+ static SurfaceTexture* CreateSingleBufferMode(int texture_id);
reveman 2014/03/10 16:16:58 I think "CreateSingleBuffered" is better
// 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.
+ 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
reveman 2014/03/10 16:16:58 nit: no need for "// static" comment
+ static bool IsSingleBufferModeSupported();
+
static bool RegisterSurfaceTexture(JNIEnv* env);
+ protected:
+ SurfaceTexture(int texture_id, bool single_buffer_mode);
reveman 2014/03/10 16:16:58 How about we make this private and take a jobject:
+
private:
friend class base::RefCountedThreadSafe<SurfaceTexture>;
~SurfaceTexture();

Powered by Google App Engine
This is Rietveld 408576698