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

Side by Side Diff: content/app/android/child_process_service_impl.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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/android/browser_surface_texture_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/app/android/child_process_service_impl.h" 5 #include "content/app/android/child_process_service_impl.h"
6 6
7 #include <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 #include <cpu-features.h> 8 #include <cpu-features.h>
9 9
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 Java_ChildProcessServiceImpl_createSurfaceTextureSurface( 58 Java_ChildProcessServiceImpl_createSurfaceTextureSurface(
59 env, service_impl_, surface_texture_id, client_id, 59 env, service_impl_, surface_texture_id, client_id,
60 surface_texture->j_surface_texture()); 60 surface_texture->j_surface_texture());
61 } 61 }
62 void UnregisterSurfaceTexture(int surface_texture_id, 62 void UnregisterSurfaceTexture(int surface_texture_id,
63 int client_id) override { 63 int client_id) override {
64 JNIEnv* env = base::android::AttachCurrentThread(); 64 JNIEnv* env = base::android::AttachCurrentThread();
65 Java_ChildProcessServiceImpl_destroySurfaceTextureSurface( 65 Java_ChildProcessServiceImpl_destroySurfaceTextureSurface(
66 env, service_impl_, surface_texture_id, client_id); 66 env, service_impl_, surface_texture_id, client_id);
67 } 67 }
68 void RegisterBrowserSurfaceTexture(
69 int surface_texture_id,
70 gl::SurfaceTexture* surface_texture) override {
71 JNIEnv* env = base::android::AttachCurrentThread();
72 Java_ChildProcessServiceImpl_createBrowserSurfaceTextureSurface(
73 env, service_impl_, surface_texture_id,
74 surface_texture->j_surface_texture());
75 }
76 void UnregisterBrowserSurfaceTexture(int surface_texture_id) override {
77 JNIEnv* env = base::android::AttachCurrentThread();
78 Java_ChildProcessServiceImpl_destroyBrowserSurfaceTextureSurface(
79 env, service_impl_, surface_texture_id);
80 }
81 gl::ScopedJavaSurface GetBrowserSurfaceTexture(
82 int surface_texture_id) override {
83 // SurfaceTexture registered via RegisterBrowserSurfaceTexture should only
84 // be accessed in the browser process.
85 NOTREACHED();
86 return gl::ScopedJavaSurface();
87 }
68 gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture( 88 gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture(
69 int surface_texture_id) override { 89 int surface_texture_id) override {
70 JNIEnv* env = base::android::AttachCurrentThread(); 90 JNIEnv* env = base::android::AttachCurrentThread();
71 gl::ScopedJavaSurface surface( 91 gl::ScopedJavaSurface surface(
72 Java_ChildProcessServiceImpl_getSurfaceTextureSurface( 92 Java_ChildProcessServiceImpl_getSurfaceTextureSurface(
73 env, service_impl_, surface_texture_id)); 93 env, service_impl_, surface_texture_id));
74 94
75 if (surface.j_surface().is_null()) 95 if (surface.j_surface().is_null())
76 return NULL; 96 return NULL;
77 97
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 194
175 bool RegisterChildProcessServiceImpl(JNIEnv* env) { 195 bool RegisterChildProcessServiceImpl(JNIEnv* env) {
176 return RegisterNativesImpl(env); 196 return RegisterNativesImpl(env);
177 } 197 }
178 198
179 void ShutdownMainThread(JNIEnv* env, const JavaParamRef<jobject>& obj) { 199 void ShutdownMainThread(JNIEnv* env, const JavaParamRef<jobject>& obj) {
180 ChildThreadImpl::ShutdownThread(); 200 ChildThreadImpl::ShutdownThread();
181 } 201 }
182 202
183 } // namespace content 203 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/browser_surface_texture_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698