| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Creates a native render surface for this surface texture. | 55 // Creates a native render surface for this surface texture. |
| 56 // The caller must release the underlying reference when done with the handle | 56 // The caller must release the underlying reference when done with the handle |
| 57 // by calling ANativeWindow_release(). | 57 // by calling ANativeWindow_release(). |
| 58 ANativeWindow* CreateSurface(); | 58 ANativeWindow* CreateSurface(); |
| 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 // Set the default buffer size for the surface texture. |
| 66 void SetDefaultBufferSize(int width, int height); |
| 67 |
| 65 const base::android::JavaRef<jobject>& j_surface_texture() const { | 68 const base::android::JavaRef<jobject>& j_surface_texture() const { |
| 66 return j_surface_texture_; | 69 return j_surface_texture_; |
| 67 } | 70 } |
| 68 | 71 |
| 69 protected: | 72 protected: |
| 70 explicit SurfaceTexture( | 73 explicit SurfaceTexture( |
| 71 const base::android::ScopedJavaLocalRef<jobject>& j_surface_texture); | 74 const base::android::ScopedJavaLocalRef<jobject>& j_surface_texture); |
| 72 | 75 |
| 73 private: | 76 private: |
| 74 friend class base::RefCountedThreadSafe<SurfaceTexture>; | 77 friend class base::RefCountedThreadSafe<SurfaceTexture>; |
| 75 ~SurfaceTexture(); | 78 ~SurfaceTexture(); |
| 76 | 79 |
| 77 // Java SurfaceTexture instance. | 80 // Java SurfaceTexture instance. |
| 78 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; | 81 base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; |
| 79 | 82 |
| 80 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); | 83 DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 } // namespace gl | 86 } // namespace gl |
| 84 | 87 |
| 85 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ | 88 #endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ |
| OLD | NEW |