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 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 bool ScopedJavaSurface::IsEmpty() const { | 74 bool ScopedJavaSurface::IsEmpty() const { |
75 return j_surface_.is_null(); | 75 return j_surface_.is_null(); |
76 } | 76 } |
77 | 77 |
78 // static | 78 // static |
79 ScopedJavaSurface ScopedJavaSurface::AcquireExternalSurface(jobject surface) { | 79 ScopedJavaSurface ScopedJavaSurface::AcquireExternalSurface(jobject surface) { |
80 JNIEnv* env = base::android::AttachCurrentThread(); | 80 JNIEnv* env = base::android::AttachCurrentThread(); |
81 ScopedJavaLocalRef<jobject> surface_ref; | 81 ScopedJavaLocalRef<jobject> surface_ref; |
82 surface_ref.Reset(env, surface); | 82 surface_ref.Reset(env, surface); |
83 gl::ScopedJavaSurface scoped_surface(surface_ref); | 83 ScopedJavaSurface scoped_surface(surface_ref); |
84 scoped_surface.auto_release_ = false; | 84 scoped_surface.auto_release_ = false; |
85 scoped_surface.is_protected_ = true; | 85 scoped_surface.is_protected_ = true; |
86 return scoped_surface; | 86 return scoped_surface; |
87 } | 87 } |
88 | 88 |
89 } // namespace gl | 89 } // namespace gl |
OLD | NEW |