| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ | |
| 6 #define GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/containers/scoped_ptr_hash_map.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "base/memory/singleton.h" | |
| 13 #include "base/synchronization/lock.h" | |
| 14 #include "gpu/gpu_export.h" | |
| 15 #include "gpu/ipc/common/android/surface_texture_manager.h" | |
| 16 #include "ui/gl/android/scoped_java_surface.h" | |
| 17 | |
| 18 namespace gpu { | |
| 19 | |
| 20 class GPU_EXPORT InProcessSurfaceTextureManager : public SurfaceTextureManager { | |
| 21 public: | |
| 22 static GPU_EXPORT InProcessSurfaceTextureManager* GetInstance(); | |
| 23 | |
| 24 // Overridden from SurfaceTextureManager: | |
| 25 void RegisterSurfaceTexture(int surface_texture_id, | |
| 26 int client_id, | |
| 27 gl::SurfaceTexture* surface_texture) override; | |
| 28 void UnregisterSurfaceTexture(int surface_texture_id, int client_id) override; | |
| 29 gfx::AcceleratedWidget AcquireNativeWidgetForSurfaceTexture( | |
| 30 int surface_texture_id) override; | |
| 31 | |
| 32 private: | |
| 33 friend struct base::DefaultSingletonTraits<InProcessSurfaceTextureManager>; | |
| 34 | |
| 35 InProcessSurfaceTextureManager(); | |
| 36 ~InProcessSurfaceTextureManager() override; | |
| 37 | |
| 38 using SurfaceTextureMap = | |
| 39 base::ScopedPtrHashMap<int, std::unique_ptr<gl::ScopedJavaSurface>>; | |
| 40 SurfaceTextureMap surface_textures_; | |
| 41 base::Lock lock_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(InProcessSurfaceTextureManager); | |
| 44 }; | |
| 45 | |
| 46 } // namespace gpu | |
| 47 | |
| 48 #endif // GPU_IPC_CLIENT_ANDROID_IN_PROCESS_SURFACE_TEXTURE_MANAGER_H_ | |
| OLD | NEW |