| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVICE_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ | 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "gpu/command_buffer/service/image_factory.h" | 13 #include "gpu/command_buffer/service/image_factory.h" |
| 14 #include "gpu/gpu_export.h" | 14 #include "gpu/gpu_export.h" |
| 15 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" | 15 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
| 16 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
| 17 #include "ui/gfx/gpu_memory_buffer.h" | 17 #include "ui/gfx/gpu_memory_buffer.h" |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gl { |
| 20 class GLImage; |
| 20 class SurfaceTexture; | 21 class SurfaceTexture; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace gl { | |
| 24 class GLImage; | |
| 25 } | |
| 26 | |
| 27 namespace gpu { | 24 namespace gpu { |
| 28 | 25 |
| 29 class GPU_EXPORT GpuMemoryBufferFactorySurfaceTexture | 26 class GPU_EXPORT GpuMemoryBufferFactorySurfaceTexture |
| 30 : public GpuMemoryBufferFactory, | 27 : public GpuMemoryBufferFactory, |
| 31 public ImageFactory { | 28 public ImageFactory { |
| 32 public: | 29 public: |
| 33 GpuMemoryBufferFactorySurfaceTexture(); | 30 GpuMemoryBufferFactorySurfaceTexture(); |
| 34 ~GpuMemoryBufferFactorySurfaceTexture() override; | 31 ~GpuMemoryBufferFactorySurfaceTexture() override; |
| 35 | 32 |
| 36 // Overridden from GpuMemoryBufferFactory: | 33 // Overridden from GpuMemoryBufferFactory: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 55 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( | 52 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( |
| 56 const gfx::GpuMemoryBufferHandle& handle, | 53 const gfx::GpuMemoryBufferHandle& handle, |
| 57 const gfx::Size& size, | 54 const gfx::Size& size, |
| 58 gfx::BufferFormat format, | 55 gfx::BufferFormat format, |
| 59 unsigned internalformat, | 56 unsigned internalformat, |
| 60 int client_id) override; | 57 int client_id) override; |
| 61 | 58 |
| 62 private: | 59 private: |
| 63 typedef std::pair<int, int> SurfaceTextureMapKey; | 60 typedef std::pair<int, int> SurfaceTextureMapKey; |
| 64 typedef base::hash_map<SurfaceTextureMapKey, | 61 typedef base::hash_map<SurfaceTextureMapKey, |
| 65 scoped_refptr<gfx::SurfaceTexture>> SurfaceTextureMap; | 62 scoped_refptr<gl::SurfaceTexture>> |
| 63 SurfaceTextureMap; |
| 66 SurfaceTextureMap surface_textures_; | 64 SurfaceTextureMap surface_textures_; |
| 67 base::Lock surface_textures_lock_; | 65 base::Lock surface_textures_lock_; |
| 68 }; | 66 }; |
| 69 | 67 |
| 70 } // namespace gpu | 68 } // namespace gpu |
| 71 | 69 |
| 72 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ | 70 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ |
| OLD | NEW |