| 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_IO_SURFACE_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include <IOSurface/IOSurface.h> | 10 #include <IOSurface/IOSurface.h> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 gfx::BufferFormat format); | 40 gfx::BufferFormat format); |
| 41 | 41 |
| 42 // Overridden from GpuMemoryBufferFactory: | 42 // Overridden from GpuMemoryBufferFactory: |
| 43 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( | 43 gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer( |
| 44 gfx::GpuMemoryBufferId id, | 44 gfx::GpuMemoryBufferId id, |
| 45 const gfx::Size& size, | 45 const gfx::Size& size, |
| 46 gfx::BufferFormat format, | 46 gfx::BufferFormat format, |
| 47 gfx::BufferUsage usage, | 47 gfx::BufferUsage usage, |
| 48 int client_id, | 48 int client_id, |
| 49 gfx::PluginWindowHandle surface_handle) override; | 49 gfx::PluginWindowHandle surface_handle) override; |
| 50 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromHandle( |
| 51 const gfx::GpuMemoryBufferHandle& handle, |
| 52 gfx::GpuMemoryBufferId id, |
| 53 const gfx::Size& size, |
| 54 gfx::BufferFormat format, |
| 55 int client_id) override; |
| 50 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 56 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 51 int client_id) override; | 57 int client_id) override; |
| 52 gpu::ImageFactory* AsImageFactory() override; | 58 gpu::ImageFactory* AsImageFactory() override; |
| 53 | 59 |
| 54 // Overridden from gpu::ImageFactory: | 60 // Overridden from gpu::ImageFactory: |
| 55 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( | 61 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( |
| 56 const gfx::GpuMemoryBufferHandle& handle, | 62 const gfx::GpuMemoryBufferHandle& handle, |
| 57 const gfx::Size& size, | 63 const gfx::Size& size, |
| 58 gfx::BufferFormat format, | 64 gfx::BufferFormat format, |
| 59 unsigned internalformat, | 65 unsigned internalformat, |
| 60 int client_id) override; | 66 int client_id) override; |
| 61 | 67 |
| 62 private: | 68 private: |
| 63 typedef std::pair<IOSurfaceId, int> IOSurfaceMapKey; | 69 typedef std::pair<IOSurfaceId, int> IOSurfaceMapKey; |
| 64 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> | 70 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> |
| 65 IOSurfaceMap; | 71 IOSurfaceMap; |
| 66 IOSurfaceMap io_surfaces_; | 72 IOSurfaceMap io_surfaces_; |
| 67 base::Lock io_surfaces_lock_; | 73 base::Lock io_surfaces_lock_; |
| 68 | 74 |
| 69 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); | 75 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); |
| 70 }; | 76 }; |
| 71 | 77 |
| 72 } // namespace content | 78 } // namespace content |
| 73 | 79 |
| 74 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 80 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| OLD | NEW |