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

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

Issue 1419623008: ui: Use single buffer SurfaceTexture mode for native GpuMemoryBuffers on Android. Base URL: https://chromium.googlesource.com/chromium/src.git@1419733005
Patch Set: libs = [] Created 5 years 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
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/android/surface_texture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/android/surface_texture.h
diff --git a/ui/gl/android/surface_texture.h b/ui/gl/android/surface_texture.h
index c6ae70490120ccbaf35a807d8ad9a398aa5d4b4c..92b660949405278ac3fe2ab7c5c058a922c33713 100644
--- a/ui/gl/android/surface_texture.h
+++ b/ui/gl/android/surface_texture.h
@@ -22,6 +22,7 @@ class GL_EXPORT SurfaceTexture
: public base::RefCountedThreadSafe<SurfaceTexture>{
public:
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 +34,13 @@ 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 only in single buffered mode
+ // to allow the image content producer to take ownership
+ // of the image buffer.
+ // This is *only* supported on SurfaceTexture instantiated via
+ // |CreateSingleBuffered(...)|.
+ 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]);
@@ -54,6 +62,10 @@ class GL_EXPORT SurfaceTexture
return j_surface_texture_;
}
+ // This should only be used to guard the SurfaceTexture instantiated via
+ // |CreateSingleBuffered(...)|
+ static bool IsSingleBufferModeSupported();
+
static bool RegisterSurfaceTexture(JNIEnv* env);
protected:
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/android/surface_texture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698