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" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "ui/gl/gl_export.h" | 14 #include "ui/gl/gl_export.h" |
15 | 15 |
16 struct ANativeWindow; | 16 struct ANativeWindow; |
17 | 17 |
18 namespace gfx { | 18 namespace gl { |
19 | 19 |
20 // This class serves as a bridge for native code to call java functions inside | 20 // This class serves as a bridge for native code to call java functions inside |
21 // android SurfaceTexture class. | 21 // android SurfaceTexture class. |
22 class GL_EXPORT SurfaceTexture | 22 class GL_EXPORT SurfaceTexture |
23 : public base::RefCountedThreadSafe<SurfaceTexture>{ | 23 : public base::RefCountedThreadSafe<SurfaceTexture>{ |
24 public: | 24 public: |
25 static scoped_refptr<SurfaceTexture> Create(int texture_id); | 25 static scoped_refptr<SurfaceTexture> Create(int texture_id); |
26 | 26 |
27 // Set the listener callback, which will be invoked on the same thread that | 27 // Set the listener callback, which will be invoked on the same thread that |
28 // is being called from here for registration. | 28 // is being called from here for registration. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 private: | 70 private: |
71 friend class base::RefCountedThreadSafe<SurfaceTexture>; | 71 friend class base::RefCountedThreadSafe<SurfaceTexture>; |
72 ~SurfaceTexture(); | 72 ~SurfaceTexture(); |
73 | 73 |
74 // Java SurfaceTexture instance. | 74 // Java SurfaceTexture instance. |
75 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; | 75 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); | 77 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace gfx | 80 } // namespace gl |
81 | 81 |
82 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 82 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
OLD | NEW |