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

Unified Diff: gpu/ipc/client/android/in_process_surface_texture_manager.cc

Issue 2268173002: Add StreamTexture resgistration for the Browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: gpu/ipc/client/android/in_process_surface_texture_manager.cc
diff --git a/gpu/ipc/client/android/in_process_surface_texture_manager.cc b/gpu/ipc/client/android/in_process_surface_texture_manager.cc
index 84fc5eee88dee7f57309050847c89f57dfd7bfe8..6bf0d01cbe60aa51ad7c5e4a541f5f6898df84ac 100644
--- a/gpu/ipc/client/android/in_process_surface_texture_manager.cc
+++ b/gpu/ipc/client/android/in_process_surface_texture_manager.cc
@@ -42,6 +42,39 @@ void InProcessSurfaceTextureManager::UnregisterSurfaceTexture(
surface_textures_.erase(surface_texture_id);
}
+void InProcessSurfaceTextureManager::RegisterBrowserSurfaceTexture(
+ int surface_texture_id,
+ gl::SurfaceTexture* surface_texture) {
+ base::AutoLock lock(lock_);
+
+ DCHECK(browser_surface_textures_.find(surface_texture_id) ==
+ browser_surface_textures_.end());
+ browser_surface_textures_.insert(std::make_pair(
+ surface_texture_id, gl::ScopedJavaSurface(surface_texture)));
+};
+
+void InProcessSurfaceTextureManager::UnregisterBrowserSurfaceTexture(
+ int surface_texture_id) {
+ base::AutoLock lock(lock_);
+
+ DCHECK(browser_surface_textures_.find(surface_texture_id) !=
+ browser_surface_textures_.end());
+ browser_surface_textures_.erase(surface_texture_id);
+};
+
+gl::ScopedJavaSurface InProcessSurfaceTextureManager::GetBrowserSurfaceTexture(
+ int surface_texture_id) {
+ base::AutoLock lock(lock_);
+
+ DCHECK(browser_surface_textures_.find(surface_texture_id) !=
+ browser_surface_textures_.end());
+ browser_surface_textures_.erase(surface_texture_id);
+ // TODO(tguilbert): multiple calls using the same |surface_texture_id| will
+ // probably not work.
+ // Fix before commiting if the general strategy in this CL is accepted.
+ return std::move(browser_surface_textures_.find(surface_texture_id)->second);
+};
+
gfx::AcceleratedWidget
InProcessSurfaceTextureManager::AcquireNativeWidgetForSurfaceTexture(
int surface_texture_id) {
« no previous file with comments | « gpu/ipc/client/android/in_process_surface_texture_manager.h ('k') | gpu/ipc/common/android/surface_texture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698