| 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 CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ | 6 #define CONTENT_COMMON_GPU_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" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 ~GpuMemoryBufferFactorySurfaceTexture() override; | 34 ~GpuMemoryBufferFactorySurfaceTexture() override; |
| 35 | 35 |
| 36 // Overridden from GpuMemoryBufferFactory: | 36 // Overridden from GpuMemoryBufferFactory: |
| 37 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 37 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
| 38 gfx::GpuMemoryBufferId id, | 38 gfx::GpuMemoryBufferId id, |
| 39 const gfx::Size& size, | 39 const gfx::Size& size, |
| 40 gfx::BufferFormat format, | 40 gfx::BufferFormat format, |
| 41 gfx::BufferUsage usage, | 41 gfx::BufferUsage usage, |
| 42 int client_id, | 42 int client_id, |
| 43 gpu::SurfaceHandle surface_handle) override; | 43 gpu::SurfaceHandle surface_handle) override; |
| 44 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromHandle( | |
| 45 const gfx::GpuMemoryBufferHandle& handle, | |
| 46 gfx::GpuMemoryBufferId id, | |
| 47 const gfx::Size& size, | |
| 48 gfx::BufferFormat format, | |
| 49 int client_id) override; | |
| 50 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 44 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 51 int client_id) override; | 45 int client_id) override; |
| 52 gpu::ImageFactory* AsImageFactory() override; | 46 gpu::ImageFactory* AsImageFactory() override; |
| 53 | 47 |
| 54 // Overridden from gpu::ImageFactory: | 48 // Overridden from gpu::ImageFactory: |
| 55 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( | 49 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( |
| 56 const gfx::GpuMemoryBufferHandle& handle, | 50 const gfx::GpuMemoryBufferHandle& handle, |
| 57 const gfx::Size& size, | 51 const gfx::Size& size, |
| 58 gfx::BufferFormat format, | 52 gfx::BufferFormat format, |
| 59 unsigned internalformat, | 53 unsigned internalformat, |
| 60 int client_id) override; | 54 int client_id) override; |
| 61 | 55 |
| 62 private: | 56 private: |
| 63 typedef std::pair<int, int> SurfaceTextureMapKey; | 57 typedef std::pair<int, int> SurfaceTextureMapKey; |
| 64 typedef base::hash_map<SurfaceTextureMapKey, | 58 typedef base::hash_map<SurfaceTextureMapKey, |
| 65 scoped_refptr<gfx::SurfaceTexture>> SurfaceTextureMap; | 59 scoped_refptr<gfx::SurfaceTexture>> SurfaceTextureMap; |
| 66 SurfaceTextureMap surface_textures_; | 60 SurfaceTextureMap surface_textures_; |
| 67 base::Lock surface_textures_lock_; | 61 base::Lock surface_textures_lock_; |
| 68 }; | 62 }; |
| 69 | 63 |
| 70 } // namespace content | 64 } // namespace content |
| 71 | 65 |
| 72 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ | 66 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_SURFACE_TEXTURE_H_ |
| OLD | NEW |