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

Unified Diff: content/app/android/child_process_service.cc

Issue 177953004: Enable SurfaceTexture based zero-copy texture uploading on Android platform Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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: 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();
}

Powered by Google App Engine
This is Rietveld 408576698