OLD | NEW |
---|---|
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/common/android/surface_texture_bridge.h" | 5 #include "content/common/android/surface_texture_bridge.h" |
6 | 6 |
7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 env, j_surface_texture_.obj()); | 121 env, j_surface_texture_.obj()); |
122 } | 122 } |
123 | 123 |
124 ANativeWindow* SurfaceTextureBridge::CreateSurface() { | 124 ANativeWindow* SurfaceTextureBridge::CreateSurface() { |
125 JNIEnv* env = AttachCurrentThread(); | 125 JNIEnv* env = AttachCurrentThread(); |
126 ScopedJavaLocalRef<jobject> jsurface( | 126 ScopedJavaLocalRef<jobject> jsurface( |
127 JNI_Surface::Java_Surface_Constructor( | 127 JNI_Surface::Java_Surface_Constructor( |
128 env, j_surface_texture_.obj())); | 128 env, j_surface_texture_.obj())); |
129 DCHECK(!jsurface.is_null()); | 129 DCHECK(!jsurface.is_null()); |
130 ANativeWindow* native_window = ANativeWindow_fromSurface(env, jsurface.obj()); | 130 ANativeWindow* native_window = ANativeWindow_fromSurface(env, jsurface.obj()); |
131 JNI_Surface::Java_Surface_release(env, jsurface.obj()); | |
bulach
2013/01/08 15:51:49
rather than .obj() you may want to use .Release()
benm (inactive)
2013/01/08 15:56:39
Well, it's a scopedref that's going out of scope o
| |
131 return native_window; | 132 return native_window; |
132 } | 133 } |
133 | 134 |
134 } // namespace content | 135 } // namespace content |
OLD | NEW |