| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ | 5 #ifndef GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ |
| 6 #define GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ | 6 #define GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 public: | 21 public: |
| 22 static GPU_EXPORT InProcessSurfaceTextureManager* GetInstance(); | 22 static GPU_EXPORT InProcessSurfaceTextureManager* GetInstance(); |
| 23 | 23 |
| 24 // Overridden from SurfaceTextureManager: | 24 // Overridden from SurfaceTextureManager: |
| 25 void RegisterSurfaceTexture(int surface_texture_id, | 25 void RegisterSurfaceTexture(int surface_texture_id, |
| 26 int client_id, | 26 int client_id, |
| 27 gl::SurfaceTexture* surface_texture) override; | 27 gl::SurfaceTexture* surface_texture) override; |
| 28 void UnregisterSurfaceTexture(int surface_texture_id, int client_id) override; | 28 void UnregisterSurfaceTexture(int surface_texture_id, int client_id) override; |
| 29 gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture( | 29 gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture( |
| 30 int surface_texture_id) override; | 30 int surface_texture_id) override; |
| 31 void RegisterBrowserSurfaceTexture( |
| 32 int surface_texture_id, |
| 33 gl::SurfaceTexture* surface_texture) override; |
| 34 void UnregisterBrowserSurfaceTexture(int surface_texture_id) override; |
| 35 gl::ScopedJavaSurface GetBrowserSurfaceTexture( |
| 36 int surface_texture_id) override; |
| 31 | 37 |
| 32 private: | 38 private: |
| 33 friend struct base::DefaultSingletonTraits<InProcessSurfaceTextureManager>; | 39 friend struct base::DefaultSingletonTraits<InProcessSurfaceTextureManager>; |
| 34 | 40 |
| 35 InProcessSurfaceTextureManager(); | 41 InProcessSurfaceTextureManager(); |
| 36 ~InProcessSurfaceTextureManager() override; | 42 ~InProcessSurfaceTextureManager() override; |
| 37 | 43 |
| 38 using SurfaceTextureMap = | 44 using SurfaceTextureMap = |
| 39 base::ScopedPtrHashMap<int, std::unique_ptr<gl::ScopedJavaSurface>>; | 45 base::ScopedPtrHashMap<int, std::unique_ptr<gl::ScopedJavaSurface>>; |
| 40 SurfaceTextureMap surface_textures_; | 46 SurfaceTextureMap surface_textures_; |
| 47 |
| 48 // TODO(tguilbert): Use the same unorderer map if possible. |
| 49 std::unordered_map<int, gl::ScopedJavaSurface> browser_surface_textures_; |
| 41 base::Lock lock_; | 50 base::Lock lock_; |
| 42 | 51 |
| 43 DISALLOW_COPY_AND_ASSIGN(InProcessSurfaceTextureManager); | 52 DISALLOW_COPY_AND_ASSIGN(InProcessSurfaceTextureManager); |
| 44 }; | 53 }; |
| 45 | 54 |
| 46 } // namespace gpu | 55 } // namespace gpu |
| 47 | 56 |
| 48 #endif // GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ | 57 #endif // GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ |
| OLD | NEW |