OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/gl/android/scoped_java_surface.h" | 5 #include "ui/gl/android/scoped_java_surface.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "jni/Surface_jni.h" | 8 #include "jni/Surface_jni.h" |
9 #include "ui/gl/android/surface_texture.h" | 9 #include "ui/gl/android/surface_texture.h" |
10 | 10 |
| 11 using base::android::ScopedJavaLocalRef; |
| 12 |
11 namespace gl { | 13 namespace gl { |
12 | 14 |
13 ScopedJavaSurface::ScopedJavaSurface() { | 15 ScopedJavaSurface::ScopedJavaSurface() { |
14 } | 16 } |
15 | 17 |
16 ScopedJavaSurface::ScopedJavaSurface( | 18 ScopedJavaSurface::ScopedJavaSurface( |
17 const base::android::JavaRef<jobject>& surface) | 19 const base::android::JavaRef<jobject>& surface) |
18 : auto_release_(true), | 20 : auto_release_(true), |
19 is_protected_(false) { | 21 is_protected_(false) { |
20 JNIEnv* env = base::android::AttachCurrentThread(); | 22 JNIEnv* env = base::android::AttachCurrentThread(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 JNIEnv* env = base::android::AttachCurrentThread(); | 67 JNIEnv* env = base::android::AttachCurrentThread(); |
66 ScopedJavaLocalRef<jobject> surface_ref; | 68 ScopedJavaLocalRef<jobject> surface_ref; |
67 surface_ref.Reset(env, surface); | 69 surface_ref.Reset(env, surface); |
68 ScopedJavaSurface scoped_surface(surface_ref); | 70 ScopedJavaSurface scoped_surface(surface_ref); |
69 scoped_surface.auto_release_ = false; | 71 scoped_surface.auto_release_ = false; |
70 scoped_surface.is_protected_ = true; | 72 scoped_surface.is_protected_ = true; |
71 return scoped_surface; | 73 return scoped_surface; |
72 } | 74 } |
73 | 75 |
74 } // namespace gl | 76 } // namespace gl |
OLD | NEW |