| 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_IO_SURFACE_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 6 #define GPU_IPC_SERVICE_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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 45 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 46 int client_id) override; | 46 int client_id) override; |
| 47 ImageFactory* AsImageFactory() override; | 47 ImageFactory* AsImageFactory() override; |
| 48 | 48 |
| 49 // Overridden from ImageFactory: | 49 // Overridden from ImageFactory: |
| 50 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( | 50 scoped_refptr<gl::GLImage> CreateImageForGpuMemoryBuffer( |
| 51 const gfx::GpuMemoryBufferHandle& handle, | 51 const gfx::GpuMemoryBufferHandle& handle, |
| 52 const gfx::Size& size, | 52 const gfx::Size& size, |
| 53 gfx::BufferFormat format, | 53 gfx::BufferFormat format, |
| 54 unsigned internalformat, | 54 unsigned internalformat, |
| 55 int client_id) override; | 55 int client_id, |
| 56 SurfaceHandle surface_handle) override; |
| 56 scoped_refptr<gl::GLImage> CreateAnonymousImage( | 57 scoped_refptr<gl::GLImage> CreateAnonymousImage( |
| 57 const gfx::Size& size, | 58 const gfx::Size& size, |
| 58 gfx::BufferFormat format, | 59 gfx::BufferFormat format, |
| 59 unsigned internalformat) override; | 60 unsigned internalformat) override; |
| 60 unsigned RequiredTextureType() override; | 61 unsigned RequiredTextureType() override; |
| 61 bool SupportsFormatRGB() override; | 62 bool SupportsFormatRGB() override; |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; | 65 typedef std::pair<gfx::IOSurfaceId, int> IOSurfaceMapKey; |
| 65 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> | 66 typedef base::hash_map<IOSurfaceMapKey, base::ScopedCFTypeRef<IOSurfaceRef>> |
| 66 IOSurfaceMap; | 67 IOSurfaceMap; |
| 67 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be | 68 // TOOD(reveman): Remove |io_surfaces_| and allow IOSurface backed GMBs to be |
| 68 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM. | 69 // used with any GPU process by passing a mach_port to CreateImageCHROMIUM. |
| 69 IOSurfaceMap io_surfaces_; | 70 IOSurfaceMap io_surfaces_; |
| 70 base::Lock io_surfaces_lock_; | 71 base::Lock io_surfaces_lock_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); | 73 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryIOSurface); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace gpu | 76 } // namespace gpu |
| 76 | 77 |
| 77 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ | 78 #endif // GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_IO_SURFACE_H_ |
| OLD | NEW |