OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 5 #ifndef UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
6 #define UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 6 #define UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // Release the SurfaceTexture back buffers. The SurfaceTexture is no longer | 60 // Release the SurfaceTexture back buffers. The SurfaceTexture is no longer |
61 // usable after calling this. Note that this is not called 'Release', like | 61 // usable after calling this. Note that this is not called 'Release', like |
62 // the android API, because scoped_refptr<> calls that quite a bit. | 62 // the android API, because scoped_refptr<> calls that quite a bit. |
63 void ReleaseSurfaceTexture(); | 63 void ReleaseSurfaceTexture(); |
64 | 64 |
65 const base::android::JavaRef<jobject>& j_surface_texture() const { | 65 const base::android::JavaRef<jobject>& j_surface_texture() const { |
66 return j_surface_texture_; | 66 return j_surface_texture_; |
67 } | 67 } |
68 | 68 |
69 static bool RegisterSurfaceTexture(JNIEnv* env); | |
70 | |
71 protected: | 69 protected: |
72 explicit SurfaceTexture( | 70 explicit SurfaceTexture( |
73 const base::android::ScopedJavaLocalRef<jobject>& j_surface_texture); | 71 const base::android::ScopedJavaLocalRef<jobject>& j_surface_texture); |
74 | 72 |
75 private: | 73 private: |
76 friend class base::RefCountedThreadSafe<SurfaceTexture>; | 74 friend class base::RefCountedThreadSafe<SurfaceTexture>; |
77 ~SurfaceTexture(); | 75 ~SurfaceTexture(); |
78 | 76 |
79 // Java SurfaceTexture instance. | 77 // Java SurfaceTexture instance. |
80 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; | 78 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; |
81 | 79 |
82 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); | 80 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); |
83 }; | 81 }; |
84 | 82 |
85 } // namespace gl | 83 } // namespace gl |
86 | 84 |
87 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 85 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
OLD | NEW |