Chromium Code Reviews| Index: content/app/android/child_process_service.cc |
| diff --git a/content/app/android/child_process_service.cc b/content/app/android/child_process_service.cc |
| index dae54e5941d31fbba56b4f9ce75843ef42ed9eea..943ee06f11ca22d8c032b4deb6e92049d9f40d3e 100644 |
| --- a/content/app/android/child_process_service.cc |
| +++ b/content/app/android/child_process_service.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/posix/global_descriptors.h" |
| #include "content/child/child_thread.h" |
| #include "content/common/android/surface_texture_peer.h" |
| +#include "content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.h" |
| #include "content/common/gpu/gpu_surface_lookup.h" |
| #include "content/public/app/android_library_loader_hooks.h" |
| #include "content/public/common/content_descriptors.h" |
| @@ -136,6 +137,18 @@ bool RegisterChildProcessService(JNIEnv* env) { |
| return RegisterNativesImpl(env); |
| } |
| +void SetupSurfaceTexture(JNIEnv* env, |
| + jclass clazz, |
| + jlong gpu_memory_buffer, |
| + jobject jsurface) { |
| + ANativeWindow* window = NULL; |
| + if (jsurface) |
| + window = ANativeWindow_fromSurface(env, jsurface); |
|
Hongbo Min
2014/03/18 06:10:03
When would `window` be released?
|
| + GpuMemoryBufferImplSurfaceTexture* gpu_memory_buffer_handle = |
|
Hongbo Min
2014/03/18 06:10:03
Return as early as possible if window is NULL.
|
| + (GpuMemoryBufferImplSurfaceTexture*)(gpu_memory_buffer); |
| + gpu_memory_buffer_handle->setNativeWindow(window); |
| +} |
| + |
| void ShutdownMainThread(JNIEnv* env, jobject obj) { |
| ChildThread::ShutdownThread(); |
| } |